A command-line interface tool to track DHL shipments with data from Odoo.
- Fetch shipment tracking data from DHL API
- Integrate with Odoo to get partner information and shipment history
- Track individual shipments by tracking number
- View recent shipments from Odoo
- Look up partner information
- Detailed tracking history with status updates
-
Clone this repository:
git clone https://github.com/AlanOgic/Cyan-DHL-Tracker.git cd Cyan-DHL-Tracker -
Create a virtual environment and install dependencies:
python -m venv .venvtrack source .venvtrack/bin/activate # On Windows: .venvtrack\Scripts\activate pip install -r requirements.txt -
Configure your environment:
cp .env.example .env -
Edit the
.envfile with your DHL API key and Odoo credentials:# DHL API credentials DHL_API_KEY=your_dhl_api_key # Odoo connection details ODOO_URL=https://your-odoo-instance.odoo.com ODOO_DB=your_odoo_database ODOO_USERNAME=your_odoo_username ODOO_PASSWORD=your_odoo_password
Run the ShipTracker CLI:
python shiptracker.py
- Track a shipment - Enter a tracking number to get detailed status
- View recent shipments - List recent shipments from Odoo with tracking numbers
- Get partner information - Search for partner data by ID or name
- Exit - Quit the application
For more information about the DHL Tracking API, refer to the documentation in the dhl-doc directory:
track.yaml- OpenAPI specification for the DHL Tracking APIGroup Shipment Tracking Request.postman_collection.json- Postman collection for testing
For continuous automated tracking, use the Docker setup:
-
Configure environment variables:
cp .env.example .env # Edit .env with your credentials including WEBHOOK_URL -
Run with Docker Compose:
docker-compose up -d
-
View logs:
docker-compose logs -f dhl-tracker
-
Stop the service:
docker-compose down
- Automated tracking every 30 minutes
- Automatic Odoo updates for delivery status
- Webhook notifications with shipment data
- Auto-restart on container failure
- Health checks for monitoring
The automated tracker will:
- Check all non-delivered DHL shipments in Odoo
- Update delivery status automatically
- Send webhook notifications with:
- List of shipments in transit
- Newly delivered shipments
- Summary statistics
- Python 3.6+
- Internet connection to access DHL API
- Valid DHL API key
- Access to an Odoo instance with shipping data