User Guides

Directory structure

Introduction

When running the lean init, lean create-project, or lean cloud pull commands the CLI creates the basic files and folders neccessary to use LEAN. These files include the local data directory, LEAN configuration, and everything most editors need to open your source code, provide autocomplete, and enable local debugging. This page documents exactly which files are created when running lean init, and when a project directory is created by lean create-project or lean cloud pull.

lean init

lean init creates the following structure:

.
├── data/
│   ├── alternative/
│   ├── cfd/
│   ├── crypto/
│   ├── equity/
│   ├── forex/
│   ├── future/
│   ├── futureoption/
│   ├── index/
│   ├── indexoption/
│   ├── market-hours/
│   ├── option/
│   ├── symbol-properties/
│   └── readme.md
└── lean.json

These files contain the following content:

We recommend running all Lean CLI commands in the same directory lean init was ran in. Doing so ensures the directory structure is always kept consistent when synchronizing projects between the cloud and your local drive. It also makes it possible for the CLI to automatically find the Lean configuration file when running the LEAN engine locally.

New Python projects

After creating a new Python project directory with lean create-project -l python <project name> or by pulling a Python project with lean cloud pull, the following structure is created:

.
├── .idea/
│   ├── misc.xml
│   ├── modules.xml
│   ├── <project name>.iml
│   └── workspace.xml
├── .vscode/
│   ├── launch.json
│   └── settings.json
├── config.json
├── main.py (only generated by lean create-project)
└── research.ipynb (only generated by lean create-project)

These files contain the following content:

  • .idea/workspace.xml: This file contains debug configuration to make debugging with PyCharm easier.
  • .idea/<project name>.iml, .idea/misc.xml, and .idea/modules.xml: These files contain PyCharm configuration so PyCharm can provide accurate autocomplete.
  • .vscode/launch.json: This file contains debug configuration to make debugging with VS Code easier.
  • .vscode/settings.json: This file contains VS Code configuration so that VS Code's Python and Pylance extensions can provide accurate autocomplete.
  • config.json: This file contains the project configuration of the created project.
  • main.py: This file contains a basic Python algorithm to help you get started.
  • research.ipynb: This file contains a Python-based research notebook that can be opened in a research environment.

New C# projects

After creating a new Python project directory with lean create-project -l csharp <project name> or by pulling a C# project with lean cloud pull, the following structure is created:

.
├── .vscode/
│   └── launch.json
├── config.json
├── <project name>.csproj
├── Main.cs (only generated by lean create-project)
└── research.ipynb (only generated by lean create-project)

These files contain the following content:

  • .vscode/launch.json: This file contains debug configuration to make debugging with VS Code easier.
  • config.json: This file contains the project configuration of the created project.
  • <project name>.csproj: This file contains project configuration which Visual Studio, Rider, and VS Code can read to provide accurate C# autocomplete.
  • Main.cs: This file contains a basic C# algorithm to help you get started.
  • research.ipynb: This file contains a C#-based research notebook which can be opened in a research environment.

You can also see our Videos. You can also get in touch with us via Chat.

Did you find this page helpful?

Contribute to the documentation: