Skip to content

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.zip into project folder
  • login to QCS
    • uv run examples/example_login_logout.py
  • run example files
    • uv run examples/example_analyze_risk.py
    • uv run examples/example_optimize_min_tracking_error.py
    • uv run examples/example_optimize_robust_mean_variance.py
    • uv 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
  • 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.zip into project folder
  • login to QCS
    • python examples/example_login_logout.py
  • run example files
    • python examples/example_analyze_risk.py
    • python examples/example_optimize_min_tracking_error.py
    • python examples/example_optimize_robust_mean_variance.py
    • python examples/example_covariance.py

Version info

  • to see the package version and dependencies from CLI
    • pip show qcs or uv pip show qcs
  • to see version info from python
    • qcs.__version__