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

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

Built distribution (wheel)

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

Total release size: 248.8 kB

Release files / litedbmodel_runtime-2.3.4.tar.gz

Download URL litedbmodel_runtime-2.3.4.tar.gz
Size 157.4 kB
Tags Source
SHA-256 checksum
How to use checksums
303f053bfd1b52127b195adbbd713fce80b8d35242a32ae479da790655a10948
BLAKE2b-256 checksum
How to use checksums
302fe757c6540b92b9c2c54cce67ed4c227ac8690f40f33d2a5f1a9e15098eb3
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.4-py3-none-any.whl

Download URL litedbmodel_runtime-2.3.4-py3-none-any.whl
Size 91.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
14cd793b043f9053627a5ed71d91e0e4be919fed79a7846a25d4884cbd0b92d9
BLAKE2b-256 checksum
How to use checksums
40e8ecc720a60d129e11793414584707f2f7859cc9e6c325dd5f2fa7568c2cf7
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.4

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