Skip to main content

Lightweight MoySklad API client built on httpx with retries

Project description

moysklad-api-client

Лёгкий асинхронный клиент для работы с MoySklad API на базе httpx. При ответе 429,503 происходит ретрай с exponential backoff.

Установка

pip

pip install moysklad-api-client

poetry

poetry add moysklad-api-client

Пример

Работа через контекстный менеджер

import asyncio
from moysklad_api_client import APIClient, Entity

async def main():
    async with APIClient() as client:
        response = await client.get(Entity.PRODUCT, api_key="your_token")
        print(response.status_code, response.json())

asyncio.run(main())

Работа через экземпляр класса

async def main():
    client = APIClient()
    response = await client.get(
        entity_name='customerorder',
        api_key='api_key',
        params={'limit': 1, 'offset': 100}

    )
    return response.json() 

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

moysklad_api_client-0.1.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

moysklad_api_client-0.1.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: moysklad_api_client-0.1.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.3 Linux/6.14.0-28-generic

File hashes

Hashes for moysklad_api_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b20ae46c15678c7d6b6f61b6b78969df4b41bd5a645d3946d7ff6021f055cc6d
MD5 aaace85a0cc6ccfc2997f7f176128bf9
BLAKE2b-256 c2b4b3f4faad4e53e7cacf815b84aebe385c5936bd78b40c02f6cc83ddb08880

See more details on using hashes here.

File details

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

File metadata

  • Download URL: moysklad_api_client-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.3 Linux/6.14.0-28-generic

File hashes

Hashes for moysklad_api_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 df1f02dfdc208b247bf7ae41fe9cfda5b5ae4fa28c60e4ba3120706a7b5b1c9f
MD5 72d040ca6604b09bf9cfb5397f3b2fb9
BLAKE2b-256 32aa826f7f1a12165d3c80b1bacd738458617c9ff13e0018e73a44f9b6ffa5ab

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