A Python API client for Pyaterochka store catalog
Project description
Pyaterochka API (not official / не официальный)
Pyaterochka (Пятёрочка) - https://5ka.ru/
Usage / Использование:
import pyaterochka_api
import asyncio
async def main():
# RUS: Выводит список всех категорий на сайте
# ENG: Outputs a list of all categories on the site
catalog = await pyaterochka_api.categories_list(subcategories=True)
print(f"Categories list output: {catalog!s:.100s}...\n")
# RUS: Выводит список всех товаров выбранной категории (ограничение 100 элементов, если превышает - запрашивайте через дополнительные страницы)
# ENG: Outputs a list of all items in the selected category (limiting to 100 elements, if exceeds - request through additional pages)
# Страниц не сущетвует, использовать желаемый лимит (до 499) / Pages do not exist, use the desired limit (up to 499)
print(f"Items list output: {await pyaterochka_api.products_list(catalog[0]['id'], limit=5)!s:.100s}...\n")
# RUS: Выводит основной конфиг сайта (очень долгая функция, рекомендую сохранять в файл и переиспользовать)
# ENG: Outputs the main config of the site (large function, recommend to save in a file and re-use it)
# RUS: Если требуется, можно настроить вывод логов в консоль
# ENG: If required, you can configure the output of logs in the console
print(f"Main config: {await pyaterochka_api.get_config(debug=True)!s:.100s}...\n")
if __name__ == '__main__':
asyncio.run(main())
Report / Обратная связь
If you have any problems using it /suggestions, do not hesitate to write to the project's GitHub!
Если у вас возникнут проблемы в использовании / пожелания, не стесняйтесь писать на GitHub проекта!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyaterochka_api-0.1.2.tar.gz
(5.6 kB
view details)
File details
Details for the file pyaterochka_api-0.1.2.tar.gz.
File metadata
- Download URL: pyaterochka_api-0.1.2.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdf53db50c76945187a7b11a502eb13b7d3c95e06e1d49efa15dbe26681f17d2
|
|
| MD5 |
b771f6653b0fe854d0b6f8cb8d0617fb
|
|
| BLAKE2b-256 |
9618456ab1087358f648cc5a0cef779533086525879d917925ef7ae9f738d215
|