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.
Features
- Single entry point — all interaction through
TinyClientorAsyncTinyClient - 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 + Async —
TinyClientfor workers,AsyncTinyClientfor 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
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d05331378c3403ae4afd209c7ca73f63aaff39bbd0432cdfbb7f70350afb239
|
|
| MD5 |
5830c2276139182696c835d3be86dcf6
|
|
| BLAKE2b-256 |
859d1e095d5795d9ee6d9c4199ad9732dd342e3e996d712be40d6c2a0ad6422b
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f13d8be4de8766adcd480384ce0decd377d7ec6c251ab48d54f39999e7f42999
|
|
| MD5 |
1546e1d1166862a7432eaa0ec1c14256
|
|
| BLAKE2b-256 |
c0b64165d6c1b90a0ecf46c4ba7f8feccd976de4378304ec5fdc0986b4698c83
|