Skip to main content

Trackbert

A simple Python script for tracking shipments, primarily through KeyDelivery.

If your system provides notify-send, you will get a desktop notification when the status of your shipment changes.

Status information is stored in a SQLite database.

Currently supported tracking providers

More tracking providers can be added easily by subclassing trackbert.trackers.base.BaseTracker. This should be relatively self-explanatory if you look at the existing implementations. Pull requests are welcome!

Requirements

The script was developed and tested on Arch Linux using Python 3.11. The "Never" type hint is used, so I suppose it will not work on older Python versions. It should work on any Linux distribution. You can technically run it on Windows and macOS as well, but you will not get desktop notifications.

In order to get desktop notifications, you need to have notify-send installed. On Arch Linux, this is provided by the libnotify package. If your desktop environment does not provide a notification server, you have to install one yourself. How to do this is beyond the scope of this README.

Installation

First, create a virtual environment and install the package:

python -m venv venv
source venv/bin/activate
pip install trackbert

Then create a config.ini in your working directory (see config.dist.ini) and fill in your KeyDelivery API details, which you can find in your KeyDelivery API management. You can find your API key in your KeyDelivery account settings.

You can also omit this step, but then you will only be able to track shipments from Austrian Post and GLS.

Usage

First, assure that the virtual environment is activated:

source venv/bin/activate

If you need to create a new config file, run trackbert -g. You need this if you want to provide API keys required for KeyDelivery or some of the other tracking providers.

To add a new shipment, run trackbert --tracking-number <tracking-number> --carrier <carrier-id>. Find the required carrier ID in the KeyDelivery API management.

To run the main loop, run trackbert. This will check the status of all shipments every minute, and print the status to the console. If the status of a shipment changes, you will get a desktop notification.

Caveats

DHL

By default, the script queries for updates for each active shipment once per minute. However, if you have the DHL API enabled, you will quickly run into the rate limit. Therefore, the script will only query for updates once per hour (if minute == 0). For the default 250 requests per day limit, this means that you can only track up to 10 shipments simultaneously.

You may request a higher rate limit from DHL. See the DHL Developer Portal for details. If you do this, you can set ratelimited = 0 (note that 0/1 is a boolean value in the config file) in your config.ini to disable the rate limit.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Metadata

Release files for trackbert 0.2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trackbert 0.2.6
File Size Uploaded
trackbert-0.2.6.tar.gz 16.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for trackbert 0.2.6
File Interpreter ABI Platform
trackbert-0.2.6-py3-none-any.whl Python 3 none any Details

Total release size: 40.3 kB

Release files / trackbert-0.2.6.tar.gz

Download URL trackbert-0.2.6.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0f598922074b9bba50cc639dfa475595463643499913adf015357a023a4fa0bb
BLAKE2b-256 checksum
How to use checksums
3cfe10bbcf8445d5af7dcdbee020f76f146589e51ae1e9b14525472fff9eb5d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / trackbert-0.2.6-py3-none-any.whl

Download URL trackbert-0.2.6-py3-none-any.whl
Size 23.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
552fd6ad205c6f0075ca4141ef9babc96b4452798c39285de6c0f33dddc6f55d
BLAKE2b-256 checksum
How to use checksums
2381bee4d753d49efeff165dc97da22b631e6c682e5614cf065e56e3631bb19c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release history Release notifications | RSS feed

This release

0.2.6 This release

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page