Skip to main content

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

steadfast_python-0.1.0.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

steadfast_python-0.1.0-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

Details for the file steadfast_python-0.1.0.tar.gz.

File metadata

  • Download URL: steadfast_python-0.1.0.tar.gz
  • Upload date:
  • Size: 25.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for steadfast_python-0.1.0.tar.gz
Algorithm Hash digest
SHA256 880a538a7138228991a6183b8fae49ed1455d7553e741f1c2ca6e097f5060d67
MD5 0219d161e8a1abc45e0fd361d9756d75
BLAKE2b-256 005a392adb6e4fcd8b4424b1c2b4b27274cbb50be9ad92d9a852903e62d8a09d

See more details on using hashes here.

Provenance

The following attestation bundles were made for steadfast_python-0.1.0.tar.gz:

Publisher: publish.yml on mojnomiya/steadfast-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file steadfast_python-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for steadfast_python-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a86689bd7fcf3d1898f256709fe87dcf1fbe43d24174efee9090708f7f37a6c
MD5 571caae49dd6f922f295adcba558d261
BLAKE2b-256 e7a904a732a629451fd77e8f2608c1f43e4215684432454b81592526f3a36671

See more details on using hashes here.

Provenance

The following attestation bundles were made for steadfast_python-0.1.0-py3-none-any.whl:

Publisher: publish.yml on mojnomiya/steadfast-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page