Python SDK
Integrate Safaribid into your Python applications using our official library.
Python SDK
The official Safaribid Python library provides a clean, pythonic interface for our APIs. It supports Python 3.7+ and is fully asynchronous-compatible.
Installation
pip install safaribidInitialization
import safaribid
client = safaribid.Client(
api_key='sk_live_your_key',
environment='production'
)Usage
Request a Delivery Quote
quote = client.delivery.get_quote(
pickup_address='Westlands, Nairobi',
dropoff_address='Kilimani, Nairobi',
package_type='food'
)
print(f"Fee: {quote.delivery_fee} {quote.currency}")Async Usage
For high-performance applications (e.g., FastAPI, Sanic), use our async client:
from safaribid import AsyncClient
async with AsyncClient(api_key='sk_live_key') as client:
delivery = await client.deliveries.create( ... )Django Integration
We provide a specialized package for Django: django-safaribid. It includes models for tracking deliveries and a built-in webhook handler.