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.1.tar.gz (10.5 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.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: chizhik_api-0.2.1.tar.gz
  • Upload date:
  • Size: 10.5 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.1.tar.gz
Algorithm Hash digest
SHA256 738452dfd997b3b4668c8a0f8ee567001c61a7758fcad4b0920b160de74716a0
MD5 f8e10be2700cdf81598e22c6e1ed09a7
BLAKE2b-256 6ffa28aa19514bc6b404f416d13a2b3c314aa9b16c5d5d9e7a342dd576ff4939

See more details on using hashes here.

Provenance

The following attestation bundles were made for chizhik_api-0.2.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: chizhik_api-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 10.4 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0e79e10c85226e13b789f1da80f3eca46aa81acceada5f493ca362ce51da9e13
MD5 362c2b4024439db713a798d8e5b0c3d7
BLAKE2b-256 45ea4031fe1fae1ab3f7f3f7bafcad95607154e5ea83b9b128fbbdc75781d507

See more details on using hashes here.

Provenance

The following attestation bundles were made for chizhik_api-0.2.1-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