Dolivroo Python SDK
Official Python SDK for the Dolivroo Delivery API.
Installation
pip install dolivroo
Quick Start
from dolivroo import Dolivroo
client = Dolivroo('your-api-key')
# Create a parcel
parcel = client.parcels.create('yalidine', {
'customer': {
'first_name': 'Mohamed',
'last_name': 'Ali',
'phone': '0555000000'
},
'destination': {
'wilaya': 'Alger',
'commune': 'Bab El Oued'
},
'package': {
'products': 'T-Shirt x2'
},
'payment': {
'amount': 2500
}
})
print(f"Tracking ID: {parcel['tracking_id']}")
API Reference
Parcels
# Create
client.parcels.create('yalidine', order_data)
# Get details
client.parcels.get('TRACKING123', 'yalidine')
# List all
client.parcels.list('yalidine', page=1, per_page=25)
# Update
client.parcels.update('TRACKING123', 'yalidine', updates)
# Cancel
client.parcels.cancel('TRACKING123', 'yalidine')
# Get label
client.parcels.get_label('TRACKING123', 'yalidine')
# Track
client.parcels.track('TRACKING123', 'yalidine')
Rates
# Get rates
client.rates.get('yalidine', 'Alger', 'Oran')
# Compare all providers
client.rates.compare('Alger', 'Oran')
Wilayas
# List all
client.wilayas.list()
# List for provider
client.wilayas.list('yalidine')
Bulk Operations
# Create multiple parcels
client.bulk.create_parcels('yalidine', [order1, order2, order3])
Error Handling
from dolivroo import Dolivroo, AuthenticationError, ValidationError, RateLimitError
try:
client.parcels.create('yalidine', order)
except AuthenticationError:
print('Invalid API key')
except ValidationError as e:
print(f'Validation errors: {e.errors}')
except RateLimitError as e:
print(f'Rate limited, retry after: {e.retry_after}')
Configuration
client = Dolivroo(
api_key='your-api-key',
base_url='https://custom-api.com/api/v1/unified', # Optional
timeout=60, # Optional, in seconds
verify_ssl=True # Optional
)
License
MIT
Metadata
Release files for dolivroo 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dolivroo-1.0.0.tar.gz | 5.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dolivroo-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.9 kB
Release files / dolivroo-1.0.0.tar.gz
| Download URL | dolivroo-1.0.0.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
90367d64e9ecd74206a349b24d3255c3b0f110d4318b4efc8a83a7e8042e3cb0
|
|
BLAKE2b-256 checksum How to use checksums |
0ae3cf55a1bdadb2bbea7398c23f05736557dccc2827342190eff3f4526ca3ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|
Release files / dolivroo-1.0.0-py3-none-any.whl
| Download URL | dolivroo-1.0.0-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9bcf6b92debb945f1c64f3740f4e6f42a840a93e27a459a9350b1470cc8f4845
|
|
BLAKE2b-256 checksum How to use checksums |
8cacd2972622aa5650c95f9a6ea7352138579120b55c541605b5d97929ff5c59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|