-
Notifications
You must be signed in to change notification settings - Fork 0
Installation Guide
- Python 3.10 or newer
- An account at a canteen that uses Strava.cz, and its canteen number
The only runtime dependency is httpx, which pip installs for you.
pip install strava-czThat gives you the library and the strava-cz command. The command works on its own,
but to have it remember passwords — in the operating system's credential store, or
encrypted in the profile file on a machine that has no such store — add the cli extra:
pip install "strava-cz[cli]"Without it, a stored profile reads its password from $STRAVA_CZ_PASSWORD or asks for
it each time — see Profiles.
Inside a virtual environment, which is what you usually want:
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install strava-czgit clone https://github.com/jsem-nerad/strava-cz-python.git
cd strava-cz-python
pip install -e ".[dev]"The dev extra adds pytest, respx, ruff and mypy. See
Contributing for the workflow.
import strava_cz
print(strava_cz.__version__)strava-cz --version
python -m strava_cz --version # same thing, if the script directory is not on PATHThe canteen number is the numeric id of your canteen in the Strava.cz system, and it is required — the library will not guess it.
- Open app.strava.cz and go to the login page.
- Search for your canteen by name.
- The number is shown next to the canteen, and appears in the URL when you select it.
It is the same value the web app sends as cislo.
The package ships a py.typed marker, so mypy and Pyright pick up its annotations with
no extra configuration:
from strava_cz import Meal
def cheapest(meals: list[Meal]) -> Meal:
return min(meals, key=lambda meal: meal.price)