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.1

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.1
File Size Uploaded Provenance Actions
litedbmodel_runtime-2.3.1.tar.gz 157.4 kB Without provenance Details for litedbmodel_runtime-2.3.1.tar.gz

Built distribution (wheel)

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

Total release size: 248.8 kB

Release files / litedbmodel_runtime-2.3.1.tar.gz

Download URL litedbmodel_runtime-2.3.1.tar.gz
Size 157.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3fea4e65c16bcac007d359f6c7c0af74b62be81ca5ace977bc2a59f3651693a9
BLAKE2b-256 checksum
How to use checksums
0b102b01b6450bc27fbd878f137597610400d64bc7c163ccec2b6e7d8bc47178
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.1-py3-none-any.whl

Download URL litedbmodel_runtime-2.3.1-py3-none-any.whl
Size 91.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a04ae3bac038341a34140ee849bd5c9f4e07a29911299a9c5b1af561a090692f
BLAKE2b-256 checksum
How to use checksums
ff001be492489eac2b0c1009ad0bf814cf3d0ca49cabc948908e2ac89b685d6d
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.1

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