Skip to main content

lacelang-validator (python)

PyPI

Canonical Python validator for Lace — the reference implementation with 100% spec conformance.

This is the validator that the Lace specification is developed and tested against. All error codes, AST schemas, and validation rules are verified against this implementation before each spec release.

This package only parses and validates .lace source text. It has no HTTP client and does not execute probes. The runtime and its network surface live in the separate lacelang-executor package, per lace-spec.md §16.

Why split

Integrators that want syntax / semantic checking in a CI job, IDE extension, or block editor shouldn't have to pull in an HTTP stack, TLS, cookie state, or an extension dispatcher. Installing lacelang-validator alone gives a clean audit surface with zero network exposure.

Install

pip install lacelang-validator

Or from source:

pip install git+https://github.com/tracedown/lacelang-python-validator.git

Usage

# Parse → emit AST, or { errors: [...] } on syntax failure
lacelang-validate parse script.lace

# Validate → emit { errors: [...], warnings: [...] }
lacelang-validate validate script.lace \
    --vars-list vars.json \
    --context context.json

# With an extension's field/function registrations active
lacelang-validate validate script.lace \
    --enable-extension laceNotifications

# Pretty-print any subcommand
lacelang-validate parse script.lace --pretty

Exit code is always 0 on successful processing. Parse and validation errors are reported in the JSON body. Non-zero exit codes are reserved for tool failures (unreadable source file, malformed arguments).

Library usage

from lacelang_validator.parser import parse
from lacelang_validator.validator import validate

ast = parse(open("script.lace").read())
diagnostics = validate(
    ast,
    variables=["url"],
    context={"maxRedirects": 10, "maxTimeoutMs": 300_000},
)
for err in diagnostics.errors:
    print(err.code, err.call_index, err.field)

License

Apache License 2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lacelang_validator-0.2.0.tar.gz (28.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lacelang_validator-0.2.0-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file lacelang_validator-0.2.0.tar.gz.

File metadata

  • Download URL: lacelang_validator-0.2.0.tar.gz
  • Upload date:
  • Size: 28.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for lacelang_validator-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bd3c0505b404541f8f55995e462a8a248c4c6251ac6aaa773bbc1d41a43ef07d
MD5 70f6d99d45c4588e0b4a3bb3552c4551
BLAKE2b-256 48a684d5e811cb8eac094f79f37ca4da47ef0c3ec7860e298565aeca80a9af58

See more details on using hashes here.

Provenance

The following attestation bundles were made for lacelang_validator-0.2.0.tar.gz:

Publisher: release.yml on tracedown/lacelang-python-validator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lacelang_validator-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for lacelang_validator-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ce3cb9da444cddad5798e1fae25c52999efe6250bef5956ce9ea5c02f0650f9
MD5 291e51e1a29c6dd3554ebc3dd430e48b
BLAKE2b-256 d6958427d3afca115d1ce91d48be4807fb2e364e05c48c9a547248aabc57f4ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for lacelang_validator-0.2.0-py3-none-any.whl:

Publisher: release.yml on tracedown/lacelang-python-validator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

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