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

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

Built distribution (wheel)

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

Total release size: 248.8 kB

Release files / litedbmodel_runtime-2.3.2.tar.gz

Download URL litedbmodel_runtime-2.3.2.tar.gz
Size 157.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b64dbad055dace22b8a4fc3a76f4b5f0ea580358486b9460ca258bf241839b3b
BLAKE2b-256 checksum
How to use checksums
edd5f2d4a454d663952e3def97f0b8c6193838693b6e3173f50a4c16949a696c
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.2-py3-none-any.whl

Download URL litedbmodel_runtime-2.3.2-py3-none-any.whl
Size 91.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d847a7bbad36befff58b26e91fbed07b0fd2243e0895816ccf34ee675383704a
BLAKE2b-256 checksum
How to use checksums
02cfd9c8780c7626aea4a4384e0d3b9410d08e2baa0cf224de83b02a04b0e510
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.2

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