Skip to main content

Python SDK for Steadfast Courier API

Project description

Steadfast Courier Python SDK

Tests Publish 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 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.2.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.2.0-py3-none-any.whl (34.6 kB view details)

Uploaded Python 3

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

Hashes for steadfast_python-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b6ae887c5fe55be24defa1bb2a94a0d11a86f6b0b7dc0babb6550f7481f2e4ce
MD5 901a309fe0cef5538d84a7c8708accdb
BLAKE2b-256 258b542dc7b0e79d0c11f40b0a3ce9b3fe0c0ac205885c6b0254f1e20cc9ee53

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for steadfast_python-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6b4554c896a7595e20d94c466c3ed2dce50538f1b11f53037350affe01c4df0a
MD5 0d2a5032c7a8ae087f44180d8a7b5101
BLAKE2b-256 aeebc6d10515bda2db4a78beab7c6df369c16a5877dbdb9dcbc8465c11933903

See more details on using hashes here.

Provenance

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