CLI client for the Aktivvo / Padam booking API
Project description
Aktivvo CLI
Kleines Python-CLI, das die Aktivvo-Website nicht per Browser steuert, sondern dieselben Padam-API-Calls wie das Frontend verwendet.
Wichtige Grenze
Die POST-Endpoints sind auf start.aktivvo.padam.io durch CrowdSec / reCAPTCHA geschützt. Das Tool umgeht diese Hürde nicht.
Praktisch heißt das:
- Im Browser die Aktivvo-Seite öffnen.
- Falls das CrowdSec / reCAPTCHA erscheint, dort freischalten.
- Falls Buchungen gemacht werden sollen, normal im Browser einloggen.
- Entweder aus den Browser-Devtools den vollständigen
Cookie-Header fürhttps://start.aktivvo.padam.iokopieren oderlogin-browser/import-cookiesnutzen. - Diesen Cookie-Header dem CLI übergeben.
Wenn der Cookie-Header authz_pdm=... enthält, zieht das CLI den Token automatisch daraus und setzt Authorization: Token .... Bei OpenID-Sessions nutzt es Bearer.
Stand 16. März 2026 ist für diese Deployment-URL kein belastbarer reiner CLI-Username/Password-Login nachweisbar: POST /api/v1.7/signin liefert auch mit mobilen Padam-Headern nur 500, und OpenID ist in der Web-Konfiguration leer. Der praktikable Login für die CLI ist daher ein browsergestützter Session-Import.
Installation
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
Mit pipx aus einem gebauten Wheel:
python3 -m pip install --user pipx
pipx install /pfad/zu/dist/aktivvo_cli-0.1.0-py3-none-any.whl
Sobald das Paket auf PyPI liegt, reicht:
pipx install aktivvo-cli
Basisnutzung
Cookie einmal in eine Umgebungsvariable legen:
export AKTIVVO_COOKIE_HEADER='crowdsec=...; authz_pdm=...'
Oder direkt aus Chrome importieren:
eval "$(aktivvo import-cookies --browser chrome --format env)"
Oder den Login direkt aus der CLI anstoßen, Browser öffnen lassen und auf die Session warten:
eval "$(aktivvo login-browser --browser chrome --format env)"
Falls schon eine gültige Session im gewählten Browser-Profil liegt, gibt login-browser sie sofort zurück. Für einen echten Neu-Login:
eval "$(aktivvo login-browser --browser chrome --wait-for-new-token --format env)"
Falls macOS den Keychain-Zugriff blockiert oder hängen bleibt, kann das Safe-Storage-Passwort auch explizit gesetzt werden:
AKTIVVO_SAFE_STORAGE_PASSWORD='...' aktivvo import-cookies --browser chrome --format env
Nodes für ein Gebiet anzeigen:
aktivvo search-nodes --territory holzwinkel --limit 20
Aktuellen Benutzer prüfen:
aktivvo current-customer
Storno-Gründe für ein Gebiet anzeigen:
aktivvo cancellation-reasons --territory holzwinkel
Suche auf Basis zweier Node-IDs:
aktivvo search \
--territory holzwinkel \
--from-id 1055 \
--to-id 1056 \
--datetime '2026-03-17T10:00:00+01:00'
Search-Response analysieren:
aktivvo inspect-search search-response.json
Direkt aus einer gespeicherten Search-Response buchen:
aktivvo book-from-search-response \
search-response.json \
--territory holzwinkel \
--payment-method onboard \
--customer-id 111 \
--indications 'Bitte an der Bushaltestelle warten'
Buchung finalisieren:
aktivvo book \
--territory holzwinkel \
--reservation-history-id 12345 \
--customer-proposition-id 67890 \
--payment-method onboard \
--customer-id 111 \
--indications 'Bitte an der Bushaltestelle warten'
Buchung stornieren:
aktivvo cancel-booking \
--territory holzwinkel \
--reservation-id 12345
Mit Storno-Grund und Kommentar:
aktivvo cancel-booking \
--territory holzwinkel \
--reservation-id 12345 \
--reason 'Ich habe meine Meinung geändert' \
--comment 'Termin hat sich erledigt'
Reverse-Engineerte Payloads
Die wichtigsten Payloads sind direkt aus dem Frontend-Bundle abgeleitet:
- Suche:
POST /api/v1.7/get-rides-multinode - Finale Buchung:
POST /api/v1.7/validate-booking - Storno:
POST /api/v1.7/cancel-reservation - Storno-Kommentar:
POST /api/v1.7/comment-cancelled-reservation - Storno-Gründe:
GET /api/v1.7/get-cancellation-reasons - Proposition-Validierung:
POST /api/searchrequests/{searchRequestId}/propositions/{propositionId}/validate/ - Aktueller Nutzer:
GET /api/customers/current/mitAccept: application/json; version=2.0 - Cookie-Import: lokales Chromium-Cookie-DB-Parsing auf macOS mit Keychain-Entschlüsselung
Die CLI ist absichtlich roh gehalten und gibt JSON aus, damit man Responses zuerst inspizieren und danach gezielt weitere Calls bauen kann.
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 aktivvo_cli-0.1.1.tar.gz.
File metadata
- Download URL: aktivvo_cli-0.1.1.tar.gz
- Upload date:
- Size: 14.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34be941a484baf1805d87400f1387d542bf93e8fe13734645e2ab0d6d900352d
|
|
| MD5 |
5dd2b56b8163f55b2128e861189c71d3
|
|
| BLAKE2b-256 |
daf8d23f3c3d8e56a6e36712efea0bd832ad0f89b979f72aefb413fff73d9a61
|
File details
Details for the file aktivvo_cli-0.1.1-py3-none-any.whl.
File metadata
- Download URL: aktivvo_cli-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94f36a8a8e14abce198e3794b7f38b49158e6d8bd807fc32a80ca430b4413a4c
|
|
| MD5 |
de752f98e70b03c25b309f3c22450940
|
|
| BLAKE2b-256 |
fe05e5d0c6804861b33b63257e907204c509b820cc70c1af96f96f4907372fbd
|