A client for the Allianz BonusDrive program
Project description
Allianz BonusDrive Client
API Client to query your BonusDrive data.
BonusDrive is a vehicle telematics application used by Allianz Germany to track driving behavior and routes. The code probably works similarily for every customer of IMS Driving Change (such as ADAC, Zurich, Aviva, etc., ), but you'll have to find that out for yourself.
The project is still in development.
Features
- Authentication: Log in with your credentials.
- Latest Trip Query: Retrieve information about your most recent trip.
- Badges: Get your recent badges, either daily or monthly
- Scores: Get more detailed scores per trip (overall and subscores)
- Trip details: All the info you can get about your latest trip, including scores, map geometry, distance, speed, ...
- Photon lookup: Specify the URL to a Photon database to get a lookup on your start and end address
- ... more soonTM, probably
Getting Started
You can use this either as a stand-alone cli client or as a library for use in other programs.
Library
Either get the latest from git:
pip install git+https://github.com/xathon/Allianz-Bonusdrive-Client.git
Or use PyPI:
pip install allianz-bonusdrive-client
As a library, you can just do:
from allianz_bonusdrive_client import BonusdriveAPIClient
base_url = "https://example.com" # Replace with the actual base URL
email = "user@example.com" # Replace with the user's email
password = "securepassword" # Replace with the user's password. Optional if TGT is provided.
tgt = None # Optional: Provide a TGT if available
# Create an instance of the client
client = BonusdriveAPIClient(base_url, email, password, tgt)
# Authenticate the client
client.authenticate()
# do whatever you want
CLI
From PyPI:
pip install allianz-bonusdrive-client[cli]
Then you can run the client:
$ python3 -m allianz_bonusdrive_client.cli -h
usage: Allianz BonusDrive Client [-h] [--geo-lookup] [--raw] [-v] {last-trip,badges-daily,badges-monthly,scores,details,trips}
On first start, the client should ask you for your BonusDrive email (use the one you tracked the trips with, that's not necessarily the same as the car owner's account!) and password. It then requests a TGT and stores it in .env, it will be used in the future. Alternatively, provide a TGT by setting the environment variable.
Disclaimers
- This project pretends to be the BonusDrive app, using HTTP headers. This a) may break at any point and b) is very much not intended behavior and might be against ToS, no idea. Try to keep your API requests low. I'm not responsible if anything happens to your account, insurance contract, Club Penguin membership, yada yada.
- I haven't yet found out how long a TGT is valid, or if it expires at any point. STs are invalidated after each use (successful or not), good job!
- LLMs have been involved in creating and debugging this program. I mostly know what I'm doing, so that should be fine? See above for my responsibilities.
- This program, unfortunately, is written in Python. The only reason for this is because I want to integrate it into Home Assistant/HACS at some point. Once this is complete. Probably. (Update: done!)
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file allianz_bonusdrive_client-0.5.6.tar.gz.
File metadata
- Download URL: allianz_bonusdrive_client-0.5.6.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bb21da48c93a21d8961c56a9f1357c89817b861f63130a4c115e0ba58ab52fd
|
|
| MD5 |
5a56e400974e1f294d0c5fd302d5a101
|
|
| BLAKE2b-256 |
6f0f3e48695fdaac5263c77ea2312652876d594002d94343098d52a1fdb45fbc
|
Provenance
The following attestation bundles were made for allianz_bonusdrive_client-0.5.6.tar.gz:
Publisher:
publish.yml on xathon/Allianz-BonusDrive-Client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
allianz_bonusdrive_client-0.5.6.tar.gz -
Subject digest:
9bb21da48c93a21d8961c56a9f1357c89817b861f63130a4c115e0ba58ab52fd - Sigstore transparency entry: 741768401
- Sigstore integration time:
-
Permalink:
xathon/Allianz-BonusDrive-Client@2ac30003b2c34c447eff2504273055b31fbc1a56 -
Branch / Tag:
refs/tags/v0.5.6 - Owner: https://github.com/xathon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2ac30003b2c34c447eff2504273055b31fbc1a56 -
Trigger Event:
push
-
Statement type:
File details
Details for the file allianz_bonusdrive_client-0.5.6-py3-none-any.whl.
File metadata
- Download URL: allianz_bonusdrive_client-0.5.6-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
667be7ad254fba6bb6723c409cc002f50312bb2cdce4d3e62442b37ca6d4f29f
|
|
| MD5 |
a4f8845f416a8866a0c28dce84f1bda8
|
|
| BLAKE2b-256 |
54ef7ef4d5f563307c2ad3270264b1fa1677367d2055f382b1d777856150dd00
|
Provenance
The following attestation bundles were made for allianz_bonusdrive_client-0.5.6-py3-none-any.whl:
Publisher:
publish.yml on xathon/Allianz-BonusDrive-Client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
allianz_bonusdrive_client-0.5.6-py3-none-any.whl -
Subject digest:
667be7ad254fba6bb6723c409cc002f50312bb2cdce4d3e62442b37ca6d4f29f - Sigstore transparency entry: 741768414
- Sigstore integration time:
-
Permalink:
xathon/Allianz-BonusDrive-Client@2ac30003b2c34c447eff2504273055b31fbc1a56 -
Branch / Tag:
refs/tags/v0.5.6 - Owner: https://github.com/xathon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2ac30003b2c34c447eff2504273055b31fbc1a56 -
Trigger Event:
push
-
Statement type: