parcelgr
Ask a Greek courier where a parcel is, without knowing which courier it is.
Tracking numbers arrive in confirmation emails without a courier's name attached, and each courier has its own page, its own wording and its own idea of what counts as an event. This reads the number's shape, picks the right carrier, and gives back the parcel's history in the carrier's own words.
No browser, no API key, no account. One HTTP request per carrier, two for ACS.
import parcelgr
parcel = parcelgr.track("1234567890")
print(parcel.carrier) # acs
print(parcel.last.status) # Στο αρμόδιο κατάστημα παράδοσης
print(parcel.destination) # the branch holding it, when the carrier names one
A mixed list needs no sorting first.
for parcel in parcelgr.track_all(["JJD014600099900011122", "IHB9900011122", "1234567890"]):
if isinstance(parcel, parcelgr.TrackingError):
print("could not read:", parcel)
else:
print(parcel.carrier, parcel.last.at, parcel.last.status)
From a shell.
$ parcelgr 1234567890 JJD014600099900011122
For agents
The package ships a skill at src/parcelgr/skills/parcelgr/SKILL.md, so an assistant handed a
tracking number can find the courier, read the history and know what the statuses mean without
opening a browser. That is what it was built for: the couriers' own pages are single-page
applications behind consent banners, and driving a browser to read one costs far more than a
single HTTP request. The skill also records what the statuses mean in practice, which is the
part that decides whether someone should stay at home or go to a branch.
Install
pip install parcelgr
Python 3.9 or newer. No dependencies.
Until the first release reaches PyPI, install it from a checkout:
pip install git+https://github.com/drkostas/parcelgr
Carriers
| Carrier | Numbers look like | How it is read |
|---|---|---|
| Speedex | JJD0146 and 15 to 22 digits |
Its track-and-trace page renders the history server side, so the page is parsed. |
| Taxydema | IHB and 8 to 16 digits |
Its tracking page is a small Vue application calling an undocumented JSON endpoint, which is called directly. |
| ACS | exactly 10 digits | It has a JSON API that refuses an anonymous request with HTTP 406. The header it wants is published on its own tracking page, so the page is read first for that value. |
Adding a carrier is one module with four names, NAME, matches, parse and track, added
to the list in carriers/__init__.py. Keeping parse separate from track is what lets the
tests run on saved responses with no network.
Known gap, DHL Express
DHL Express is not supported. Its unauthenticated tracking endpoint does not answer a plain HTTP client, and its documented API returns 401 without a key, so there is nothing to read without credentials. A DHL parcel handed to a Greek courier for the last leg gets a new number from that courier, and that number works here.
A DHL Express waybill is ten digits, and so is an ACS tracking number, so detect() cannot
tell them apart and will answer acs for both. Nothing can do better from the number alone. Pass
a DHL number to track() and ACS is asked about it and says it has no such parcel, which surfaces
as ParcelNotFound rather than as a wrong answer. If you hold both numbers for one shipment, as
the forwarding email usually gives you, track the Greek one.
What you get back
track() returns a frozen Parcel.
| Field | Meaning |
|---|---|
number, carrier |
what was asked, and who answered |
events |
the history, oldest first, each one an Event with at, status and place |
last |
the newest event, or None |
delivered |
True, False, or None when the carrier does not say outright |
note |
a free-text remark the carrier attached |
destination, destination_phone |
the branch holding the parcel, when the carrier names one |
Wording is never translated or mapped onto a shared vocabulary. Carriers disagree about what their own states mean, and a parcel's fate often turns on the exact phrase, so you see what the carrier actually said.
Watchlists
There is no watchlist in the package. Numbers are your data, and where you keep them is your
business, so track_all() takes any iterable of strings. A few lines of your own code reading
a JSON file is all a watchlist needs to be.
Errors
Everything raised inherits from TrackingError.
| Error | When |
|---|---|
UnknownCarrier |
no carrier recognises the number's shape, or a name passed to carrier= is not one of ours |
ParcelNotFound |
a carrier answered and says it has no such parcel |
TrackingError |
a network failure, or an answer in a shape the reader does not know |
track_all() never raises. It yields a Parcel or the error for each number, in order, so one
unreachable carrier does not hide the others.
Notes from building the readers
Two things cost real time and are worth knowing before changing a reader.
Speedex puts the description before the timestamp. Inside each timeline card the wording comes first and the date second. A parser that splits the page on dates pairs every description with the previous event, which shifts the whole history by one. A parcel scanned back into its branch then reads as a failed delivery, and so does everything else. There is a test named after this.
ACS answers 406, not 404, when the header is missing. X-Encrypted-Key looks like a secret
and is not. The tracking page carries it as a publictoken attribute and its own front end
copies it into session storage. The value rotates, so the reader takes it fresh on every call
rather than storing it.
Tests
pip install -e ".[test]"
pytest
Every test runs on a saved response and none reaches the network, which one of the tests enforces. Every tracking number, address, telephone number and place name in the fixtures is invented.
Licence
MIT.
Metadata
Release files for parcelgr 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| parcelgr-0.1.0.tar.gz | 20.5 kB | With provenance | Details for parcelgr-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| parcelgr-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for parcelgr-0.1.0-py3-none-any.whl |
Total release size: 38.1 kB
Release files / parcelgr-0.1.0.tar.gz
| Download URL | parcelgr-0.1.0.tar.gz |
|---|---|
| Size | 20.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dfa6c210af219d28e1c3ecfd6ce9767768d06f18e52fc3c444b8cd8e74cad83e
|
|
BLAKE2b-256 checksum How to use checksums |
25628b3a2ee486a786e59e3cde8617c419196dcd5af19f0afcca19d7dbc4e789
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / parcelgr-0.1.0-py3-none-any.whl
| Download URL | parcelgr-0.1.0-py3-none-any.whl |
|---|---|
| Size | 17.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2e0e7470a0a7932ad2173372cada9dcf41e73bbe29dfd33c25d03d2cd5d1737c
|
|
BLAKE2b-256 checksum How to use checksums |
a49ee4fea48a92bdf30b5cc3f03487ab483f29cf442c7ad6ae546d3c730b38ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logSecurity for parcelgr 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for parcelgr-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.