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}")
Metadata
Release files for parcelforce-expresslink 0.1.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| parcelforce_expresslink-0.1.12.tar.gz | 17.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| parcelforce_expresslink-0.1.12-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.7 kB
Release files / parcelforce_expresslink-0.1.12.tar.gz
| Download URL | parcelforce_expresslink-0.1.12.tar.gz |
|---|---|
| Size | 17.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f04afd0d7db897563d28f5b8511d9515d9718f25e06a4dea1673459ac9200456
|
|
BLAKE2b-256 checksum How to use checksums |
514553d402f5b6d5cdf0b41b9018740028be6821faa976f3a4942244f35c30f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.22
|
Release files / parcelforce_expresslink-0.1.12-py3-none-any.whl
| Download URL | parcelforce_expresslink-0.1.12-py3-none-any.whl |
|---|---|
| Size | 24.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8dc9388e0c82d0681955c4561e0eab4254bd97ae21957b6d4ebb72d445076e2a
|
|
BLAKE2b-256 checksum How to use checksums |
8ee2f4cdcd9d21ff6e3cb7d13f453976691e1e433e91b66d7c1463751a9dd034
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.22
|