> ## Documentation Index
> Fetch the complete documentation index at: https://systematica.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install the project.

## Requirements

### Authentication

#### Option 1: Token

After you've been added to the list of collaborators and accepted the repository invitation, the next step is to create a [Personal Access Token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) for your GitHub account in order to access the PRO repository programmatically (from the command line or GitHub Actions workflows):

1. Go to [GitHub](https://github.com/settings/tokens)
2. Click on *Generate a new token (classic)*
3. Enter a name (such as "terminal")
4. Set the expiration to some fixed number of days
5. Select the [repo](https://docs.github.com/en/developers/apps/scopes-for-oauth-apps#available-scopes) scope
6. Generate the token and save it in a safe place

#### Option 2: Credential Manager

Alternatively, use [Git Credential Manager](https://github.com/git-ecosystem/git-credential-manager) instead of creating a personal access token.

## Installation

### Clone the Repository

Clone the repository using the web URL:

```sh theme={null}
git clone https://github.com/bfcdev/quant-research.git
```

### Setup your Environment

There are two ways to set up your environment:

#### Option 1: Using `uv`

To install a project environment and dependencies using `uv`, you can follow these steps:

<Steps>
  <Step title="Install uv">
    You can install uv using various methods depending on your operating system.
    For example, on Linux or Mac, you can use the following command:

    ```sh theme={null}
    curl -LsSf https://astral.sh/uv/install.sh | sh
    ```

    Alternatively, you can install it via pip:

    ```sh theme={null}
    pip install uv
    ```

    On Windows, you can use the following command:

    ```sh theme={null}
    powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
    ```
  </Step>

  <Step title="Create a Project">
    Initialize a new Python project using the uv init command. This will create a `pyproject.toml` file, which is used to specify project metadata and dependencies.

    ```sh theme={null}
    uv init
    ```
  </Step>

  <Step title="Add Dependencies">
    Use the uv add command to add dependencies to your project. This will update the pyproject.toml file and the lockfile.

    ```sh theme={null}
    uv add PACKAGE_NAME
    ```
  </Step>

  <Step title="Create a Virtual Environment">
    Use the uv venv command to create a virtual environment for your project. This will create a .venv directory containing the isolated environment.

    ```sh theme={null}
    uv venv
    ```
  </Step>

  <Step title="Activate the Virtual Environment">
    Activate the virtual environment to start using it. The activation command varies depending on your shell and operating system.

    For example, on Unix or macOS:

    ```sh theme={null}
    source .venv/bin/activate
    ```

    On Windows:

    ```sh theme={null}
    .venv\\Scripts\\activate
    ```
  </Step>

  <Step title="Install Dependencies">
    Once the virtual environment is activated, you can install the dependencies specified in the pyproject.toml file using the uv pip install command.

    ```sh theme={null}
    uv pip install -r requirements.txt
    ```
  </Step>

  <Step title="Run the Project">
    Use the uv run command to run your project in the isolated environment. This ensures that the project is run with the exact dependencies specified in the lockfile.

    ```sh theme={null}
    uv run main.py
    ```

    By following these steps, you can effectively manage your Python project's environment and dependencies using uv.
  </Step>
</Steps>

#### Option 2: Using `conda`

If you already have a conda environment with the required dependencies:

<Steps>
  <Step title="Activate your conda environment">
    ```sh theme={null}
    conda activate your_environment_name
    ```
  </Step>

  <Step title="Install the package in development mode">
    ```sh theme={null}
    pip install -e .
    ```

    This will make the `systematica` package importable from anywhere while allowing your changes to be reflected immediately without reinstalling.
  </Step>
</Steps>

> If you plan to use vectorbtpro locally, it's recommended to establish a new environment solely for `vectorbtpro`<Tooltip tip="">.</Tooltip>

### Install VectorBT PRO

Use the following command to install the PRO version of vectorbtpro:

* Replace `GH_USER` with your GitHub username.
* Replace `GH_TOKEN` with your Personal Access Token.
* Replace `ORGANIZATION` with the GitHub organization from which you are installing VectorBT PRO. This will be either
  * `polakowo` - if you are a collaborator on the official VectorBT PRO repository; or
  * `bfcdev` - if you are a member of this organization and have access to BFC's fork of VectorBT Pro.

```sh theme={null}
uv add -U "vectorbtpro[base] @ git+https://GH_USER:GH_TOKEN@github.com/ORGANIZATION/vectorbt.pro.git"
```
