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 details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

Details for the file dodo_is_api-0.7.1.tar.gz.

File metadata

  • Download URL: dodo_is_api-0.7.1.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.7 Darwin/22.5.0

File hashes

Hashes for dodo_is_api-0.7.1.tar.gz
Algorithm Hash digest
SHA256 46d9022e513770341998bbbc4cb356d3f7dc9ed7b2a97c4899e5809893f2224a
MD5 43837179a6b830663c7385f1633c2c4a
BLAKE2b-256 394c62e886a7b491fe7f439b0c05177266d6d85c0d29715c2beab943dbb28367

See more details on using hashes here.

File details

Details for the file dodo_is_api-0.7.1-py3-none-any.whl.

File metadata

  • Download URL: dodo_is_api-0.7.1-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.7 Darwin/22.5.0

File hashes

Hashes for dodo_is_api-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 084ea99e2a396878dfb27d101a8951cf050f538b8da73f90a48044cc58ae5b0d
MD5 21bb9c6c6de76e827b32c68cb99908d3
BLAKE2b-256 0a68199e84b60a554a7a42ccc4a46f3de82f2a6f4ef92fc5423324308d0c6f66

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