Skip to main content

Pathao Python SDK

Tests Code Quality PyPI version Python versions License: MIT Documentation

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/mojnomiya/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.

Metadata

Release files for pathao 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pathao 0.2.0
File Size Uploaded
pathao-0.2.0.tar.gz 33.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pathao 0.2.0
File Interpreter ABI Platform
pathao-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 53.0 kB

Release files / pathao-0.2.0.tar.gz

Download URL pathao-0.2.0.tar.gz
Size 33.8 kB
Tags Source
SHA-256 checksum
How to use checksums
dab765c26ab7c38d7b765c2f4fa8e5adbc75e5c42ca0f58ffbcf0a69304281de
BLAKE2b-256 checksum
How to use checksums
d58b50415897f5c837a2a766740eb71f7e1c5f483c535bd9640e6b46594a10c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pathao-0.2.0-py3-none-any.whl

Download URL pathao-0.2.0-py3-none-any.whl
Size 19.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c38249dd51a58d6e287ac0d2787edf9e70d1017c7c982f0360d01f86ca1e5c0e
BLAKE2b-256 checksum
How to use checksums
b03732a54ba97f91b9e07e5ccc9ade9d8a3ed7f420168489da752111793ba61d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page