Skip to content

Categories

get

Retrieve a single category or list them all.

Parameters:

Name Type Description Default
id Optional[int]

category identifier

None
pag_params

pagination parameters

required
Source code in pyskroutz/resources/categories.py
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
@fluent
def get(self, id: Optional[int] = None, **pag_params: PaginationParams) -> None:
    """Retrieve a single category or list them all.

    Args:
        id: category identifier
        pag_params: pagination parameters
    """
    self._set_prepared_request(
        url=f"{self.BASE_URL}/{self.ENDPOINT_PATH}/{id}"
        if id is not None
        else f"{self.BASE_URL}/{self.ENDPOINT_PATH}",
        model=CategoryRetrieve if id is not None else CategoryList,
        params=pag_params,
    )

Example

pyskroutz.categories(client).get(88).execute()
CategoryRetrieve(
    category=CategoryItem(
        web_uri=HttpUrl(
            "https://skroutz.gr/c/88/ssd-sklhroi-diskoi.html",
            scheme="https",
            host="skroutz.gr",
            tld="gr",
            host_type="domain",
            path="/c/88/ssd-sklhroi-diskoi.html",
        ),
        id=88,
        name="SSD Σκληροί Δίσκοι",
        children_count=0,
        image_url=HttpUrl(
            "https://d.scdn.gr/ds/categories/88/20171113120930_4a77e901.jpeg",
            scheme="https",
            host="d.scdn.gr",
            tld="gr",
            host_type="domain",
            path="/ds/categories/88/20171113120930_4a77e901.jpeg",
        ),
        parent_id=1716,
        fashion=True,
        layout_mode="tiles",
        code="esoterikoi-sklhroi-diskoi",
        path="76,1269,22,27,46,1716,88",
        show_specifications=True,
        manufacturer_title="Κατασκευαστές",
    )
)

get_parent

Retrieve the parent of a category.

Parameters:

Name Type Description Default
id int

category identifier.

required
Source code in pyskroutz/resources/categories.py
35
36
37
38
39
40
41
42
43
44
45
@fluent
def get_parent(self, id: int) -> None:
    """Retrieve the parent of a category.

    Args:
        id: category identifier.
    """
    self._set_prepared_request(
        url=f"{self.BASE_URL}/{self.ENDPOINT_PATH}/{id}/parent",
        model=CategoryRetrieve,
    )

Example

pyskroutz.categories(client).get_parent(88).execute()
CategoryRetrieve(
    category=CategoryItem(
        web_uri=HttpUrl(
            "https://skroutz.gr/c/1716/esoterikoi_sklhroi_diskoi.html",
            scheme="https",
            host="skroutz.gr",
            tld="gr",
            host_type="domain",
            path="/c/1716/esoterikoi_sklhroi_diskoi.html",
        ),
        id=1716,
        name="Εσωτερικοί Σκληροί Δίσκοι",
        children_count=2,
        image_url=HttpUrl(
            "https://b.scdn.gr/ds/categories/1716/20171113121535_f0cdd20f.jpeg",
            scheme="https",
            host="b.scdn.gr",
            tld="gr",
            host_type="domain",
            path="/ds/categories/1716/20171113121535_f0cdd20f.jpeg",
        ),
        parent_id=46,
        fashion=True,
        layout_mode="tiles",
        code="esoterikoi_sklhroi_diskoi",
        path="76,1269,22,27,46,1716",
        show_specifications=False,
        manufacturer_title="Κατασκευαστές",
    )
)

get_root

Retrieve the root category.

Source code in pyskroutz/resources/categories.py
47
48
49
50
51
52
@fluent
def get_root(self) -> None:
    """Retrieve the root category."""
    self._set_prepared_request(
        url=f"{self.BASE_URL}/{self.ENDPOINT_PATH}/root", model=CategoryRetrieve
    )

Example

pyskroutz.categories(client).get_root().execute()
CategoryRetrieve(
    category=CategoryItem(
        web_uri=HttpUrl(
            "https://skroutz.gr/c/76/skroutz.html",
            scheme="https",
            host="skroutz.gr",
            tld="gr",
            host_type="domain",
            path="/c/76/skroutz.html",
        ),
        id=76,
        name="Skroutz",
        children_count=8,
        image_url=HttpUrl(
            "https://a.scdn.gr/ds/categories/76/76.jpg
            scheme="https",
            host="a.scdn.gr",
            tld="gr",
            host_type="domain",
            path="/ds/categories/76/76.jpg",
        ),
        parent_id=0,
        fashion=True,
        layout_mode="tiles",
        code="skroutz",
        path="76",
        show_specifications=False,
        manufacturer_title="Κατασκευαστές",
    )
)

