chizhik_api.endpoints.catalog

Работа с каталогом

Functions

api_child_field(child_factory, *[, repr, ...])

Dataclass field helper for child API services initialized in ApiParent.__post_init__.

autotest(func)

dataclass([cls, init, repr, eq, order, ...])

Add dunder methods based on the fields defined in the class.

Classes

ApiChild(parent)

Base class for API child services that keeps a typed parent reference.

ApiParent()

Dataclass mixin that initializes fields declared with api_child_field.

ClassCatalog(parent)

Методы для работы с каталогом товаров.

FetchResponse(request, page, url, headers, ...)

Represents the response of a request.

ProductService(parent)

Сервис для работы с товарами в каталоге.

class ClassCatalog(parent: ChizhikAPI)[source][source]

Bases: ApiChild[ChizhikAPI], ApiParent

Методы для работы с каталогом товаров.

Включает поиск товаров, получение информации о категориях, работу с фидами товаров и отзывами.

Product: ProductService

Сервис для работы с товарами в каталоге.

async tree(
city_id: str | None = None,
) FetchResponse[source][source]

Получить дерево категорий.

async products_list(
page: int = 1,
category_id: int | None = None,
city_id: str | None = None,
search: str | None = None,
) FetchResponse[source][source]

Получить список продуктов в категории.

class ProductService(parent: ParentT)[source][source]

Bases: ApiChild[ChizhikAPI]

Сервис для работы с товарами в каталоге.

async info(
product_id: int,
city_id: str | None = None,
) FetchResponse[source][source]

Получить информацию о товаре по его ID.

Parameters:
  • product_id (int) – ID товара.

  • city_id (str, optional) – ID города для локализации данных. Defaults to None.

Returns:

Ответ от сервера с информацией о товаре.

Return type:

Response