Skip to main content

Production-grade Python SDK for the Tiny ERP API v2

Project description

tiny-py

Production-grade Python SDK for the Tiny ERP API v2. Fully typed, async-ready, and safe for FastAPI services and message queue workers.

PyPI version Python License: MIT


Features

  • Single entry point — all interaction through TinyClient or AsyncTinyClient
  • Typed contracts — every method accepts and returns Pydantic v2 models
  • Automatic rate limiting — token bucket per client instance, plan-aware (30 / 60 / 120 RPM)
  • Retry with exponential backoff — automatic on 429 / 5xx responses
  • Sync + AsyncTinyClient for workers, AsyncTinyClient for FastAPI
  • No global state — multiple tokens and plans can coexist in the same process

Installation

pip install tiny-py

Requires Python 3.11+.

Quick example

from tiny_py import TinyClient

client = TinyClient(token="your_token", plan="advanced")

# Stream all active products
for product in client.products.iter_search():
    print(product.sku, product.name, product.price)

# Fetch a single order
order = client.orders.get("970977594")
print(order.number, order.total)

Async (FastAPI)

from tiny_py import AsyncTinyClient

async with AsyncTinyClient(token="your_token", plan="advanced") as client:
    products = await client.products.search()
    order = await client.orders.get("970977594")

API coverage (v0.1.0)

Resource Methods
Products search, iter_search, get, get_stock, update_stock, update_price
Orders search, iter_search, get

See the roadmap for planned resources.

Error handling

from tiny_py.exceptions import TinyAPIError, TinyRateLimitError, TinyServerError, TinyTimeoutError

try:
    order = client.orders.get(order_id)
except TinyAPIError:
    # Business error — do not retry (send to DLQ)
    ...
except (TinyRateLimitError, TinyServerError, TinyTimeoutError):
    # Transient error — re-enqueue with backoff
    ...

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

tiny_erp_py-0.1.1.tar.gz (29.5 kB view details)

Uploaded Source

Built Distribution

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

tiny_erp_py-0.1.1-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file tiny_erp_py-0.1.1.tar.gz.

File metadata

  • Download URL: tiny_erp_py-0.1.1.tar.gz
  • Upload date:
  • Size: 29.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for tiny_erp_py-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0d05331378c3403ae4afd209c7ca73f63aaff39bbd0432cdfbb7f70350afb239
MD5 5830c2276139182696c835d3be86dcf6
BLAKE2b-256 859d1e095d5795d9ee6d9c4199ad9732dd342e3e996d712be40d6c2a0ad6422b

See more details on using hashes here.

File details

Details for the file tiny_erp_py-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tiny_erp_py-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for tiny_erp_py-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f13d8be4de8766adcd480384ce0decd377d7ec6c251ab48d54f39999e7f42999
MD5 1546e1d1166862a7432eaa0ec1c14256
BLAKE2b-256 c0b64165d6c1b90a0ecf46c4ba7f8feccd976de4378304ec5fdc0986b4698c83

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