list_children

List the children categories of a category.

Parameters:

Name Type Description Default
id int

category identifier.

required
**pag_params PaginationParams

pagination params.

{}
Source code in pyskroutz/resources/categories.py
54
55
56
57
58
59
60
61
62
63
64
65
66
@fluent
def list_children(self, id: int, **pag_params: PaginationParams) -> None:
    """List the children categories of a category.

    Args:
        id: category identifier.
        **pag_params: pagination params.
    """
    self._set_prepared_request(
        url=f"{self.BASE_URL}/{self.ENDPOINT_PATH}/{id}/children",
        model=CategoryList,
        params=pag_params,
    )

Example

pyskroutz.categories(client).list_children(252).execute()
CategoryList(
    categories=[
        CategoryItem(
            web_uri=HttpUrl(
                "https://skroutz.gr/c/283/gynaikeia-rouxa.html",
                scheme="https",
                host="skroutz.gr",
                tld="gr",
                host_type="domain",
                path="/c/283/gynaikeia-rouxa.html",
            ),
            id=283,
            name="Γυναικεία Ρούχα",
            children_count=26,
            image_url=HttpUrl(
                "https://c.scdn.gr/ds/categories/283/20201104173829_801473e1.jpeg",
                scheme="https",
                host="c.scdn.gr",
                tld="gr",
                host_type="domain",
                path="/ds/categories/283/20201104173829_801473e1.jpeg",
            ),
            parent_id=252,
            fashion=True,
            layout_mode="tiles",
            code="gynaikeia-endysh",
            path="76,274,252,283",
            show_specifications=False,
            manufacturer_title="Κατασκευαστές",
        ),
        CategoryItem(
            web_uri=HttpUrl(
                "https://skroutz.gr/c/372/gynaikeia-ypodhmata.html",
                scheme="https",
                host="skroutz.gr",
                tld="gr",
                host_type="domain",
                path="/c/372/gynaikeia-ypodhmata.html",
            ),
            id=372,
            name="Γυναικεία Παπούτσια",
            children_count=17,
            image_url=HttpUrl(
                "https://c.scdn.gr/ds/categories/372/20201103153126_32f1759a.jpeg",
                scheme="https",
                host="c.scdn.gr",
                tld="gr",
                host_type="domain",
                path="/ds/categories/372/20201103153126_32f1759a.jpeg",
            ),
            parent_id=252,
            fashion=True,
            layout_mode="tiles",
            code="gynaikeia-ypodhmata",
            path="76,274,252,372",
            show_specifications=False,
            manufacturer_title="Brands",
        ),
        CategoryItem(
            web_uri=HttpUrl(
                "https://skroutz.gr/c/281/gynakeia-aksesouar-endyshs-ypo.html",
                scheme="https",
                host="skroutz.gr",
                tld="gr",
                host_type="domain",
                path="/c/281/gynakeia-aksesouar-endyshs-ypo.html",
            ),
            id=281,
            name="Γυναικεία Αξεσουάρ",
            children_count=3,
            image_url=HttpUrl(
                "https://b.scdn.gr/ds/categories/281/20200811151908_c187ba11.jpeg",
                scheme="https",
                host="b.scdn.gr",
                tld="gr",
                host_type="domain",
                path="/ds/categories/281/20200811151908_c187ba11.jpeg",
            ),
            parent_id=252,
            fashion=True,
            layout_mode="tiles",
            code="gynakeia-aksesouar-endyshs-ypo",
            path="76,274,252,281",
            show_specifications=False,
            manufacturer_title="Κατασκευαστές",
        ),
    ],
    meta=MetaItemBase(
        available_filters=None,
        order_by=None,
        order_by_methods=None,
        pagination=PaginationItem(page=1, per=25, total_pages=1, total_results=3),
        personalization=None,
        sku_rating_breakdown=None,
        sku_reviews_aggregation=None,
    ),
)

get_specifications

List a category's specifications.

Parameters:

Name Type Description Default
id int

category identifier.

required
include_group bool

Include group.

None
**pag_params PaginationParams

pagination params.

