Skip to main content
Pre-release

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

rototo Python SDK

The Python SDK is a thin native wrapper around the Rust SDK. Python code gets an idiomatic async API while rototo keeps workspace loading, linting, refresh, and resolution behavior in the Rust core.

Install

rototo is currently published as an alpha package for Python 3.10 and newer:

python -m pip install rototo

If your package resolver is constrained to stable releases, allow prereleases explicitly:

python -m pip install --pre rototo

The rototo release version stays SemVer, for example 0.1.0-alpha.5. Python packaging tools may display the equivalent PEP 440 spelling 0.1.0a5 for the distribution.

Load A Workspace

import rototo

workspace = await rototo.Workspace.load("examples/basic")

Workspace.load accepts the same source strings as the CLI. It lints the workspace and rejects lint failures before returning.

Resolve A Variable

resolution = await workspace.resolve_variable(
    "premium-message",
    {"user": {"tier": "premium"}},
)

print(resolution.value)
print(resolution.source)

VariableResolution has:

Field Meaning
id Variable id.
value Selected JSON-compatible Python value.
source Selected source.

Resolve A Qualifier

matches = await workspace.resolve_qualifier(
    "premium-users",
    {"user": {"tier": "premium"}},
)

print(matches)

Qualifier resolution returns the final boolean result.

Context Validation

Resolution validates context against a compatible request context schema by default. Skip validation for one call when a tool needs to evaluate partial context:

resolution = await workspace.resolve_variable(
    "premium-message",
    context,
    validate_context=False,
)

The context still must be a JSON object.

Inspect And Lint

workspace = await rototo.Workspace.inspect("examples/basic")
lint = await workspace.lint()

Inspection is for tools. A workspace loaded through inspect cannot resolve variables or qualifiers because it does not compile the runtime model.

Refreshing Workspace

workspace = await rototo.RefreshingWorkspace.load(
    source,
    period_seconds=30,
)

resolution = await workspace.resolve_variable("premium-message", context)
status = await workspace.status()
await workspace.shutdown()

RefreshingWorkspace keeps serving the last successfully loaded workspace when refresh fails. status returns a RefreshStatus dataclass with fingerprint, success, attempt, failure, error, refreshing, and immutable fields.

Errors

Rust RototoError values become rototo.RototoError in Python:

try:
    await workspace.resolve_variable("missing", {})
except rototo.RototoError as error:
    print(error)

Invalid Python option values, such as an unknown lint mode, raise Python ValueError.

Public Types

Type Purpose
Workspace Loaded workspace handle.
RefreshingWorkspace Refreshing workspace handle for services.
VariableResolution Selected variable value.
RefreshStatus Refresh state snapshot.
RototoError Error raised for rototo failures.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rototo-0.1.0a5.tar.gz (422.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

rototo-0.1.0a5-cp310-abi3-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.10+Windows x86-64

rototo-0.1.0a5-cp310-abi3-manylinux_2_28_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ x86-64

rototo-0.1.0a5-cp310-abi3-manylinux_2_28_aarch64.whl (5.3 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

rototo-0.1.0a5-cp310-abi3-macosx_11_0_arm64.whl (4.8 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

rototo-0.1.0a5-cp310-abi3-macosx_10_12_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file rototo-0.1.0a5.tar.gz.

File metadata

  • Download URL: rototo-0.1.0a5.tar.gz
  • Upload date:
  • Size: 422.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rototo-0.1.0a5.tar.gz
Algorithm Hash digest
SHA256 00eda019e2195a6f2629c1f931addde91e9ce18a78811f0acb85ad8d8de4f49e
MD5 2ec2604552d261e8eb847fcdbc43381c
BLAKE2b-256 8233de9532092603e7aba59da44477cb6bf9ae0e61650245077d51ca49c9511d

See more details on using hashes here.

Provenance

The following attestation bundles were made for rototo-0.1.0a5.tar.gz:

Publisher: release.yml on manasgarg/rototo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rototo-0.1.0a5-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: rototo-0.1.0a5-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 4.6 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rototo-0.1.0a5-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 20ff4d34265bad3febf1a551fb8a35def73d27f58c3ccfc3c1fa5e9ca942c083
MD5 1bdaa69a0770eb129ce53eaa4240bf7a
BLAKE2b-256 297c8f67b641852449d7c4a07b17417c32a4a036fcc9de49b108b8fa1f08ce82

See more details on using hashes here.

Provenance

The following attestation bundles were made for rototo-0.1.0a5-cp310-abi3-win_amd64.whl:

Publisher: release.yml on manasgarg/rototo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rototo-0.1.0a5-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rototo-0.1.0a5-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b7a3bfa3404715ba1cbab4251a5a16cbb46841b51d1f98e539390aeb01e16e44
MD5 f289237c5a45f6b053142c7a1d17476b
BLAKE2b-256 9c5878724f961e9612a24359a03566380e94b018cfa1076c9f975e5ec5a53467

See more details on using hashes here.

Provenance

The following attestation bundles were made for rototo-0.1.0a5-cp310-abi3-manylinux_2_28_x86_64.whl:

Publisher: release.yml on manasgarg/rototo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rototo-0.1.0a5-cp310-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for rototo-0.1.0a5-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 51964869bdfc74407741ea488c3f648fea44c8472e79ac47d3559b96d45508d3
MD5 df70c30d7dda4d9ad5fb3c08193be336
BLAKE2b-256 39ddb011272b128b2cf46884f6aacdb97028840501af97d9fa092be4df1905a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for rototo-0.1.0a5-cp310-abi3-manylinux_2_28_aarch64.whl:

Publisher: release.yml on manasgarg/rototo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rototo-0.1.0a5-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rototo-0.1.0a5-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4476874d9d0ee0e2e20f086eb06759419a7d4f6920f18f6daa276b6a32df657a
MD5 b79c9c17a55e8319a05e799454d37b7e
BLAKE2b-256 d60a28f085541c0d7a0e7ed158f8500bde6a7433f6d538c10cfd3546a95147a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for rototo-0.1.0a5-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on manasgarg/rototo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rototo-0.1.0a5-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for rototo-0.1.0a5-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d52a8edddd50b08c3dca58db63b7ee009a12a0bf9e37dbd0a0e798ad25953813
MD5 e18fc3b7be71344be2809307e90ee031
BLAKE2b-256 693e57ebc987760896d091c5142290d57d96f89c0308920103c011d62055c066

See more details on using hashes here.

Provenance

The following attestation bundles were made for rototo-0.1.0a5-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on manasgarg/rototo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page