pyskroutz


Namepyskroutz JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/sp1thas/pyskroutz
SummaryA Python client for Skroutz API.
upload_time2023-05-20 20:22:16
maintainerPanagiotis Simakis
docs_urlNone
authorPanagiotis Simakis
requires_python>=3.7
licenseGPL-3.0-only
keywords skroutz skroutz-api api-client
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
    <h1>pyskroutz</h1>
    <p>A Python client for <a href="https://developer.skroutz.gr/api/v3/">Skroutz API</a>.</p>
    <a href="https://results.pre-commit.ci/latest/github/sp1thas/pyskroutz/master">
        <img src="https://results.pre-commit.ci/badge/github/sp1thas/pyskroutz/master.svg" alt="pre-commit.ci status">
    </a>
    <img src="https://github.com/sp1thas/pyskroutz/workflows/build/badge.svg" alt="build badge">
    <img src="https://github.com/sp1thas/pyskroutz/workflows/testing/badge.svg" alt="testing badge">
    <a href="https://pypi.python.org/pypi/pyskroutz/">
        <img src="https://img.shields.io/pypi/v/pyskroutz.svg" alt="pypi badge" />
    </a>
    <a href="https://codecov.io/gh/sp1thas/pyskroutz">
        <img alt="code coverage badge" src="https://codecov.io/gh/sp1thas/pyskroutz/branch/master/graph/badge.svg?token=WTYZU0ENYX" />
    </a>
</div>
<hr>


## Installation
```bash
pip install pyskroutz
```

## Usage

First of all, you have to initiate an client in order to interact with Skroutz API. Make sure that you have a valid pair of client id and client secret. From now on, `client` will be the following object.

```python
import pyskroutz
client = pyskroutz.client('<client-id>', '<client-secret>')
```

The `client` object will be passed as parameter in order to retrieve data from a resource's endpoint.

### Search

```python
results = pyskroutz.search(client)("iphone").execute()
```
<details>
    <summary><code>results</code></summary>

```python
SearchResultsList(
    categories=[],
    meta=SearchMeta(
        q=None,
        alternatives=[],
        strong_matches=StrongMatcheItem(
            sku=None,
            manufacturer=ManufacturerItem(
                id=356,
                name="Apple",
                image_url=HttpUrl(
                    "https://a.scdn.gr/ds/manufacturers/356/20160322115406_ae6f9a87.png",
                    scheme="https",
                    host="a.scdn.gr",
                    tld="gr",
                    host_type="domain",
                    path="/ds/manufacturers/356/20160322115406_ae6f9a87.png",
                ),
            ),
        ),
        pagination=PaginationItem(page=1, per=25, total_pages=0, total_results=0),
    ),
)
```
</details>

### List Categories

```python
categories = pyskroutz.categories(client).get(per=3).execute()
```
<details>
    <summary><code>categories</code></summary>

```python
CategoryList(
    categories=[
        CategoryItem(
            web_uri=HttpUrl(
                "https://skroutz.gr/c/1/statherh-tilefwnia.html",
                scheme="https",
                host="skroutz.gr",
                tld="gr",
                host_type="domain",
                path="/c/1/statherh-tilefwnia.html",
            ),
            id=1,
            name="Σταθερή Τηλεφωνία",
            children_count=5,
            image_url=HttpUrl(
                "https://c.scdn.gr/ds/categories/1/20171113120915_72fa0f63.jpeg",
                scheme="https",
                host="c.scdn.gr",
                tld="gr",
                host_type="domain",
                path="/ds/categories/1/20171113120915_72fa0f63.jpeg",
            ),
            parent_id=2,
            fashion=True,
            layout_mode="tiles",
            code="statherh-tilefwnia",
            path="76,1269,2,1",
            show_specifications=False,
            manufacturer_title="Κατασκευαστές",
        ),
        CategoryItem(
            web_uri=HttpUrl(
                "https://skroutz.gr/c/2/tilefwnia.html",
                scheme="https",
                host="skroutz.gr",
                tld="gr",
                host_type="domain",
                path="/c/2/tilefwnia.html",
            ),
            id=2,
            name="Τηλεφωνία",
            children_count=2,
            image_url=HttpUrl(
                "https://b.scdn.gr/ds/categories/2/20171113120916_9d335c35.jpeg",
                scheme="https",
                host="b.scdn.gr",
                tld="gr",
                host_type="domain",
                path="/ds/categories/2/20171113120916_9d335c35.jpeg",
            ),
            parent_id=1269,
            fashion=True,
            layout_mode="tiles",
            code="tilefwnia",
            path="76,1269,2",
            show_specifications=False,
            manufacturer_title="Κατασκευαστές",
        ),
        CategoryItem(
            web_uri=HttpUrl(
                "https://skroutz.gr/c/5/photografia-video.html",
                scheme="https",
                host="skroutz.gr",
                tld="gr",
                host_type="domain",
                path="/c/5/photografia-video.html",
            ),
            id=5,
            name="Φωτογραφία & Video",
            children_count=4,
            image_url=HttpUrl(
                "https://b.scdn.gr/ds/categories/5/20171113120916_dfd75306.jpeg",
                scheme="https",
                host="b.scdn.gr",
                tld="gr",
                host_type="domain",
                path="/ds/categories/5/20171113120916_dfd75306.jpeg",
            ),
            parent_id=1269,
            fashion=True,
            layout_mode="tiles",
            code="photografia-video",
            path="76,1269,5",
            show_specifications=False,
            manufacturer_title="Κατασκευαστές",
        ),
    ],
    meta=MetaItemBase(
        available_filters=None,
        order_by=None,
        order_by_methods=None,
        pagination=PaginationItem(page=1, per=3, total_pages=1251, total_results=3751),
        personalization=None,
        sku_rating_breakdown=None,
        sku_reviews_aggregation=None,
    ),
)
```
</details>

### Retrieve a book

```python
book = pyskroutz.books(client).get(242327).execute()
```
<details>
    <summary><code>book</code></summary>

```python
BooksRetrieve(
    book=BookItem(
        web_uri=HttpUrl(
            "https://www.skroutz.gr/books/242327.%CE%9F-%CE%A7%CE%AC%CF%81%CE%B9-%CE%A0%CF%8C%CF%84%CE%B5%CF%81-%CE%BA%CE%B1%CE%B9-%CE%B7-%CF%86%CE%B9%CE%BB%CE%BF%CF%83%CE%BF%CF%86%CE%B9%CE%BA%CE%AE-%CE%BB%CE%AF%CE%B8%CE%BF%CF%82.html",
            scheme="https",
            host="www.skroutz.gr",
            tld="gr",
            host_type="domain",
            path="/books/242327.%CE%9F-%CE%A7%CE%AC%CF%81%CE%B9-%CE%A0%CF%8C%CF%84%CE%B5%CF%81-%CE%BA%CE%B1%CE%B9-%CE%B7-%CF%86%CE%B9%CE%BB%CE%BF%CF%83%CE%BF%CF%86%CE%B9%CE%BA%CE%AE-%CE%BB%CE%AF%CE%B8%CE%BF%CF%82.html",
        ),
        price_max=12.96,
        price_min=6.61,
        reviewable=True,
        reviews_count=15,
        reviewscore=4.93333,
        shop_count=42,
        id=242327,
        name="Ο Χάρι Πότερ και η φιλοσοφική λίθος",
        main_author_id=385,
        main_author="J. K. Rowling",
        images=ImageItemBase(
            alternatives=None,
            main=HttpUrl(
                "https://b.scdn.gr/images/sku_main_images/000242/242327/medium_20200219102603_o_chari_poter_kai_i_filosofiki_lithos.jpeg",
                scheme="https",
                host="b.scdn.gr",
                tld="gr",
                host_type="domain",
                path="/images/sku_main_images/000242/242327/medium_20200219102603_o_chari_poter_kai_i_filosofiki_lithos.jpeg",
            ),
        ),
    )
)
```
</details>

For further usage details navigate to `Resources`. Almost every endpoint of Skroutz API is supported by this client.

## How to contribute

