Skip to main content
Change of provenance

The repository or configuration that created this release differ from a previous release. View details.

Pre-release

This release is a pre-release and may not be stable for production use.

Main Sequence Logo

Main Sequence Python SDK

Docs Open Issues Last Commit Maintained

The Main Sequence Python SDK is the client and development toolkit for the Main Sequence platform. It provides authentication, typed platform resources, CodeRepository development and release operations, Agent and A2A workflows, jobs, sharing, observability, logging, tracing, and reusable scaffold tooling.

MetaTables is now an independent domain package, installed as mainsequence-metatable and imported as metatables. Table models, time-index table updates, SQLAlchemy schemas, local database interfaces, and Alembic execution are no longer implemented by this distribution.

Repository Status

What This Repository Contains

Main package areas:

  • mainsequence.client: API client models for users, CodeRepositories, jobs, Agents, artifacts, constants, secrets, sharing, releases, and other platform resources
  • mainsequence.cli: the complete mainsequence command-line interface for authentication, platform resources, and local CodeRepository operations
  • mainsequence.instrumentation and mainsequence.logconf: SDK tracing and logging integration
  • mainsequence.server: server-side caller assertion verification
  • mainsequence.scaffold_skills: reusable, version-pinned skill copying for this SDK and extension libraries

Repository areas:

  • agent_scaffold/skills/: version-matched SDK guidance and domain skills; repository-owned AGENTS.md files are never scaffolded or updated
  • docs/: knowledge guides, CLI docs, architecture decisions, and generated reference docs
  • tests/: offline tests plus explicitly marked live-backend tests

Documentation Map

Recommended entry points:

The beginner tutorial is maintained in the separate MainSequence SDK tutorial CodeRepository.

Quick Start

Install and authenticate:

pip install mainsequence
mainsequence login
mainsequence doctor

An already MCP-authenticated coding agent can establish the same persisted CLI session with mainsequence login --mcp, then call the printed auth.cli_authorize tool while the command waits. The backend supplies the callback URI; tokens return directly to the CLI and are never exposed through MCP.

Inspect and create CodeRepositories:

mainsequence code-repository search
mainsequence code-repository create my-first-repository
mainsequence code-repository set-up-locally <CODE_REPOSITORY_UID>
cd my-first-repository
mainsequence code-repository build-local-venv --path .

Use mainsequence --help and mainsequence code-repository --help for the installed command surface. The CLI includes Agent and AgentSession, CodeRepository, jobs and runs, images, resources and releases, constants, secrets, teams, sharing, scaffold, Docker, and local-development commands.

Python Client

mainsequence.client provides AuthLoaders, MainSequenceClient, generic request and response helpers, and typed platform adapters. The platform owns authorization and lifecycle policy. The SDK resolves CodeRepository source identity from the current Git checkout when an operation requires that context.

Discover deployments with ResourceRelease.filter(name=...) or resolve a known release UID with ResourceRelease.get(pk=...). For shared deployments owned by another repository, use the explicitly scoped filter_admin path. See Resource releases for supported filters and examples.

The standard mainsequence installation includes PyJWT and cryptography for the framework-independent caller assertion verifier. Applications remain responsible for resource authorization and storage operations.

Install mainsequence-metatable and import metatables for table-domain work. See the MetaTables migration guide for the install step, old and new imports, retired table CLI commands, and the legacy SDK option.

Development

This repository requires Python 3.13 or newer and uses pyproject.toml with a development dependency group.

uv sync --group dev
pytest
ruff check .
mkdocs build --strict

Live-backend tests are marked live and excluded from a normal test run. Run them explicitly with pytest -m live when credentials and a target backend are available.

Package metadata is defined in pyproject.toml. This repository is licensed under the MIT License; see LICENSE.

Metadata

Release files for mainsequence 9.0.30.dev73

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Change of provenance

The repository or configuration that created these release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Source distribution (sdist)

Source distribution for mainsequence 9.0.30.dev73
File Size Uploaded Provenance
mainsequence-9.0.30.dev73.tar.gz 399.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mainsequence 9.0.30.dev73
File Interpreter ABI Platform
mainsequence-9.0.30.dev73-py3-none-any.whl Python 3 none any Details

Total release size: 716.3 kB

Release files / mainsequence-9.0.30.dev73.tar.gz

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL mainsequence-9.0.30.dev73.tar.gz
Size 399.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d7f795a45d704bff8966cf41315aceabde86a7b258ad7c791e23eabc1fed7f92
BLAKE2b-256 checksum
How to use checksums
1fcc1ea57b82c5165bedf3176ddbdfc613a9b1a66c22741ab3c33c6d9051da54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Release files / mainsequence-9.0.30.dev73-py3-none-any.whl

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL mainsequence-9.0.30.dev73-py3-none-any.whl
Size 317.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e7b20fbf62eef256339f0f14ea80337125e7e583327ce231fad6b27cbac80f7d
BLAKE2b-256 checksum
How to use checksums
f2b45521f03b59714c46ed8d718d23a58c5dde25cf34506c0ed9228d9f2e5953
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Security for mainsequence 9.0.30.dev73

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Change of provenance

The configuration that created this release differs from a previous release.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Configuration

  • Removed 9.0.29 publish-to-pypi.yml
  • Added 9.0.30.dev73 publish-dev-to-pypi.yml
Select from 2 files

Attestation for mainsequence-9.0.30.dev73.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page