Skip to main content

No project description provided

Project description

🍕 Dodo IS API Wrapper

Test badge python


Installation

Via pip:

pip install dodo-is-api

Via poetry:

poetry add dodo-is-api

📝 Changelog is here.


🧪 Usage:

🌩️ Synchronous version:

from datetime import datetime
from uuid import UUID

import httpx

from dodo_is_api import models
from dodo_is_api.connection.synchronous import DodoISAPIConnection


def main():
    access_token = 'your access token'
    country_code = models.CountryCode.RU

    from_date = datetime(2004, 10, 7)
    to_date = datetime(2004, 10, 7, 23)
    units = [UUID('ec81831c-b8a7-4ba8-a6aa-7ae7d0c4e0bb')]

    with httpx.Client() as http_client:
        connection = DodoISAPIConnection(
            http_client=http_client,
            access_token=access_token,
            country_code=country_code,
        )

        stop_sales = connection.get_stop_sales_by_products(
            from_date=from_date,
            to_date=to_date,
            units=units,
        )

    print(stop_sales)


if __name__ == '__main__':
    main()

⚡️ Asynchronous version:

import asyncio
from datetime import datetime
from uuid import UUID

import httpx

from dodo_is_api import models
from dodo_is_api.connection.asynchronous import AsyncDodoISAPIConnection


async def main():
    access_token = 'your access token'
    country_code = models.CountryCode.RU

    from_date = datetime(2004, 10, 7)
    to_date = datetime(2004, 10, 7, 23)
    units = [UUID('ec81831c-b8a7-4ba8-a6aa-7ae7d0c4e0bb')]

    with httpx.AsyncClient() as http_client:
        connection = AsyncDodoISAPIConnection(
            http_client=http_client,
            access_token=access_token,
            country_code=country_code,
        )

        stop_sales = await connection.get_stop_sales_by_products(
            from_date=from_date,
            to_date=to_date,
            units=units,
        )

    print(stop_sales)


if __name__ == '__main__':
    asyncio.run(main())

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

dodo_is_api-0.7.1.tar.gz (9.7 kB view hashes)

Uploaded Source

Built Distribution

dodo_is_api-0.7.1-py3-none-any.whl (15.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page