Metadata-Version: 2.4
Name: mainsequence
Version: 3.4.2
Summary: Main Sequence SDK 
Author-email: Main Sequence GmbH <dev@main-sequence.io>
License: MainSequence GmbH SDK License Agreement
        This License Agreement (the "License") governs the use, modification, and distribution of the software provided by MainSequence GmbH (the "Licensor"). The software (the "Software") is provided to you under the terms of this License. By using the Software, you agree to the terms of this License.
        
        TERMS AND CONDITIONS
        0. Definitions
        "Personal Use": Use by an individual for personal purposes that are not connected to any business, organization, or commercial activity.
        "Internal Use": Use within a business, organization, or other entity, provided it is not made accessible to third parties or used for commercial purposes.
        "Commercial Use": Use of the Software in exchange for monetary or other compensation, including hosting, offering Software as a service, selling the Software, or using it in a product or service for sale.
        "License Agreement": The legally binding agreement between the Licensor and the licensee (you), subject to the terms outlined in this License.
        1. Grant of License
        1.1 Personal and Internal Use
        The Licensor grants you a limited, non-exclusive, non-transferable, revocable license to use and modify the Software for personal or internal use only, provided that such use is strictly subject to this License Agreement and continues only while the License Agreement remains in effect.
        Upon termination of this License Agreement, all rights to use the Software for personal or internal purposes shall be immediately revoked, and you must cease all use of the Software.
        1.2 Modification
        You are permitted to modify the Software solely for your own personal or internal use, subject to the restrictions outlined in this License Agreement.
        You are not permitted to distribute, sublicense, or otherwise transfer modified or unmodified versions of the Software to any third party.
        1.3 Prohibited Redistribution
        You may not redistribute, sublicense, sell, lease, rent, or otherwise transfer the Software, whether in its original form or as modified by you, to any third party.
        Any attempt to distribute or transfer the Software in any way, without explicit permission from MainSequence GmbH, is strictly prohibited.
        2. Prohibition of Commercial Use
        The Software may not be used for any commercial purposes without obtaining a separate commercial license from MainSequence GmbH.
        Examples of prohibited commercial use include, but are not limited to:
        Hosting or offering the Software as a service to others, either modified or unmodified.
        Using the Software as part of a commercial product or service provided to customers for a fee.
        Using the Software in any production environment that generates income, directly or indirectly, from its use.
        3. Termination
        This License Agreement will automatically terminate if you fail to comply with any of its terms.
        Upon termination of this License, you must immediately cease all use of the Software, destroy all copies (modified or unmodified), and remove the Software from any devices or systems on which it is installed.
        MainSequence GmbH reserves the right to terminate this License at its discretion for any violation of its terms or for any other reason.
        4. Commercial License
        If you wish to use the Software for commercial purposes, you must contact MainSequence GmbH to negotiate and obtain a separate commercial license. The terms of the commercial license, including any fees, will be negotiated separately from this License Agreement.
        Without a valid commercial license, you are strictly prohibited from using the Software for any commercial activity.
        5. Disclaimer of Warranty
        THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL MAINSEQUENCE GMBH OR THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        
        6. Limitation of Liability
        IN NO EVENT SHALL MAINSEQUENCE GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
        
        7. Governing Law
        This License Agreement shall be governed by and construed in accordance with the laws of the jurisdiction where MainSequence GmbH is located, without regard to its conflict of law provisions.
Project-URL: Homepage, https://github.com/mainsequence-sdk/mainsequence-sdk
Project-URL: Issues, https://github.com/mainsequence-sdk/mainsequence-sdk/issues
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cloudpickle
Requires-Dist: cryptography
Requires-Dist: fire
Requires-Dist: google-auth
Requires-Dist: joblib
Requires-Dist: matplotlib
Requires-Dist: nbconvert
Requires-Dist: numexpr
Requires-Dist: opentelemetry-api
Requires-Dist: opentelemetry-exporter-otlp
Requires-Dist: opentelemetry-sdk
Requires-Dist: pandas
Requires-Dist: pandas-market-calendars
Requires-Dist: psutil
Requires-Dist: pyarrow
Requires-Dist: pydantic
Requires-Dist: python-binance
Requires-Dist: python-dotenv
Requires-Dist: python-logstash
Requires-Dist: pyyaml
Requires-Dist: s3fs
Requires-Dist: scikit-learn
Requires-Dist: scipy
Requires-Dist: structlog
Requires-Dist: tqdm
Requires-Dist: colorama
Requires-Dist: kaleido
Requires-Dist: newspaper3k
Requires-Dist: lxml-html-clean
Requires-Dist: docstring-parser
Requires-Dist: concurrent-log-handler
Requires-Dist: duckdb
Requires-Dist: plotly
Requires-Dist: typer
Requires-Dist: QuantLib
Requires-Dist: streamlit
Dynamic: license-file

