Skip to main content

CLI and client library for Brobizz trips and account usage JSON.

Project description

Brobizz Usage

Command-line tool for showing Brobizz trips and account usage.

Quick Start

From this repository:

nix develop
uv sync --extra dev
uv run brobizz-usage auth login
uv run brobizz-usage trips

That is the normal flow. Login runs in headless Chromium and asks for:

  1. Brobizz/Auth0 email
  2. Password
  3. One-time-code channel: SMS|email, default SMS
  4. The received one-time code

After login, tokens are saved securely in your user config directory and reused automatically.

Install As A Tool

For regular use outside the development shell:

uv tool install .
uvx playwright install chromium
brobizz-usage auth login
brobizz-usage trips

Common Commands

Show recent trips as terminal cards:

brobizz-usage trips

Show trips as JSON:

brobizz-usage trips --json

Show account details:

brobizz-usage account

Log out:

brobizz-usage auth logout

Login Options

You can prefill login values to skip prompts:

brobizz-usage auth login --username you@example.com
brobizz-usage auth login --username you@example.com --password 'secret'
brobizz-usage auth login --username you@example.com --password 'secret' --otp-channel sms

For scripts, avoid putting the password in shell history:

printf '%s\n' 'secret' | brobizz-usage auth login --username you@example.com --password-stdin --otp-channel sms

auth login is headless by default, which is suitable for servers. To debug the browser flow visually:

brobizz-usage auth login --browser-login

Trip Options

brobizz-usage trips -n 10
brobizz-usage trips --full
brobizz-usage trips --search "Storebaelt"
brobizz-usage trips --include-payment-records
brobizz-usage trips --json

Options:

  • --number, -n: number of latest trip cards to show. Defaults to 5.
  • --full: show additional scalar fields on each visible card.
  • --search: filter transactions by search text.
  • --include-payment-records: include standalone payments, vouchers, and drafts.
  • --json: output raw trips and usage records as JSON.

Account Options

brobizz-usage account
brobizz-usage account --account-id ACCOUNT_ID

If --account-id is omitted, the CLI uses currentAccountId, then defaultAccountId, then the first usable accountIds value.

Cache

API responses are cached on disk for one hour by default.

brobizz-usage --no-cache trips
brobizz-usage --cache-ttl 300 trips
brobizz-usage --force-login trips

Options:

  • --no-cache: bypass cached API responses.
  • --cache-ttl: set cache lifetime in seconds.
  • --force-login: ignore saved tokens and log in again before the command.

Inspect the cache directory:

python -c 'from brobizz_usage import get_user_data_path; print(get_user_data_path("cache", ensure_exists=True))'

Python API

from brobizz_usage import BrobizzClient

client = BrobizzClient()
person = client.get_current_person()
account = client.get_account(person["currentAccountId"])
transactions = client.get_all_transactions(search_string="Storebaelt")

Development

Run tests:

uv run pytest

The tests mock token state, HTTP sessions, and CLI clients. They do not run live browser login or live Brobizz API calls.

Captured payloads are not required by the package. If you save samples locally, keep them under the app's XDG data directory:

python -c 'from brobizz_usage import get_user_data_path; print(get_user_data_path(ensure_exists=True))'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brobizz_usage-0.1.0.tar.gz (249.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brobizz_usage-0.1.0-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file brobizz_usage-0.1.0.tar.gz.

File metadata

  • Download URL: brobizz_usage-0.1.0.tar.gz
  • Upload date:
  • Size: 249.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"26.11","id":"zokor","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for brobizz_usage-0.1.0.tar.gz
Algorithm Hash digest
SHA256 05c24c8bf72c3e0b309728106b3aba1a7159fa0de5d82cbc285af01503d31796
MD5 3db4721ec0903ac2fc1a9aa44c23bdcf
BLAKE2b-256 3930ee70eb01b4cc05deb6d6201542c3853446d402d22824844f703c22565b22

See more details on using hashes here.

File details

Details for the file brobizz_usage-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: brobizz_usage-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"26.11","id":"zokor","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for brobizz_usage-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 31a3ae02b8d0d6efd6533b782cdbf786b541959a4e6ce2ec24df44f5dbd81d58
MD5 ae4e5426e644a569a84c8027e533bc2d
BLAKE2b-256 832e48ac5a8fdd43a00b9850675560543d9334ba6480cbf0e28844220b60b036

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page