Skip to main content

litedbmodel-runtime (Python)

The Python leg of the litedbmodel v2 SCP multi-language runtime. A bc generate --lang python-native module is plain Python with no behavior-contracts runtime; it calls the three leaf transports this package provides — execute_sql / pluck_keys / group_children in litedbmodel_runtime.leaves — wired to the central execute/run seam, connection routing, transactions, and the render-layer placeholder resolution. Semantics-identical to the TS reference (src/scp).

Calling a generated module

The module is generated with the transports baked in:

bc generate --from <model>.ts --lang python-native \
  --leaf-transport executeSQL=execute_sql pluck=pluck_keys group=group_children \
  --leaf-transport-import litedbmodel_runtime.leaves

Its entries are module-level functions (snake_case names, authored parameter names). The execution context the statements run on is bound around the call with with_leaf_transport():

from litedbmodel_runtime import with_leaf_transport
import behaviors_postgres as repo

rows = with_leaf_transport(conn_or_ctx, "postgres", lambda: repo.find_by_email(email="a@b.c"))

conn_or_ctx is a DB-API connection or an ExecutionContext (a routed context resolves its connection per statement). The binding is a ContextVar, so it follows the call into the worker threads of a parallel stage. A statement failure surfaces as the module's BehaviorError (OP_FAILED) with the SqlFailure / LimitExceededError as its cause.

The package has no behavior-contracts dependency.

Layout

python/
  pyproject.toml                       # PyPI package (litedbmodel-runtime), version-synced from package.json
  litedbmodel_runtime/
    leaves.py                          # the op-agnostic leaf transport + with_leaf_transport()
    exec_context.py                    # the ExecutionContext + central execute/run seam + transactions
    connection_routing.py              # reader/writer + named-connection routing
    driver.py / dialect.py / grouping.py / errors.py / middleware.py / tx_options.py
  conformance/
    behaviors_<dialect>.py             # generated python-native modules for the live-DB corpus
    livedb_runner.py                   # the live-DB corpus runner
  orm_bench/                           # the ORM-bench cell (generated modules + harness)
  tests/                               # pytest runtime tests

Running

python3 -m pip install './python[test]' && python3 -m pytest python/tests

Metadata

Release files for litedbmodel-runtime 2.3.3

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

Source distribution (sdist)

Source distribution for litedbmodel-runtime 2.3.3
File Size Uploaded Provenance Actions
litedbmodel_runtime-2.3.3.tar.gz 157.4 kB Without provenance Details for litedbmodel_runtime-2.3.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for litedbmodel-runtime 2.3.3
File Interpreter ABI Platform Actions
litedbmodel_runtime-2.3.3-py3-none-any.whl Python 3 none any Details for litedbmodel_runtime-2.3.3-py3-none-any.whl

Total release size: 248.8 kB

Release files / litedbmodel_runtime-2.3.3.tar.gz

Download URL litedbmodel_runtime-2.3.3.tar.gz
Size 157.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7dd044b63fd8b7b3876e963f8e41161cc935ce7f420a913d262bc89a71eef8ce
BLAKE2b-256 checksum
How to use checksums
fab11d23445d69a215d3727040e52aa14fff24dfb9c2ad6497901ab636f7bb73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / litedbmodel_runtime-2.3.3-py3-none-any.whl

Download URL litedbmodel_runtime-2.3.3-py3-none-any.whl
Size 91.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1fba3c2fb55e3a86e16b6423a39d47d0389b06384e27bb982b4349f23ef03e82
BLAKE2b-256 checksum
How to use checksums
4b819d7db2715e61e535406f75287cd19ebb4ec0b18b96f334fd03a0fe4fab2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for litedbmodel-runtime 2.3.3

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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