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.0.tar.gz
(33.6 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.0.tar.gz.
File metadata
- Download URL: tiny_erp_py-0.1.0.tar.gz
- Upload date:
- Size: 33.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9270ced062c198c479448c6fea4ff4d92cf177b4a30b841a4466519c46c2d74c
|
|
| MD5 |
d53268bcc4087deb9b59cdfceed9e811
|
|
| BLAKE2b-256 |
e8ea9f63cab3eff33a4f5070e04f6df9ba77b79720d4522328c7340f139c646e
|
File details
Details for the file tiny_erp_py-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tiny_erp_py-0.1.0-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 |
284c4cb821e3a6914585b057431ef4cc45e96a06a5944806779c37acd2d3c700
|
|
| MD5 |
7adeab05f250a66ae4405b6f39abe099
|
|
| BLAKE2b-256 |
12d967d2b178bb267876717365d85e89d8586facd83205f4fa679cdf866fcfd3
|