diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6b981d2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2023 Kumi Mitterer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..d9edc00 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +# Trackbert + +A simple Python script for tracking shipments through [KeyDelivery](https://kd100.com). + +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. + +## 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 + +```bash +git clone https://kumig.it/kumitterer/trackbert.git +cd trackbert +python -m venv venv +source venv/bin/activate +pip install -r requirements.txt +``` + +Then copy `config.dist.ini` to `config.ini` and fill in your KeyDelivery API details, which you can find in your [KeyDelivery API management](https://app.kd100.com/api-management). You can find your API key in your KeyDelivery account settings. + +## Usage + +To add a new shipment, run `python trackbert.py --tracking-number --carrier `. Find the required carrier ID in the [KeyDelivery API management](https://app.kd100.com/api-management). + +To run the main loop, run `python trackbert.py`. This will check the status of all shipments every 5 minutes, and print the status to the console. If the status of a shipment changes, you will get a desktop notification. + +## License + +This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. diff --git a/config.dist.ini b/config.dist.ini new file mode 100644 index 0000000..bac223f --- /dev/null +++ b/config.dist.ini @@ -0,0 +1,3 @@ +[KeyDelivery] +key = api_key +secret = api_secret