Skip to main content

A Python client for Skroutz API.

Project description

pyskroutz

A Python client for Skroutz API.

testing badge build badge docs badge pypi badge code coverage badge

Installation

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.

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

results = pyskroutz.search(client)("iphone").execute()
results
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),
    ),
)

List Categories

categories = pyskroutz.categories(client).get(per=3).execute()
categories
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,
    ),
)

Retrieve a book

book = pyskroutz.books(client).get(242327).execute()
book
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",
            ),
        ),
    )
)

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

How to contribute

If you wish to contribute, check out the CONTRIBUTING.md guide for further details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyskroutz-0.1.10.tar.gz (29.6 kB view details)

Uploaded Source

Built Distribution

pyskroutz-0.1.10-py3-none-any.whl (38.0 kB view details)

Uploaded Python 3

File details

Details for the file pyskroutz-0.1.10.tar.gz.

File metadata

  • Download URL: pyskroutz-0.1.10.tar.gz
  • Upload date:
  • Size: 29.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

File hashes

Hashes for pyskroutz-0.1.10.tar.gz
Algorithm Hash digest
SHA256 1847e9c27d09ab55e5cec37b2fa406ab79a94c24c344581e8c4f469c9f01c0b9
MD5 0ed6b69a0c48b096688de7a20c289c4a
BLAKE2b-256 34361555b02b1d2f8fa26200410cc5615e2b595736f05388323da773aee22310

See more details on using hashes here.

File details

Details for the file pyskroutz-0.1.10-py3-none-any.whl.

File metadata

  • Download URL: pyskroutz-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 38.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

File hashes

Hashes for pyskroutz-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 db6705009f8c5a35aab145ad6cc4611346772f61b3555a1a369dbd74dbf85289
MD5 d90f04647932eff874ad5e88f6ca211c
BLAKE2b-256 dbaf66b6c61b70bcdf6b1fd526ee3419642525786896bd91863a664a815f1938

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page