Skip to main content

Python SDK for Steadfast Courier API

Project description

Steadfast Courier Python SDK

PyPI version Python versions License: MIT Documentation

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

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.3.0.tar.gz (25.8 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.3.0-py3-none-any.whl (34.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: steadfast_python-0.3.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

Hashes for steadfast_python-0.3.0.tar.gz
Algorithm Hash digest
SHA256 404bbe42190b04a34d760543bd577d2340975e806b61c8c5c2aa100d031db584
MD5 5bffd97a0209ae2e5b7320b32262ca0d
BLAKE2b-256 7ea696c645e71963a867eb26f35eae52556d9b5d8853c3b85595e150b5a28eef

See more details on using hashes here.

Provenance

The following attestation bundles were made for steadfast_python-0.3.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.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for steadfast_python-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 941defe530e26c77e7d74a856a7760caf6d6c9acc52e754cc4e47b86ffd9fbb3
MD5 adc7bf4460dfb30bab55ce5691b6c8b6
BLAKE2b-256 958817fc2d2c34b2e612e093c029e5cea7f14c29bd434f3923f9ab597aaf21e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for steadfast_python-0.3.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