{}
Source code in pyskroutz/resources/categories.py
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
@fluent
def get_specifications(
    self, id: int, include_group: bool = None, **pag_params: PaginationParams
) -> None:
    """List a category's specifications.

    Args:
        id: category identifier.
        include_group: Include group.
        **pag_params: pagination params.
    """
    self._set_prepared_request(
        url=f"{self.BASE_URL}/{self.ENDPOINT_PATH}/{id}/specifications",
        model=SpecificationList,
        params=pag_params
        if include_group is None
        else dict(include="group", **pag_params),  # type: ignore
    )

Example

pyskroutz.categories(client).get_specifications(40, include_group=True).execute()
SpecificationList(
    groups=[
        GroupItem(id=165, name="Βασικά Χαρακτηριστικά", order=0),
        GroupItem(id=167, name="Επεξεργαστής Μνήμη ", order=5),
        GroupItem(id=2164, name="Οθόνη", order=10),
        GroupItem(id=2163, name="Κάμερα", order=15),
        GroupItem(id=168, name="Δίκτυο & Συνδεσιμότητα", order=20),
        GroupItem(id=1957, name="Μπαταρία", order=25),
        GroupItem(id=2166, name="Ειδικά Χαρακτηριστικά", order=30),
        GroupItem(id=170, name="Μέγεθος & Βάρος", order=35),
    ],
    specifications=[
        SpecificationItem(id=1792, name="Τύπος Κινητού", values=[], order=5, unit=""),
        SpecificationItem(id=906, name="SIM", values=[], order=10, unit=""),
        SpecificationItem(
            id=575, name="Λειτουργικό Σύστημα", values=[], order=20, unit=""
        ),
        SpecificationItem(
            id=1528, name="Έτος Κυκλοφορίας", values=[], order=30, unit=""
        ),
        SpecificationItem(id=13192, name="Χρώμα", values=[], order=40, unit=""),
        SpecificationItem(
            id=5485, name="Ισχύς Βασικού Επεξεργαστή", values=[], order=2, unit="GHz"
        ),
        SpecificationItem(
            id=1424, name="Πυρήνες Επεξεργαστή", values=[], order=5, unit=""
        ),
        SpecificationItem(
            id=6859, name="Μοντέλο Επεξεργαστή", values=[], order=20, unit=""
        ),
        SpecificationItem(id=5455, name="RAM", values=[], order=40, unit="GB"),
        SpecificationItem(id=579, name="Χωρητικότητα", values=[], order=50, unit="GB"),
        SpecificationItem(id=580, name="Card Slot", values=[], order=55, unit=""),
        SpecificationItem(id=1526, name="Μέγεθος", values=[], order=5, unit='"'),
        SpecificationItem(id=1522, name="Ανάλυση", values=[], order=10, unit="pixels"),
        SpecificationItem(id=6226, name="Τύπος", values=[], order=20, unit=""),
        SpecificationItem(id=1530, name="Χειρισμός", values=[], order=50, unit=""),
        SpecificationItem(id=9801, name="Πίσω Κάμερα", values=[], order=5, unit=""),
        SpecificationItem(
            id=21036, name="Φακοί Πίσω Κάμερας", values=[], order=10, unit=""
        ),
        SpecificationItem(
            id=6228, name="Βίντεο Πίσω Κάμερας", values=[], order=20, unit=""
        ),
        SpecificationItem(
            id=2067, name="Flash Πίσω Κάμερας", values=[], order=25, unit=""
        ),
        SpecificationItem(
            id=21037, name="Φακοί Selfie Κάμερας", values=[], order=30, unit=""
        ),
        SpecificationItem(id=4321, name="Δίκτυο Σύνδεσης", values=[], order=0, unit=""),
        SpecificationItem(id=1521, name="Συνδεσιμότητα", values=[], order=10, unit=""),
        SpecificationItem(
            id=1426, name="Δείκτης SAR (Head)", values=[], order=20, unit="W/kg"
        ),
        SpecificationItem(
            id=3737, name="Χωρητικότητα", values=[], order=10, unit="mAh"
        ),
        SpecificationItem(id=3738, name="Αποσπώμενη", values=[], order=20, unit=""),
        SpecificationItem(
            id=5449, name="Γρήγορη Φόρτιση", values=[], order=30, unit=""
        ),
        SpecificationItem(
            id=19435, name="Ισχύς Φόρτισης", values=[], order=40, unit="W"
        ),
        SpecificationItem(
            id=5450, name="Ασύρματη Φόρτιση", values=[], order=50, unit=""
        ),
        SpecificationItem(
            id=601, name="Διάρκεια Αναμονής", values=[], order=70, unit="hrs"
        ),
        SpecificationItem(
            id=602, name="Διάρκεια Ομιλίας", values=[], order=80, unit="hrs"
        ),
        SpecificationItem(id=4315, name="Προστασία", values=[], order=5, unit=""),
        SpecificationItem(
            id=5875, name="Πιστοποίηση Προστασίας", values=[], order=20, unit=""
        ),
        SpecificationItem(id=4316, name="Αισθητήρες", values=[], order=30, unit=""),
        SpecificationItem(
            id=7194, name="Δακτυλικό Αποτύπωμα", values=[], order=50, unit=""
        ),
        SpecificationItem(id=603, name="Διαστάσεις", values=[], order=5, unit="mm"),
        SpecificationItem(id=604, name="Βάρος", values=[], order=10, unit="gr"),
    ],
)

get_manufacturers

List a category's manufacturers.

Parameters:

Name Type Description Default
id int

category identifier.

required
order_dir str

Order ascending or descending (asc, desc default)

None
**pag_params PaginationParams

pagination params.

{}
Source code in pyskroutz/resources/categories.py
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
@fluent
def get_manufacturers(
    self, id: int, order_dir: str = None, **pag_params: PaginationParams
) -> None:
    """List a category's manufacturers.

    Args:
        id: category identifier.
        order_dir: Order ascending or descending (`asc`, `desc` default)
        **pag_params: pagination params.
    """
    self._set_prepared_request(
        url=f"{self.BASE_URL}/{self.ENDPOINT_PATH}/{id}/manufacturers",
        model=SpecificationList,
        params=dict(**pag_params)
        if order_dir is None
        else dict(order_dir=order_dir, **dict(pag_params)),  # type: ignore
    )

Example

pyskroutz.categories(client).get_manufacturers(2).execute()
SpecificationList(groups=None, specifications=None)

get_favorites

List a category's favorites.

Parameters:

Name Type Description Default
id int

category identifier.

required
Source code in pyskroutz/resources/categories.py
106
107
108
109
110
111
112
113
114
115
116
@fluent
def get_favorites(self, id: int) -> None:
    """List a category's favorites.

    Args:
        id: category identifier.
    """
    self._set_prepared_request(
        url=f"{self.BASE_URL}/{self.ENDPOINT_PATH}/{id}/favorites",
        model=SpecificationList,
    )

Example

pyskroutz.categories(client).get_favorites(40).execute()
SpecificationList(groups=None, specifications=None)

Response Models

Response models for category resources

CategoryItem

Bases: ItemBase, WebUriBaseItem

Category Item response model.

Attributes:

Name Type Description
children_count int
image_url HttpUrl
parent_id int
fashion bool
layout_mode str
code str
path str
show_specifications bool
manufacturer_title str
Source code in pyskroutz/models/categories.py
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
class CategoryItem(ItemBase, WebUriBaseItem):
    """Category Item response model.

    Attributes:
        children_count:
        image_url:
        parent_id:
        fashion:
        layout_mode:
        code:
        path:
        show_specifications:
        manufacturer_title:
    """

    children_count: int
    image_url: HttpUrl
    parent_id: int
    fashion: bool
    layout_mode: str
    code: str
    path: str
    show_specifications: bool
    manufacturer_title: str

CategoryList

Bases: BaseModel

Response for a list of categories with meta details.

Attributes:

Name Type Description
categories List[CategoryItem]

A list of categories items.

meta MetaItemBase

response meta details.

Source code in pyskroutz/models/categories.py
82
83
84
85
86
87
88
89
90
91
class CategoryList(BaseModel):
    """Response for a list of categories with meta details.

    Attributes:
        categories: A list of categories items.
        meta: response meta details.
    """

    categories: List[CategoryItem]
    meta: MetaItemBase

GroupItem

Bases: BaseModel

Attributes:

Name Type Description
id int
name str
order int
Source code in pyskroutz/models/categories.py
15
16
17
18
19
20
21
22
23
24
25
26
class GroupItem(BaseModel):
    """

    Attributes:
        id:
        name:
        order:
    """

    id: int
    name: str
    order: int

SpecificationItem

Bases: BaseModel

Specification base model

Attributes:

Name Type Description
id int
name str
values List
order int
unit str
Source code in pyskroutz/models/categories.py
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
class SpecificationItem(BaseModel):
    """Specification base model

    Attributes:
        id:
        name:
        values:
        order:
        unit:
    """

    id: int
    name: str
    values: List
    order: int
    unit: str