<p align="center">
<img src="https://main-sequence.app/static/media/logos/MS_logo_long_black.png" alt="Main Sequence Logo" width="500"/>
</p>

# Main Sequence Python SDK


The Main Sequence Python SDK is a high-performance client library that enables seamless integration with the Main Sequence platform. 
It provides a unified and intuitive interface for interacting with data, compute, and intelligence services across the platform.

Main Sequence functions as a centralized engine for data intelligence—integrating information from diverse data sources and systems
while abstracting away the complexity of underlying storage layers. This allows quants, researchers, analysts,
and engineers to focus on the data-generating process itself, while Main Sequence optimizes all CRUD operations and manages 
the mapping between logical data structures and physical storage.

The Main Sequence SDK is also a foundational component of all Main Sequence Platform projects. 
It acts as the backbone for automation, process orchestration, and the rapid development of dashboards,
data nodes, and agentic tools built on top of the platform.


---



## How the Repository is Organized

The documentation follows the same structure as the SDK. Within each topic, we delve deeper into the logic and usage.

Additionally, we provide an extensive set of examples within the repository here:  
[Example Repository](https://github.com/mainsequence-sdk/mainsequence-sdk/tree/main/mainsequence).

The examples section is organized by use case rather than by individual libraries.

Recordings of our previous bootcamps will be available on our YouTube channel:  
[YouTube Channel](https://www.youtube.com/channel/UCHevDrKbbsoWuV4OjTHOrpA).

### Main Sequence SDK Components

Below are the main modules that compose the Main Sequence SDK, which are importable from `mainsequence`:

1. **TDAG:** A time-series data orchestration and scheduling tool.
2. **Client:** The Main Sequence client for interacting with the Main Sequence API.
3. **VirtualFundBuilder:** A collection of classes and methods to quickly build portfolios and interact with our AI agents.
4. **CLI:** The Main Sequence CLI tool.
5. **Instruments:** An open-source integration of Main Sequence and QuantLib for quantitative finance.
6. **Dashboards:** A collection of scaffolding recipes to integrate Streamlit dashboards with Main Sequence.

### Repository Extra Materials

1. **Examples:** A comprehensive collection of examples demonstrating how to build portfolios and interact with our AI agents.
2. **Docs:** A collection of documentation and tutorials.
3. **Scripts:** A collection of scripts for automating common tasks.
4. **Tests:** Unit tests for the SDK.



## Developing with the Main Sequence SDK & Platform
To make it easy to work on Main Sequence projects from your local environment, you have two options:

1. **Use the MainSequence CLI directly in your terminal**, or  
2. **Use the Main Sequence VS Code extension** (recommended if you already work in VS Code).

The VS Code extension provides a more visual, editor-integrated workflow on top of what the CLI offers.


### Visual Studio Code Extension

1. **Open the Extensions view in VS Code**

   - **macOS:** Press `Cmd` + `Shift` + `X`  
   - **Windows/Linux:** Press `Ctrl` + `Shift` + `X`  
   - Or click the **Extensions** icon in the Activity Bar on the left side of the window.

2. **Search for the extension**

   In the Extensions search box, type Main Sequence and press Enter or install it from here https://marketplace.visualstudio.com/items?itemName=MainSequenceGmbH.vscode-mainsequence


![img.png](/docs/img/vs_code_extension.png)

### MainSequence CLI

MainSequence CLI is a small helper tool to:

- Authenticate against the Main Sequence backend
- Manage your local project checkouts (clone, open, delete)
- Set up SSH deploy keys for project repos
- Generate and maintain a `.env` file with project-specific tokens and endpoints
- Build & run your project in Docker (via `uv` + `docker`)
- Bundle and copy AI/LLM instruction markdowns to the clipboard

The CLI is implemented with [Typer](https://typer.tiangolo.com/) and exposes a `mainsequence` command.

---

## Installation & Invocation

How you install the CLI depends on how this repository is packaged, but assuming it’s installed in your environment and provides the `mainsequence` entry point:

```bash
# General form
mainsequence --help
