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

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

Built distribution (wheel)

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

Total release size: 248.8 kB

Release files / litedbmodel_runtime-2.3.0.tar.gz

Download URL litedbmodel_runtime-2.3.0.tar.gz
Size 157.4 kB
Tags Source
SHA-256 checksum
How to use checksums
20f18bb59b7d81ca2a6d779a0781a0bda2394b197f73b81cebb2207c7f0cd3c5
BLAKE2b-256 checksum
How to use checksums
c32abf4997e17ea7ff4099c0f226ab891e9de0cb32730bbf0c22753fee8d2e90
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.0-py3-none-any.whl

Download URL litedbmodel_runtime-2.3.0-py3-none-any.whl
Size 91.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a3e43502048d7291b13ad971d75262f406acf4189fb100d4a4060dbc887001d2
BLAKE2b-256 checksum
How to use checksums
ee506face9d580ef3c0791d534e1f6058384b459f84ed456e09acfb379480c31
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.0

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