Skip to content

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.

License

Notifications You must be signed in to change notification settings

mojnomiya/pathao-python

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.

About

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.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages