A Python API client for Chizhik catalog
Project description
Chizhik API (not official)
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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9be9da71638fd571e2faa791fe00acf1d2a525b9222c4b89fff5986c1266b88b
|
|
| MD5 |
303721a6695f0221c03e6b9b0f07a4fe
|
|
| BLAKE2b-256 |
ac2a46303de947a0bbb7e22c57bf63389a9eaba89b4cbb2d774634cd2e8931af
|
Provenance
The following attestation bundles were made for chizhik_api-0.2.0.tar.gz:
Publisher:
publish.yml on Open-Inflation/chizhik_api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chizhik_api-0.2.0.tar.gz -
Subject digest:
9be9da71638fd571e2faa791fe00acf1d2a525b9222c4b89fff5986c1266b88b - Sigstore transparency entry: 692780180
- Sigstore integration time:
-
Permalink:
Open-Inflation/chizhik_api@a9dbb34527cb6a50164d7a153a6ce4d24100b079 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Open-Inflation
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a9dbb34527cb6a50164d7a153a6ce4d24100b079 -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
540c1d7c6e8bc93eac2acdcd0600dfc96ecf746f273c82f1d37c6a6f62ec4971
|
|
| MD5 |
71e43e2b0ec965f170bc996c9dec4aea
|
|
| BLAKE2b-256 |
77098e40bce5d60133ca0f54634659b869bff73870ade8623004bbf243c178bf
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chizhik_api-0.2.0-py3-none-any.whl -
Subject digest:
540c1d7c6e8bc93eac2acdcd0600dfc96ecf746f273c82f1d37c6a6f62ec4971 - Sigstore transparency entry: 692780182
- Sigstore integration time:
-
Permalink:
Open-Inflation/chizhik_api@a9dbb34527cb6a50164d7a153a6ce4d24100b079 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Open-Inflation
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a9dbb34527cb6a50164d7a153a6ce4d24100b079 -
Trigger Event:
workflow_dispatch
-
Statement type: