Metadata-Version: 2.4
Name: mainsequence
Version: 3.17.18
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: cachetools
Requires-Dist: cloudpickle
Requires-Dist: concurrent-log-handler
Requires-Dist: numpy
Requires-Dist: opentelemetry-api
Requires-Dist: opentelemetry-exporter-otlp
Requires-Dist: opentelemetry-sdk
Requires-Dist: pandas
Requires-Dist: psutil
Requires-Dist: pydantic
Requires-Dist: pytz
Requires-Dist: pyyaml
Requires-Dist: requests
Requires-Dist: structlog
Requires-Dist: tqdm
Requires-Dist: typer
Requires-Dist: urllib3
Provides-Extra: local-data
Requires-Dist: duckdb; extra == "local-data"
Requires-Dist: pyarrow; extra == "local-data"
Provides-Extra: virtualfundbuilder
Requires-Dist: docstring-parser; extra == "virtualfundbuilder"
Requires-Dist: joblib; extra == "virtualfundbuilder"
Requires-Dist: pandas-market-calendars; extra == "virtualfundbuilder"
Requires-Dist: scikit-learn; extra == "virtualfundbuilder"
Provides-Extra: instruments
Requires-Dist: matplotlib; extra == "instruments"
Requires-Dist: QuantLib; extra == "instruments"
Provides-Extra: dashboards
Requires-Dist: streamlit; extra == "dashboards"
Requires-Dist: streamlit-aggrid; extra == "dashboards"
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

[![Docs](https://img.shields.io/badge/docs-online-blue)](https://mainsequence-sdk.github.io/mainsequence-sdk/)
[![Open Issues](https://img.shields.io/github/issues/mainsequence-sdk/mainsequence-sdk)](https://github.com/mainsequence-sdk/mainsequence-sdk/issues)
[![Last Commit](https://img.shields.io/github/last-commit/mainsequence-sdk/mainsequence-sdk)](https://github.com/mainsequence-sdk/mainsequence-sdk/commits/main/)
[![Maintained](https://img.shields.io/badge/maintained-actively-green.svg)](https://github.com/mainsequence-sdk/mainsequence-sdk/commits/main/)

The Main Sequence Python SDK is the client and development toolkit for the Main Sequence platform.

The Main Sequence platform allows you to:

1. rapidly build and deploy data products and data workflows as a unified API with a normalized structure through `DataNode`s
2. rapidly deploy RBAC-enabled dashboards on the platform
3. rapidly deploy agents using the Google Agent SDK

The key idea is that you can focus on development and deployment, while the platform handles the DevOps layer.

## Project Status

- Status: actively maintained
- Last commit: `2026-03-27` - [`6aa5dea`](https://github.com/mainsequence-sdk/mainsequence-sdk/commit/6aa5deab73586226c7b267abf2e3f02f4f7e7669) - `docs logo fix v.3.17.6`
- Open issues: [GitHub Issues](https://github.com/mainsequence-sdk/mainsequence-sdk/issues)
- Documentation: [Documentation Site](https://mainsequence-sdk.github.io/mainsequence-sdk/)
- Security policy: [SECURITY.md](SECURITY.md)
- Release history: [CHANGELOG.md](CHANGELOG.md)

## What this repository contains

This repository contains the SDK and the documentation used to build and operate Main Sequence projects.

Main package areas:

- `mainsequence.tdag`: data orchestration, `DataNode`s, update workflows, and persistence
- `mainsequence.client`: API client models for projects, jobs, data node storages, assets, sharing, and platform resources
- `mainsequence.virtualfundbuilder`: portfolio construction and portfolio time series workflows
- `mainsequence.instruments`: pricing-oriented market data and instrument tooling
- `mainsequence.dashboards.streamlit`: reusable Streamlit scaffolding and dashboard helpers
- `mainsequence.cli`: the `mainsequence` command-line interface

Repository areas:

- `docs/`: tutorials, knowledge guides, CLI docs, and generated reference docs
- `examples/`: worked examples and usage patterns
- `tests/`: automated tests

## Documentation map

The documentation is organized into four reading modes:

1. **Tutorial**: the guided learning path
2. **Knowledge**: deeper conceptual guides
3. **CLI**: command-focused operational documentation
4. **Reference**: generated API reference

Recommended entry points:

- Tutorial:
  - [Setting a Project (CLI)](docs/tutorial/setting_a_project.md)
  - [Creating a Data Node](docs/tutorial/creating_a_simple_data_node.md)
  - [Working With Simple Tables](docs/tutorial/working_with_simple_tables.md)
  - [Create Your First API](docs/tutorial/create_your_first_api.md)
  - [Role-Based Access Control](docs/tutorial/role_based_access_control.md)
- Knowledge:
  - [Data Nodes](docs/knowledge/data_nodes.md)
  - [Command Center](docs/knowledge/command_center/index.md)
  - [Command Center Widget Data Contracts](docs/knowledge/command_center/widget_data_contracts.md)
  - [Simple Tables](docs/knowledge/simple_tables/simple_table.md)
  - [Constants and Secrets](docs/knowledge/infrastructure/constants_and_secrets.md)
  - [Scheduling Jobs](docs/knowledge/infrastructure/scheduling_jobs.md)
  - [Streamlit Helpers](docs/knowledge/dashboards/streamlit/index.md)
  - [Virtual Fund Builder](docs/knowledge/virtualfundbuilder/index.md)
  - [Instruments](docs/knowledge/instruments/index.md)
- CLI:
  - [CLI Overview](docs/cli/index.md)

## Quick start

Install the package:

```bash
pip install mainsequence
```

Authenticate:

```bash
mainsequence login you@company.com
```

Check that you can see your projects:

```bash
mainsequence project list
```

Create a new project:

```bash
mainsequence project create my-first-project
```

Set it up locally:

```bash
mainsequence project set-up-locally <PROJECT_ID>
cd my-first-project
mainsequence project build_local_venv --path .
```

From there, the normal learning path is:

1. create your first `DataNode`
2. model app-facing data with `SimpleTable` when needed
3. add an API or another application surface
4. understand sharing and RBAC
5. schedule jobs
6. build dashboards or downstream consumers

## Installation for development

This repository uses `pyproject.toml` and a development dependency group.

With `uv`:

```bash
uv sync --group dev
```

Or with `pip`, install the package and the docs/test tools you need separately.

## Common development commands

Run the CLI:

```bash
mainsequence --help
```

Run tests:

```bash
pytest
```

Serve the docs locally:

```bash
mkdocs serve
```

Build the docs:

```bash
mkdocs build
```

Lint the code:

```bash
ruff check .
```

Format the code:

```bash
black .
```

## How to read this repository

If you are evaluating the platform:

- start with the tutorial in `docs/tutorial/`

If you are building a feature and already know the area:

- go straight to the relevant guide in `docs/knowledge/`

If you are operating projects day to day:

- use `docs/cli/` and the `mainsequence --help` command tree

If you need the exact SDK surface:

- use `docs/reference/`

## Package metadata

- Package name: `mainsequence`
- Python: `>=3.10`
- CLI entry point: `mainsequence`

Project metadata is defined in [pyproject.toml](pyproject.toml).

## License

This repository is distributed under the terms described in [LICENSE](LICENSE).
