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, access policies, 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, access policies, 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 .

create makes the GitHub repository in a GitHub organization your Organization linked through the Main Sequence GitHub App, so an Organization admin links one first. See CodeRepository Commands for choosing it and for the errors.

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, access policies, 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.39.dev90

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.39.dev90
File Size Uploaded Provenance Actions
mainsequence-9.0.39.dev90.tar.gz 430.7 kB With provenance Details for mainsequence-9.0.39.dev90.tar.gz

Built distribution (wheel)

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

Total release size: 769.2 kB

Release files / mainsequence-9.0.39.dev90.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.39.dev90.tar.gz
Size 430.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2fc488d1d737f84c95fd70f9a405b875840c147dfad3ee96f73d700b850c50f9
BLAKE2b-256 checksum
How to use checksums
9aa41d228add0b41d3fcbe66b14dafa43f4844adae3b113b1800d40929ab7827
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 10, 2026.

Transparency log

Release files / mainsequence-9.0.39.dev90-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.39.dev90-py3-none-any.whl
Size 338.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6697d7ac537332eb492efe910463253fa25cf3fc31f39d7b8b52a1b574f100b0
BLAKE2b-256 checksum
How to use checksums
b5098a72eb8f1889132e7563c781ff6b3a5ff873c91b1c57838fa413eb5abc11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 10, 2026.

Transparency log

Security for mainsequence 9.0.39.dev90

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.

Select from 2 files

Attestation for mainsequence-9.0.39.dev90.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 Nov 10, 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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