Skip to main content

A Python API client for Chizhik catalog

Project description

Chizhik API (not official)

Tests last run (ISO) Tests PyPI - Python Version PyPI - Package Version PyPI - Downloads License Discord Telegram

Chizhik (Чижик) - https://chizhik.club/

⭐ Star us on GitHub | 📚 Read the Docs | 🐛 Report Bug

Принцип работы

Библиотека полностью повторяет сетевую работу обычного пользователя на сайте.

Usage:

pip install chizhik_api
python -m camoufox fetch
from chizhik_api import ChizhikAPI

async def main():
    # RUS: Использование проксирования опционально. Вы можете создать несколько агентов с разными прокси для ускорения парса.
    # ENG: Proxy usage is optional. You can create multiple agents with different proxies for faster parsing.
    async with ChizhikAPI(proxy="user:password@host:port", headless=False) as API:
        # RUS: Выводит активные предложения магазина
        # ENG: Outputs active offers of the store
        print(f"Active offers output: {(await API.Advertising.active_inout()).json()!s:.100s}...\n")
        
        # RUS: Выводит список городов соответствующих поисковому запросу (только на русском языке)
        # ENG: Outputs a list of cities corresponding to the search query (only in Russian language)
        city_list = (await API.Geolocation.cities_list(search_name='ар', page=1)).json()
        print(f"Cities list output: {city_list!s:.100s}...\n")
        # Счет страниц с единицы / index starts from 1

        # RUS: Выводит список всех категорий на сайте
        # ENG: Outputs a list of all categories on the site
        catalog = (await API.Catalog.tree()).json()
        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)
        items = (await API.Catalog.products_list(category_id=catalog[0]['id'], page=1)).json()
        print(f"Items list output: {items!s:.100s}...\n")
        # Счет страниц с единицы / index starts from 1

        # RUS: Сохраняем изображение с сервера (в принципе, сервер отдал бы их и без обертки моего объекта, но лучше максимально претворяться обычным пользователем)
        # ENG: Saving an image from the server (in fact, the server gave them and without wrapping my object, but better to be as a regular user)
        image = await API.General.download_image(items['items'][0]['images'][0]['image'])
        with open(image.name, 'wb') as f:
            f.write(image.read())

import asyncio
asyncio.run(main())

Для более подробной информации смотрите референсы документации.


Report

If you have any problems using it / suggestions, do not hesitate to write to the project's GitHub!

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

chizhik_api-0.2.0.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chizhik_api-0.2.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file chizhik_api-0.2.0.tar.gz.

File metadata

  • Download URL: chizhik_api-0.2.0.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for chizhik_api-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9be9da71638fd571e2faa791fe00acf1d2a525b9222c4b89fff5986c1266b88b
MD5 303721a6695f0221c03e6b9b0f07a4fe
BLAKE2b-256 ac2a46303de947a0bbb7e22c57bf63389a9eaba89b4cbb2d774634cd2e8931af

See more details on using hashes here.

Provenance

The following attestation bundles were made for chizhik_api-0.2.0.tar.gz:

Publisher: publish.yml on Open-Inflation/chizhik_api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chizhik_api-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: chizhik_api-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for chizhik_api-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 540c1d7c6e8bc93eac2acdcd0600dfc96ecf746f273c82f1d37c6a6f62ec4971
MD5 71e43e2b0ec965f170bc996c9dec4aea
BLAKE2b-256 77098e40bce5d60133ca0f54634659b869bff73870ade8623004bbf243c178bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for chizhik_api-0.2.0-py3-none-any.whl:

Publisher: publish.yml on Open-Inflation/chizhik_api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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