Skip to main content

Python SDK for Pathao Courier Merchant API

Project description

Pathao Python SDK

Tests PyPI version Python versions License: MIT

A comprehensive Python SDK for the Pathao Courier Merchant API. This package provides a clean, Pythonic interface to integrate Pathao's courier services into your Python applications.

Features

  • ✅ OAuth 2.0 authentication with automatic token refresh
  • ✅ Type hints throughout the codebase
  • ✅ Comprehensive input validation
  • ✅ Detailed error messages
  • ✅ Support for both Sandbox and Production environments
  • ✅ Batch operations support
  • ✅ Extensive documentation and examples

Installation

pip install pathao

Quick Start

from pathao import PathaoClient

# Initialize the client
client = PathaoClient(
    client_id="your_client_id",
    client_secret="your_client_secret",
    username="your_email",
    password="your_password",
    environment="sandbox"  # Use "production" for live
)

# Create an order
order = client.orders.create(
    store_id=1,
    recipient_name="John Doe",
    recipient_phone="01712345678",
    recipient_address="House 123, Road 4, Dhaka",
    delivery_type=48,  # Normal delivery
    item_type=2,  # Parcel
    item_quantity=1,
    item_weight=0.5,
    amount_to_collect=0
)

print(f"Order created: {order.consignment_id}")

Documentation

Requirements

  • Python 3.8 or higher
  • requests>=2.28.0
  • python-dotenv>=0.21.0

Development

# Clone the repository
git clone https://github.com/yourusername/pathao-python.git
cd pathao-python

# Install development dependencies
pip install -r requirements-dev.txt

# Run tests
pytest

# Format code
black pathao tests

# Type checking
mypy pathao

Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Changelog

See CHANGELOG.md for a list of changes and releases.

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

pathao-0.1.2.tar.gz (33.3 kB view details)

Uploaded Source

Built Distribution

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

pathao-0.1.2-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file pathao-0.1.2.tar.gz.

File metadata

  • Download URL: pathao-0.1.2.tar.gz
  • Upload date:
  • Size: 33.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pathao-0.1.2.tar.gz
Algorithm Hash digest
SHA256 88404329ec03248430e040f340295b9ddb4819201931c4ca566cc3912fed332b
MD5 e669d881cb7430d59e5388262a51ad5f
BLAKE2b-256 040db53ab73d0ed513ad56a4042c435ae11017c253ae412f699d149653d97e89

See more details on using hashes here.

File details

Details for the file pathao-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pathao-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pathao-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f2f0d6c02ca48682694e9236b5da2c7e3618749bbcbe15e5c42f01a9d2680945
MD5 f49ba4c2c943cabcdae7e68697340707
BLAKE2b-256 235dddb2c77f50e9256f17f0969880502038f2b3c8e0f86d2738bbb71917a541

See more details on using hashes here.

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