A Python client for Skroutz API.


Keywords
skroutz, skroutz-api, api-client, api, api-wrapper, hacktoberfest, pypi, python
License
GPL-3.0-only
Install
pip install pyskroutz==0.1.14

Documentation

pyskroutz

A Python client for Skroutz API.

pre-commit.ci status build badge testing 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 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 guide for further details.