Skip to main content

Apache Airflow provider for Avito CPA — collect call statistics

Project description

airflow-provider-avito

Apache Airflow provider for Avito CPA — collect call statistics from the Avito advertising platform.


Powered by Claude Code


Installation

pip install airflow-provider-avito

Requires Python 3.10+ and apache-airflow>=2.9.1.

Connection

Create an Airflow connection of type HTTP with conn_id = avito_default (or any name you pass to the operator).

Only the Extra field is used. login and password are ignored.

Single account

{
  "client_id": "your_client_id",
  "client_secret": "your_client_secret"
}

Multiple accounts

{
  "accounts": [
    {"id": "main",    "client_id": "id1", "client_secret": "secret1"},
    {"id": "agency",  "client_id": "id2", "client_secret": "secret2"}
  ]
}

Use account_id parameter on the operator to select which account to use.

Quick start

from airflow.decorators import dag
from airflow.models.param import Param
from airflow_provider_avito.operators.calls import AvitoCallsOperator

@dag(schedule=None, params={"date_from": Param("2026-06-01"), "date_to": Param("2026-06-07")})
def avito_calls_example():
    AvitoCallsOperator(
        task_id="collect_calls",
        avito_conn_id="avito_default",
        date_from="{{ params.date_from }}",
        date_to="{{ params.date_to }}",
        base_dir="/tmp/avito",
        output_format="json",   # or "csv"
    )

avito_calls_example()

The operator writes one JSONL (or CSV) file per date to {base_dir}/{safe_run_id}/{date}.json and returns a list[dict] with {"date": "YYYY-MM-DD", "path": "..."} entries.

Output record schema

Each record contains 17 fields:

Field Type Description
id int Call ID
buyer_phone str Buyer phone
seller_phone str Seller phone
virtual_phone str Virtual (masked) phone
create_time str Creation time (RFC3339)
start_time str Call start time (RFC3339)
date str Date (YYYY-MM-DD) derived from start_time
duration int Call duration, seconds
waiting_duration float Wait time before answer, seconds
price int Price in kopecks
price_rub float Price in rubles (price / 100)
status_id int Status code
status str Status label (e.g. "Целевой")
item_id int Ad ID
group_title str Campaign name
is_arbitrage_available bool Whether arbitrage is available
record_url str Call recording URL

Examples

Full production examples with BigQuery + S3 upload are in examples/:

License

MIT

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

airflow_provider_avito-0.1.0.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

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

airflow_provider_avito-0.1.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file airflow_provider_avito-0.1.0.tar.gz.

File metadata

  • Download URL: airflow_provider_avito-0.1.0.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for airflow_provider_avito-0.1.0.tar.gz
Algorithm Hash digest
SHA256 acd8f6052008268ce112c44cd63033a3ce251cae8ff8e9473b3821a0f9f80ccb
MD5 a3e24e8f2392d83415efa87c970805f9
BLAKE2b-256 ccc98f56a98a1d3ab28ff201b737d497f14e856a6349ff98afb01bed67eb6434

See more details on using hashes here.

Provenance

The following attestation bundles were made for airflow_provider_avito-0.1.0.tar.gz:

Publisher: publish.yml on mkozhin/airflow-provider-avito

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

File details

Details for the file airflow_provider_avito-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for airflow_provider_avito-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1daa4b60964e47a05523983c231fd028a31d03f19d63f2ddfb45ee20f8375758
MD5 52ec1fc534dabe81bc8da9783fac289a
BLAKE2b-256 3cc945ce8a660a1cf988f8f58fa1c5c3e8de8bae6b5da748f20406493ca4094e

See more details on using hashes here.

Provenance

The following attestation bundles were made for airflow_provider_avito-0.1.0-py3-none-any.whl:

Publisher: publish.yml on mkozhin/airflow-provider-avito

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