Yandex API wrapper for Python built on top of httpx and pydantic
Project description
yandex_py
Python-клиент для Yandex API на базе httpx и pydantic.
Сейчас библиотека организована по продуктам. Текущая реализация покрывает yandex_py.direct.
Установка
pip install yandex_py
Использование
from yandex_py.direct import HTTPRequestSender
from yandex_py.direct.reports import YDirectReport
from yandex_py.direct.reports.types import (
DateRangeType, FieldName, Page,
ReportDefinition, ReportRequest, ReportType, SelectionCriteria,
)
sender = HTTPRequestSender(token="your_token", client_login="your_login")
request = ReportRequest(
params=ReportDefinition(
selection_criteria=SelectionCriteria(),
field_names=[FieldName.Date, FieldName.Clicks, FieldName.Cost],
report_name="my-report",
report_type=ReportType.CUSTOM_REPORT,
date_range_type=DateRangeType.LAST_7_DAYS,
page=Page(limit=10000),
)
)
async with sender:
report = YDirectReport(request=request, sender=sender)
rows = await report.fetch()
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
yandex_py-0.0.4.tar.gz
(11.5 kB
view details)
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
yandex_py-0.0.4-py3-none-any.whl
(12.9 kB
view details)
File details
Details for the file yandex_py-0.0.4.tar.gz.
File metadata
- Download URL: yandex_py-0.0.4.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.1 {"installer":{"name":"uv","version":"0.10.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9acc3f012ca5490d96c835e942440d65ba94318f8b6476782e9b2c119a91c061
|
|
| MD5 |
5361b5d9bbdf205ba08ccb61a451500e
|
|
| BLAKE2b-256 |
17b3b4870fb60ca36a4f1206c836d6d771f907e791924525fdf74a403e854939
|
File details
Details for the file yandex_py-0.0.4-py3-none-any.whl.
File metadata
- Download URL: yandex_py-0.0.4-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.1 {"installer":{"name":"uv","version":"0.10.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c1436fd79f6a0888d1b8bd15648283d5934f7d3a6a17ebe361b7d605ec8e755
|
|
| MD5 |
83c2efadcad032e32c198df6447e0e85
|
|
| BLAKE2b-256 |
6c5fbe9517f6281af5814340b9d340c20ae3ff146bdfa302bac5d17d209ad38a
|