Skip to main content

Yandex API wrapper for Python built on top of httpx and pydantic

Project description

yandex_py

Python-клиент для Yandex Direct API на базе httpx и pydantic.

Установка

pip install yandex_py

Использование

from yandex_py import HTTPRequestSender, YDirectReport
from yandex_py.reports.schemas 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.2.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

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

yandex_py-0.0.2-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file yandex_py-0.0.2.tar.gz.

File metadata

  • Download URL: yandex_py-0.0.2.tar.gz
  • Upload date:
  • Size: 9.1 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

Hashes for yandex_py-0.0.2.tar.gz
Algorithm Hash digest
SHA256 a50047b1a77b46e3be6b1cee64f738332dc49bbd0c500657910dbd1083545107
MD5 f5b4b519f9a81dbfe968742b8133e63f
BLAKE2b-256 29971cb4725699739848c36e71dc3693385cd0f4d3b287fb0cdff2a1b5e5a6c6

See more details on using hashes here.

File details

Details for the file yandex_py-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: yandex_py-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 10.7 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

Hashes for yandex_py-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2fe4852ee1e602e44cd7cde09b2044de7a06c4e6bf5df2a8aa2ce778a2dcfee8
MD5 4e96aed3afa36c15c1ae5868beb0956c
BLAKE2b-256 bd5d5be37cd40d0934ab476dd979c72fbca706df7d94b6c75ba084e2e9999892

See more details on using hashes here.

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