Basic client for Parcelforce Expresslink API
Project description
ParcelForce ExpressLink API Client
A Python client for the ParcelForce ExpressLink API.
Uses Combadge to handle SOAP requests via Pydantic models.
Installation
pip install parcelforce-expresslink
Settings
Required:
- API Username
- API Password
- Account Number
- Contract Number
Optional:
- Endpoint (default: https://expresslink.parcelforce.net/ws)
- WSDL (default: bundled)
- Binding (default: {http://www.parcelforce.net/ws/ship/v14}ShipServiceSoapBinding)
- Tracking URL Stem (default: https://www.royalmail.com/track-your-item#/tracking-results/)
Get settings from EITHER:
Env File (direct)
ParcelforceSettings.from_env_file(path: str)
Env File (indirect)
ParcelforceSettings.from_env(env:str) (where env is the environment variable pointing to the env file)
Args
ParcelForceSettings.from_args(*, usrname: str, password: str, contract_num: str, account_num: str):
Usage
Create a client
settings = ParcelforceSettings()
client = ParcelforceClient(settings=settings)
Create a Recipient Contact
recip_contact = Contact(
contact_name="A Name",
email_address="anaddress@adomain.com",
mobile_phone="07123456789",
business_name="A Business Name",
)
Create a Recipient Address
recip_address = AddressRecipient(
address_line1="An AddressLine",
town="A Town",
postcode="AA1BB2",
)
Create a Shipment
shipment = Shipment(
recipient_address=recip_address,
recipient_contact=recip_contact,
total_number_of_parcels=1,
shipping_date=date.today(),
)
response: ShipmentResponse = client.request_shipment(shipment)
print(f"Shipment Number: {response.shipment_num}, Status: {response.status}")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file parcelforce_expresslink-0.1.9.tar.gz.
File metadata
- Download URL: parcelforce_expresslink-0.1.9.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a26ddcbbaa665a0f2ba5ec982d6b9cd386afd8b58c1355f9fa6288875f4bcc48
|
|
| MD5 |
9de700f7883e62ab03dfe06ea48c93eb
|
|
| BLAKE2b-256 |
e2c73224afcb4d39752142bf0ab953a8b6a22314291d46841598930984c8c711
|
File details
Details for the file parcelforce_expresslink-0.1.9-py3-none-any.whl.
File metadata
- Download URL: parcelforce_expresslink-0.1.9-py3-none-any.whl
- Upload date:
- Size: 25.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a1fca627c04a8896845566a8e0b20956304765ed20726f159bca61d5d86c136
|
|
| MD5 |
d6d06465cbf35bceeb35b2fac13534c5
|
|
| BLAKE2b-256 |
5f217c217952687774c7a6702703cb0d020d5de70c51239c6a3f5df9464d277b
|