Skip to content

Installation Guide

jsem-nerad edited this page Nov 12, 2025 · 1 revision

Installation Guide

This guide will help you install and set up the strava-cz-python library.

Requirements

  • Python: 3.9 or higher
  • Dependencies:
    • requests >= 2.25.0

Installation Methods

1. Install from PyPI (Recommended)

The simplest way to install the library is using pip:

pip install strava-cz

2. Install from Source

If you want the latest development version:

git clone https://github.com/jsem-nerad/strava-cz-python.git
cd strava-cz-python
pip install -e .

3. Install for Development

If you plan to contribute or modify the library:

git clone https://github.com/jsem-nerad/strava-cz-python.git
cd strava-cz-python
pip install -e .[dev]

This installs additional development dependencies:

  • pytest - Testing framework
  • pytest-cov - Coverage reporting
  • black - Code formatter
  • flake8 - Linter
  • mypy - Type checker

Virtual Environment Setup

It's recommended to use a virtual environment:

Linux / macOS

python3 -m venv venv
source venv/bin/activate
pip install strava-cz

Windows

python -m venv venv
venv\Scripts\activate
pip install strava-cz

Verify Installation

Test that the library is installed correctly:

import strava_cz

print(strava_cz.__version__)  # Should print the version number

# Check that main classes are available
from strava_cz import StravaCZ, MealType, OrderType, Menu
print("Installation successful!")

Environment Variables (Optional)

For convenience, you can set up environment variables for your credentials:

Linux / macOS

Create a .env file:

STRAVA_USERNAME=your.username
STRAVA_PASSWORD=YourPassword123
STRAVA_CANTEEN_NUMBER=3753

Then use with python-dotenv:

pip install python-dotenv
import os
from dotenv import load_dotenv
from strava_cz import StravaCZ

load_dotenv()

strava = StravaCZ(
    username=os.getenv("STRAVA_USERNAME"),
    password=os.getenv("STRAVA_PASSWORD"),
    canteen_number=os.getenv("STRAVA_CANTEEN_NUMBER")
)

Windows

Set environment variables in PowerShell:

$env:STRAVA_USERNAME="your.username"
$env:STRAVA_PASSWORD="YourPassword123"
$env:STRAVA_CANTEEN_NUMBER="3753"

Troubleshooting

Import Error

If you get ModuleNotFoundError: No module named 'strava_cz':

  • Ensure you activated your virtual environment
  • Try reinstalling: pip uninstall strava-cz && pip install strava-cz

Version Conflicts

If you have dependency conflicts:

pip install --upgrade strava-cz

SSL Certificate Errors

If you encounter SSL certificate errors, ensure your Python installation has up-to-date SSL certificates:

pip install --upgrade certifi

Next Steps

Clone this wiki locally