Skip to content

python-sendparcel/python-sendparcel-inpost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-sendparcel-inpost

InPost ShipX provider package for the python-sendparcel ecosystem.

Alpha notice: this package tracks the still-changing python-sendparcel core.

What it provides

  • InPostLockerProvider for locker shipments
  • InPostCourierProvider for courier shipments
  • ShipXClient for direct async ShipX API access
  • ShipX-to-sendparcel status normalization helpers

Contract

This package follows the cleaned core contract:

  • create_shipment(...) -> ShipmentCreateResult
  • create_label(...) -> LabelInfo
  • handle_callback(...) -> ShipmentUpdateResult
  • fetch_shipment_status(...) -> ShipmentUpdateResult
  • cancel_shipment(...) -> bool

Providers do not mutate shipment state directly. They translate ShipX responses into normalized results that the core flow applies.

Installation

uv add python-sendparcel-inpost

or:

pip install python-sendparcel-inpost

Configuration

Key Type Description
token str ShipX API bearer token
organization_id int ShipX organization ID
sandbox bool Use sandbox API
base_url str Optional API base override
timeout float Request timeout in seconds

Status normalization

ShipX statuses are normalized to sendparcel shipment statuses.

  • recognized ShipX statuses produce {"status": ...}
  • tracking numbers are included when available
  • unknown ShipX statuses do not invent fake sendparcel statuses

That means callback and polling updates can safely return only tracking data when ShipX introduces a new status the mapper does not know yet.

Labels

Labels are returned as payloads.

  • PDF labels are returned as base64 content in LabelInfo["content_base64"]
  • no label URL is persisted by the core contract

Development

uv sync --extra dev
uv run pytest
uv run ruff check src tests
uv run mypy src tests

About

InPost ShipX provider for python-sendparcel.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages