Python SDK
Installation
Section titled “Installation”pip install tracktilepoetry add tracktileuv add tracktileQuick Start
Section titled “Quick Start”from tracktile import Tracktile
client = Tracktile(jwt="your-api-token")
products = client.products.list()Authentication
Section titled “Authentication”client = Tracktile(jwt="your-api-token")Available Resources
Section titled “Available Resources”| Resource | Methods |
|---|---|
client.inventory | receive, move, update, waste, assign, unassign, bundle, merge, unmerge |
client.orders | list, create, get, update, delete, get_product_attributes |
client.products | list, create, get, update, delete, batch_update, fetch_by_ids |
client.purchase_orders | list, create, get, update, delete |
client.shipments | list, create, get, update, patch, delete, get_items |
client.suppliers | list, create, get, update, delete, get_default_order |
client.transports | list, create, get, update, delete |
Async Support
Section titled “Async Support”The SDK provides both synchronous and asynchronous clients:
import asynciofrom tracktile import AsyncTracktile
async def main(): client = AsyncTracktile(jwt="your-api-token") products = await client.products.list() print(products)
asyncio.run(main())Error Handling
Section titled “Error Handling”from tracktile.models import errors
try: product = client.products.get(id="invalid")except errors.BadRequestError: # Handle 400 errors passexcept errors.UnauthorizedError: # Handle 401 errors passexcept errors.ForbiddenError: # Handle 403 errors passexcept errors.NotFoundError: # Handle 404 errors passexcept errors.ServerError: # Handle 500 errors passRetries
Section titled “Retries”from tracktile import Tracktilefrom tracktile.utils import BackoffStrategy, RetryConfig
client = Tracktile( jwt="your-api-token", retry_config=RetryConfig( strategy="backoff", backoff=BackoffStrategy( initial_interval=1, max_interval=50, exponent=1.1, max_elapsed_time=100, ), retry_connection_errors=False, ),)Debug Logging
Section titled “Debug Logging”import logging
logging.basicConfig(level=logging.DEBUG)
client = Tracktile( jwt="your-api-token", debug_logger=logging.getLogger("tracktile"),)Runtime Support
Section titled “Runtime Support”| Runtime | Version |
|---|---|
| Python | 3.8+ |
Both sync and async clients are available. The SDK uses httpx under the hood for HTTP requests.