Steadfast Courier Python SDK
A Python SDK for the Steadfast Courier API that provides easy-to-use interfaces for order management, tracking, and other courier services.
Features
- Simple API Key/Secret Key authentication
- Order creation (single and bulk up to 500 items)
- Multiple tracking methods (by consignment ID, invoice, tracking code)
- Return request management
- Balance and payment tracking
- Police station lookup
- Type hints throughout
- Comprehensive error handling
Installation
pip install steadfast-python
Quick Start
from steadfast import SteadfastClient
# Initialize client
client = SteadfastClient(
api_key="your_api_key",
secret_key="your_secret_key"
)
# Create an order
order = client.orders.create(
invoice="ORD-2024-001",
recipient_name="John Smith",
recipient_phone="01234567890",
recipient_address="House 123, Dhaka",
cod_amount=1060,
delivery_type=0 # Home delivery
)
print(f"Order created: {order.consignment_id}")
Development
Setup
# Clone repository
git clone <repository-url>
cd steadfast-python
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install development dependencies
pip install -r requirements-dev.txt
# Install pre-commit hooks
pre-commit install
Code Quality
This project uses automated code quality checks with pre-commit hooks:
- Black: Code formatting
- Flake8: Linting
- MyPy: Type checking
- Pytest: Testing
Run quality checks manually:
# Run all checks
pre-commit run --all-files
# Or use the convenience script
./scripts/quality-check.sh
Testing
# Run tests
pytest tests/ -v
# Run with coverage
pytest tests/ --cov=steadfast --cov-report=html
Requirements
- Python 3.8+
- requests>=2.28.0
- python-dotenv>=0.21.0
License
MIT License
Metadata
Release files for steadfast-python 0.3.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 | Provenance | Actions |
|---|---|---|---|---|
| steadfast_python-0.3.0.tar.gz | 25.8 kB | With provenance | Details for steadfast_python-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| steadfast_python-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for steadfast_python-0.3.0-py3-none-any.whl |
Total release size: 60.3 kB
Release files / steadfast_python-0.3.0.tar.gz
| Download URL | steadfast_python-0.3.0.tar.gz |
|---|---|
| Size | 25.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
404bbe42190b04a34d760543bd577d2340975e806b61c8c5c2aa100d031db584
|
|
BLAKE2b-256 checksum How to use checksums |
7ea696c645e71963a867eb26f35eae52556d9b5d8853c3b85595e150b5a28eef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 28, 2026.
Transparency logRelease files / steadfast_python-0.3.0-py3-none-any.whl
| Download URL | steadfast_python-0.3.0-py3-none-any.whl |
|---|---|
| Size | 34.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
941defe530e26c77e7d74a856a7760caf6d6c9acc52e754cc4e47b86ffd9fbb3
|
|
BLAKE2b-256 checksum How to use checksums |
958817fc2d2c34b2e612e093c029e5cea7f14c29bd434f3923f9ab597aaf21e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 28, 2026.
Transparency logSecurity for steadfast-python 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for steadfast_python-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.