Python SDK for Steadfast Courier API
Project description
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 SteadastClient
# Initialize client
client = SteadastClient(
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
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
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 steadfast_python-0.2.0.tar.gz.
File metadata
- Download URL: steadfast_python-0.2.0.tar.gz
- Upload date:
- Size: 25.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6ae887c5fe55be24defa1bb2a94a0d11a86f6b0b7dc0babb6550f7481f2e4ce
|
|
| MD5 |
901a309fe0cef5538d84a7c8708accdb
|
|
| BLAKE2b-256 |
258b542dc7b0e79d0c11f40b0a3ce9b3fe0c0ac205885c6b0254f1e20cc9ee53
|
Provenance
The following attestation bundles were made for steadfast_python-0.2.0.tar.gz:
Publisher:
publish.yml on mojnomiya/steadfast-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
steadfast_python-0.2.0.tar.gz -
Subject digest:
b6ae887c5fe55be24defa1bb2a94a0d11a86f6b0b7dc0babb6550f7481f2e4ce - Sigstore transparency entry: 868116622
- Sigstore integration time:
-
Permalink:
mojnomiya/steadfast-python@6187a5ab00d62b75b090088cba404473d7dcde71 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/mojnomiya
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6187a5ab00d62b75b090088cba404473d7dcde71 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file steadfast_python-0.2.0-py3-none-any.whl.
File metadata
- Download URL: steadfast_python-0.2.0-py3-none-any.whl
- Upload date:
- Size: 34.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b4554c896a7595e20d94c466c3ed2dce50538f1b11f53037350affe01c4df0a
|
|
| MD5 |
0d2a5032c7a8ae087f44180d8a7b5101
|
|
| BLAKE2b-256 |
aeebc6d10515bda2db4a78beab7c6df369c16a5877dbdb9dcbc8465c11933903
|
Provenance
The following attestation bundles were made for steadfast_python-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on mojnomiya/steadfast-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
steadfast_python-0.2.0-py3-none-any.whl -
Subject digest:
6b4554c896a7595e20d94c466c3ed2dce50538f1b11f53037350affe01c4df0a - Sigstore transparency entry: 868116655
- Sigstore integration time:
-
Permalink:
mojnomiya/steadfast-python@6187a5ab00d62b75b090088cba404473d7dcde71 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/mojnomiya
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6187a5ab00d62b75b090088cba404473d7dcde71 -
Trigger Event:
workflow_dispatch
-
Statement type: