Skip to main content

sutl-py

sutl-py is the dependency-free Python implementation of sUTL 1.0, the sUTL Universal Transform Language (“subtle”). sUTL programs are JSON-compatible values that transform maps, lists, strings, numbers, booleans, and null.

The normative language specification and conformance corpus live in sutl-language.

Install

python -m pip install sutl-py

Python 3.9 or later is required.

Python API

from sutl import Runner, compilelib, evaluate, truthy

result = evaluate(
    {"person": {"name": "Ada"}},
    {"name": "^$.person.name"},
)
assert result == {"name": "Ada"}

evaluate(source, transform, library=None) creates a runner for one evaluation. Reuse Runner().evaluate(...) when making repeated calls. compilelib(...) resolves declaration requirements into a transform library. truthy(value) exposes sUTL truthiness.

The public API is typed and the distribution includes py.typed.

Command line

The sutl command accepts JSON literals directly:

sutl '{"value":4}' '["&+","^$.value",1]'
5

Prefix an argument with @ to read JSON from a UTF-8 file. Use - as the source to read it from standard input:

sutl @source.json @transform.json --library @library.json --pretty

python -m sutl provides the same interface.

Development

python -m pip install -e ".[test,build]"
python -m pytest
python -m build
python -m twine check dist/*

The tests vendor the exact sUTL 1.0 contract, all 88 conformance cases, and all 44 Studio fixtures. They also verify the corpus SHA-256 checksum pinned by the contract.

License

Apache-2.0.

Metadata

Release files for sutl-py 1.0.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 sutl-py 1.0.0
File Size Uploaded Provenance Actions
sutl_py-1.0.0.tar.gz 329.3 kB Without provenance Details for sutl_py-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sutl-py 1.0.0
File Interpreter ABI Platform Actions
sutl_py-1.0.0-py3-none-any.whl Python 3 none any Details for sutl_py-1.0.0-py3-none-any.whl

Total release size: 342.4 kB

Release files / sutl_py-1.0.0.tar.gz

Download URL sutl_py-1.0.0.tar.gz
Size 329.3 kB
Tags Source
SHA-256 checksum
How to use checksums
47abee596daf1f0bf4dc37b0fded527baaa6a8be77ad6dca26fe506176268d12
BLAKE2b-256 checksum
How to use checksums
4346ba387d73e6007ee91d84f84766c4a39d237d5e9117ee17c2bdcf86ea30d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.12

Release files / sutl_py-1.0.0-py3-none-any.whl

Download URL sutl_py-1.0.0-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aeb07d29592fea61dd3f00cfc5feb2f00e8661531a265b45dac267b8621c3aae
BLAKE2b-256 checksum
How to use checksums
30cbe0bd89bf00b044db87bd5ea8549dfb18755cb705e209f41ad834f97c0d67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.12

Security for sutl-py 1.0.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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

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