Home

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 - Automatic token refresh
  • 🎯 Type Hints - Full type safety throughout
  • Input Validation - Comprehensive validation with detailed error messages
  • 🌍 Multi-Environment - Support for Sandbox and Production
  • πŸ“¦ Batch Operations - Efficient bulk operations
  • πŸ“š Extensive Documentation - Complete guides and examples
  • πŸ§ͺ 97% Test Coverage - Thoroughly tested codebase

πŸš€ Quick Start

Installation

pip install pathao

Basic Usage

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

Guide Description
Installation Installation and setup instructions
Authentication OAuth 2.0 authentication setup
Store Management Managing your stores
Order Management Creating and managing orders
Location Services Working with cities, zones, and areas
Price Calculation Calculating delivery prices
Error Handling Handling errors and exceptions
API Reference Complete API documentation

πŸ› οΈ Requirements

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

πŸ“Š Project Stats

  • 196 Tests with 97% Coverage
  • 15 Development Phases completed
  • 8 Comprehensive Guides + 3 Examples
  • Full Type Safety with mypy
  • Production Ready with CI/CD pipeline

🀝 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.