Skip to main content

Unofficial Pathao API client for Python

Project description

GitHub Stars
PyPI Version

PathaoAPI - Unofficial Python Wrapper for Pathao Merchant API

pathao-api is a lightweight Python SDK that allows developers to interact with Pathao's Merchant API, providing utilities for:

✅ Authentication
✅ City / Zone / Area lookup
✅ Delivery charge estimation
✅ Store information retrieval ✅ Create Order

Installation

pip install pathao-api

Configuration

You can configure credentials via a .env file or pass them directly during initialization.

✅ Option 1: Using .env

PATHAO_BASE_URL=https://api.pathao.com
PATHAO_STORE_ID=12345
PATHAO_CLIENT_ID=your_client_id
PATHAO_CLIENT_SECRET=your_client_secret
PATHAO_USERNAME=merchant@you.com
PATHAO_PASSWORD=yourpassword

✅ Option 2: Initialize with Arguments

from pathao_api import PathaoAPI

client = PathaoAPI(
    base_url="https://api.pathao.com",
    store_id="12345",
    client_id="your_client_id",
    client_secret="your_client_secret",
    username="merchant@you.com",
    password="yourpassword"
)

Usage

from pathao_api import PathaoAPI

client = PathaoAPI()

Then you can call the methods using the client with necessery parameters.

Available Methods

cities = client.get_city_list()
zones = client.get_zone_list(city_id:int)
areas = client.get_area_list(zone_id:int)
charge = client.get_delivery_charge(city_id:int, zone_id:int)
stores = client.get_stores()
order = client.create_order(order_id: str, recipient_name: str, recipient_phone: str, recipient_address: str, item_quantity: int, amount_to_collect: int, delivery_type: int = 48, item_type: int = 2, special_instruction: str = "", item_weight: float = 0.5, item_description: str = '')

The return values are same as pathao's official docs

Contributing

Contributions are welcome! Submit an issue or PR.


License

MIT License.

⭐ If you find this package helpful, consider giving a star!

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_api-1.0.1.tar.gz (5.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_api-1.0.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file pathao_api-1.0.1.tar.gz.

File metadata

  • Download URL: pathao_api-1.0.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for pathao_api-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e406d256db1b8327f85cd120960f05f0f9f2a45915197ec78173236a612c20da
MD5 ac773482d7c2e411b160ff8e8ce553a1
BLAKE2b-256 5aefc862060a47c141d70981fb9cf50e1a3e5cae7c848363cda3fe857dee4c54

See more details on using hashes here.

File details

Details for the file pathao_api-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pathao_api-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for pathao_api-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 687eac282836dc00bda24f7c67a2cb26a4de06089963a1b41110c9fbd1e9ed0e
MD5 efbd0710770c6e1f871c1395f023bb6e
BLAKE2b-256 42a00a49a327ca4fdb2d87e053f645bde1673b0642b5a2e965bf4cc2da7f5908

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