If you wish to contribute, check out the [CONTRIBUTING.md](docs/contributing.md) guide for further details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sp1thas/pyskroutz",
    "name": "pyskroutz",
    "maintainer": "Panagiotis Simakis",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "skroutz,skroutz-api,api-client",
    "author": "Panagiotis Simakis",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/5f/e1/eb0c6dcf905ddc062a817a56aba8bb346b10d99c3cdcfac5155d648bae8a/pyskroutz-0.2.0.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n    <h1>pyskroutz</h1>\n    <p>A Python client for <a href=\"https://developer.skroutz.gr/api/v3/\">Skroutz API</a>.</p>\n    <a href=\"https://results.pre-commit.ci/latest/github/sp1thas/pyskroutz/master\">\n        <img src=\"https://results.pre-commit.ci/badge/github/sp1thas/pyskroutz/master.svg\" alt=\"pre-commit.ci status\">\n    </a>\n    <img src=\"https://github.com/sp1thas/pyskroutz/workflows/build/badge.svg\" alt=\"build badge\">\n    <img src=\"https://github.com/sp1thas/pyskroutz/workflows/testing/badge.svg\" alt=\"testing badge\">\n    <a href=\"https://pypi.python.org/pypi/pyskroutz/\">\n        <img src=\"https://img.shields.io/pypi/v/pyskroutz.svg\" alt=\"pypi badge\" />\n    </a>\n    <a href=\"https://codecov.io/gh/sp1thas/pyskroutz\">\n        <img alt=\"code coverage badge\" src=\"https://codecov.io/gh/sp1thas/pyskroutz/branch/master/graph/badge.svg?token=WTYZU0ENYX\" />\n    </a>\n</div>\n<hr>\n\n\n## Installation\n```bash\npip install pyskroutz\n```\n\n## Usage\n\nFirst of all, you have to initiate an client in order to interact with Skroutz API. Make sure that you have a valid pair of client id and client secret. From now on, `client` will be the following object.\n\n```python\nimport pyskroutz\nclient = pyskroutz.client('<client-id>', '<client-secret>')\n```\n\nThe `client` object will be passed as parameter in order to retrieve data from a resource's endpoint.\n\n### Search\n\n```python\nresults = pyskroutz.search(client)(\"iphone\").execute()\n```\n<details>\n    <summary><code>results</code></summary>\n\n```python\nSearchResultsList(\n    categories=[],\n    meta=SearchMeta(\n        q=None,\n        alternatives=[],\n        strong_matches=StrongMatcheItem(\n            sku=None,\n            manufacturer=ManufacturerItem(\n                id=356,\n                name=\"Apple\",\n                image_url=HttpUrl(\n                    \"https://a.scdn.gr/ds/manufacturers/356/20160322115406_ae6f9a87.png\",\n                    scheme=\"https\",\n                    host=\"a.scdn.gr\",\n                    tld=\"gr\",\n                    host_type=\"domain\",\n                    path=\"/ds/manufacturers/356/20160322115406_ae6f9a87.png\",\n                ),\n            ),\n        ),\n        pagination=PaginationItem(page=1, per=25, total_pages=0, total_results=0),\n    ),\n)\n```\n</details>\n\n### List Categories\n\n```python\ncategories = pyskroutz.categories(client).get(per=3).execute()\n```\n<details>\n    <summary><code>categories</code></summary>\n\n```python\nCategoryList(\n    categories=[\n        CategoryItem(\n            web_uri=HttpUrl(\n                \"https://skroutz.gr/c/1/statherh-tilefwnia.html\",\n                scheme=\"https\",\n                host=\"skroutz.gr\",\n                tld=\"gr\",\n                host_type=\"domain\",\n                path=\"/c/1/statherh-tilefwnia.html\",\n            ),\n            id=1,\n            name=\"\u03a3\u03c4\u03b1\u03b8\u03b5\u03c1\u03ae \u03a4\u03b7\u03bb\u03b5\u03c6\u03c9\u03bd\u03af\u03b1\",\n            children_count=5,\n            image_url=HttpUrl(\n                \"https://c.scdn.gr/ds/categories/1/20171113120915_72fa0f63.jpeg\",\n                scheme=\"https\",\n                host=\"c.scdn.gr\",\n                tld=\"gr\",\n                host_type=\"domain\",\n                path=\"/ds/categories/1/20171113120915_72fa0f63.jpeg\",\n            ),\n            parent_id=2,\n            fashion=True,\n            layout_mode=\"tiles\",\n            code=\"statherh-tilefwnia\",\n            path=\"76,1269,2,1\",\n            show_specifications=False,\n            manufacturer_title=\"\u039a\u03b1\u03c4\u03b1\u03c3\u03ba\u03b5\u03c5\u03b1\u03c3\u03c4\u03ad\u03c2\",\n        ),\n        CategoryItem(\n            web_uri=HttpUrl(\n                \"https://skroutz.gr/c/2/tilefwnia.html\",\n                scheme=\"https\",\n                host=\"skroutz.gr\",\n                tld=\"gr\",\n                host_type=\"domain\",\n                path=\"/c/2/tilefwnia.html\",\n            ),\n            id=2,\n            name=\"\u03a4\u03b7\u03bb\u03b5\u03c6\u03c9\u03bd\u03af\u03b1\",\n            children_count=2,\n            image_url=HttpUrl(\n                \"https://b.scdn.gr/ds/categories/2/20171113120916_9d335c35.jpeg\",\n                scheme=\"https\",\n                host=\"b.scdn.gr\",\n                tld=\"gr\",\n                host_type=\"domain\",\n                path=\"/ds/categories/2/20171113120916_9d335c35.jpeg\",\n            ),\n            parent_id=1269,\n            fashion=True,\n            layout_mode=\"tiles\",\n            code=\"tilefwnia\",\n            path=\"76,1269,2\",\n            show_specifications=False,\n            manufacturer_title=\"\u039a\u03b1\u03c4\u03b1\u03c3\u03ba\u03b5\u03c5\u03b1\u03c3\u03c4\u03ad\u03c2\",\n        ),\n        CategoryItem(\n            web_uri=HttpUrl(\n                \"https://skroutz.gr/c/5/photografia-video.html\",\n                scheme=\"https\",\n                host=\"skroutz.gr\",\n                tld=\"gr\",\n                host_type=\"domain\",\n                path=\"/c/5/photografia-video.html\",\n            ),\n            id=5,\n            name=\"\u03a6\u03c9\u03c4\u03bf\u03b3\u03c1\u03b1\u03c6\u03af\u03b1 & Video\",\n            children_count=4,\n            image_url=HttpUrl(\n                \"https://b.scdn.gr/ds/categories/5/20171113120916_dfd75306.jpeg\",\n                scheme=\"https\",\n                host=\"b.scdn.gr\",\n                tld=\"gr\",\n                host_type=\"domain\",\n                path=\"/ds/categories/5/20171113120916_dfd75306.jpeg\",\n            ),\n            parent_id=1269,\n            fashion=True,\n            layout_mode=\"tiles\",\n            code=\"photografia-video\",\n            path=\"76,1269,5\",\n            show_specifications=False,\n            manufacturer_title=\"\u039a\u03b1\u03c4\u03b1\u03c3\u03ba\u03b5\u03c5\u03b1\u03c3\u03c4\u03ad\u03c2\",\n        ),\n    ],\n    meta=MetaItemBase(\n        available_filters=None,\n        order_by=None,\n        order_by_methods=None,\n        pagination=PaginationItem(page=1, per=3, total_pages=1251, total_results=3751),\n        personalization=None,\n        sku_rating_breakdown=None,\n        sku_reviews_aggregation=None,\n    ),\n)\n```\n</details>\n\n### Retrieve a book\n\n```python\nbook = pyskroutz.books(client).get(242327).execute()\n```\n<details>\n    <summary><code>book</code></summary>\n\n```python\nBooksRetrieve(\n    book=BookItem(\n        web_uri=HttpUrl(\n            \"https://www.skroutz.gr/books/242327.%CE%9F-%CE%A7%CE%AC%CF%81%CE%B9-%CE%A0%CF%8C%CF%84%CE%B5%CF%81-%CE%BA%CE%B1%CE%B9-%CE%B7-%CF%86%CE%B9%CE%BB%CE%BF%CF%83%CE%BF%CF%86%CE%B9%CE%BA%CE%AE-%CE%BB%CE%AF%CE%B8%CE%BF%CF%82.html\",\n            scheme=\"https\",\n            host=\"www.skroutz.gr\",\n            tld=\"gr\",\n            host_type=\"domain\",\n            path=\"/books/242327.%CE%9F-%CE%A7%CE%AC%CF%81%CE%B9-%CE%A0%CF%8C%CF%84%CE%B5%CF%81-%CE%BA%CE%B1%CE%B9-%CE%B7-%CF%86%CE%B9%CE%BB%CE%BF%CF%83%CE%BF%CF%86%CE%B9%CE%BA%CE%AE-%CE%BB%CE%AF%CE%B8%CE%BF%CF%82.html\",\n        ),\n        price_max=12.96,\n        price_min=6.61,\n        reviewable=True,\n        reviews_count=15,\n        reviewscore=4.93333,\n        shop_count=42,\n        id=242327,\n        name=\"\u039f \u03a7\u03ac\u03c1\u03b9 \u03a0\u03cc\u03c4\u03b5\u03c1 \u03ba\u03b1\u03b9 \u03b7 \u03c6\u03b9\u03bb\u03bf\u03c3\u03bf\u03c6\u03b9\u03ba\u03ae \u03bb\u03af\u03b8\u03bf\u03c2\",\n        main_author_id=385,\n        main_author=\"J. K. Rowling\",\n        images=ImageItemBase(\n            alternatives=None,\n            main=HttpUrl(\n                \"https://b.scdn.gr/images/sku_main_images/000242/242327/medium_20200219102603_o_chari_poter_kai_i_filosofiki_lithos.jpeg\",\n                scheme=\"https\",\n                host=\"b.scdn.gr\",\n                tld=\"gr\",\n                host_type=\"domain\",\n                path=\"/images/sku_main_images/000242/242327/medium_20200219102603_o_chari_poter_kai_i_filosofiki_lithos.jpeg\",\n            ),\n        ),\n    )\n)\n```\n</details>\n\nFor further usage details navigate to `Resources`. Almost every endpoint of Skroutz API is supported by this client.\n\n## How to contribute\n\nIf you wish to contribute, check out the [CONTRIBUTING.md](docs/contributing.md) guide for further details.\n",
    "bugtrack_url": null,
    "license": "GPL-3.0-only",
    "summary": "A Python client for Skroutz API.",
    "version": "0.2.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/sp1thas/pyskroutz/issues",
        "Documentation": "https://pyskroutz.simakis.me/en/latest/",
        "Homepage": "https://github.com/sp1thas/pyskroutz",
        "Repository": "https://github.com/sp1thas/pyskroutz"
    },
    "split_keywords": [
        "skroutz",
        "skroutz-api",
        "api-client"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "08b0469811612b32ca2a20ae52acbe8922809257054ef4c5a8558e2bb373bff9",
                "md5": "b19e78d252b7ad53faae4b79cef2d4cd",
                "sha256": "65dcb8d1f442096a8197a89024e0af03b56867b761a619dff2ccc6787fce638f"
            },
            "downloads": -1,
            "filename": "pyskroutz-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b19e78d252b7ad53faae4b79cef2d4cd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 37133,
            "upload_time": "2023-05-20T20:22:13",
            "upload_time_iso_8601": "2023-05-20T20:22:13.513151Z",
            "url": "https://files.pythonhosted.org/packages/08/b0/469811612b32ca2a20ae52acbe8922809257054ef4c5a8558e2bb373bff9/pyskroutz-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5fe1eb0c6dcf905ddc062a817a56aba8bb346b10d99c3cdcfac5155d648bae8a",
                "md5": "5c83d316d71d31da3af95131891dbc4e",
                "sha256": "eca0c32ef399b199efeb7b70c54d2227a1a6b5b7ea11c595acff8b3c55937a11"
            },
            "downloads": -1,
            "filename": "pyskroutz-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5c83d316d71d31da3af95131891dbc4e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 28122,
            "upload_time": "2023-05-20T20:22:16",
            "upload_time_iso_8601": "2023-05-20T20:22:16.527480Z",
            "url": "https://files.pythonhosted.org/packages/5f/e1/eb0c6dcf905ddc062a817a56aba8bb346b10d99c3cdcfac5155d648bae8a/pyskroutz-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-20 20:22:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sp1thas",
    "github_project": "pyskroutz",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pyskroutz"
}
        
Elapsed time: 1.09962s