Skip to content

Tutorial

Installation setup

You can install the package in two methods:

  • using pip as an additional package to your project,
  • as a developer, cloning and installing the repository locally

Installing with pip

We recommend you to create first a virtual environment, either with conda or with venv. Note that bam-masterdata can be installed with any Python version between 3.9 and 3.12.

Conda

Run:

conda create --name .venv pip python=3.12
conda activate .venv

Venv

Run:

python3.12 -m venv .venv
source .venv/bin/activate

After creating and activating your environment, make sure you have pip upgraded, and install the package:

pip install --upgrade pip
pip install bam-masterdata

Hint

In order to install faster the package, you can use uv for pip installing Python packages:

pip install uv
uv pip install bam-masterdata

Development

In order to develop the package, first you have to clone the repository:

git clone https://git.bam.de/bam-data-store/bam-masterdata.git
cd bam-masterdata

Same as before, create a virtual environment (in this example, we use venv) and activate it:

python3 -m venv .venv
source .venv/bin/activate

Run the following script:

./scripts/install_python_dependencies.sh
Installation script

The script contains a set of steps which ensure to install the package with all optional dependencies. If you prefer to install manually, we recommend you to take a look into the script and install only the desired dependencies.

Its content is:

#!/bin/bash

# Fail immediately if any command exits with a non-zero status
set -e

echo "Making sure pip is up to date..."
pip install --upgrade pip

echo "Installing uv..."
pip install uv

echo "Installing main project dependencies..."
uv pip install -e '.[dev,docu]'

echo "All dependencies installed successfully."