Installation
This is a technical intro on how to get started with QCS Python library to run risk analysis and optimization on portfolios.
Getting started (user setup)
Using uv
- We recommend using uv to install and manage python packages, virtual environments and python versions.
- navigate to project folder
- initialize a project:
uv init - install qcs library (replace VERSION_NUMBER and CLIENT_ID with relevant info)
uv add https://CLIENT_ID.quarisma.net/downloads/VERSION_NUMBER-py3-none-any.whl
- download and extract
qcs-python-examples-VERSION_NUMBER.zipinto project folder - login to QCS
uv run examples/example_login_logout.py
- run example files
uv run examples/example_analyze_risk.pyuv run examples/example_optimize_min_tracking_error.pyuv run examples/example_optimize_robust_mean_variance.pyuv run examples/example_covariance.py
Using pip and venv
- Prerequisites: have python >= 3.10 and <= 3.13
- navigate to project folder
- create virtual environment
python3 -m venv venv - activate virtual environment:
- Windows:
venv\Scripts\activate - Mac / Linux:
source venv/bin/activate
- Windows:
- install qcs library (replace VERSION_NUMBER and CLIENT_ID with relevant info)
pip install https://CLIENT_ID.quarisma.net/downloads/VERSION_NUMBER-py3-none-any.whl
- download and extract
qcs-python-examples-VERSION_NUMBER.zipinto project folder - login to QCS
python examples/example_login_logout.py
- run example files
python examples/example_analyze_risk.pypython examples/example_optimize_min_tracking_error.pypython examples/example_optimize_robust_mean_variance.pypython examples/example_covariance.py
Version info
- to see the package version and dependencies from CLI
pip show qcsoruv pip show qcs
- to see version info from python
qcs.__version__