Skip to main content

circuitdk-lossless-sexpr

circuitdk-lossless-sexpr provides a small, lossless concrete syntax tree for S-expressions. Parsing and rendering an unchanged document preserves its source text byte for byte, including whitespace, comments, number formatting, and unknown syntax.

The distribution is maintained as part of CircuitDK, but the Python package can be used independently.

Installation

uv add circuitdk-lossless-sexpr

Usage

from lossless_sexpr import TextEdit, apply_edits, parse

source = '(property "Value" "10 k" (at 1 2))'
document = parse(source)

value = document.lists("property")[0].atom(2)
assert value is not None

updated = apply_edits(source, [TextEdit(value.span, '"47 k"')])
assert updated == '(property "Value" "47 k" (at 1 2))'

Overlapping edits are rejected, and parse errors include source locations. The library deliberately contains no KiCad or circuit-specific semantics.

Download files

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

Source Distribution

circuitdk_lossless_sexpr-0.1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

circuitdk_lossless_sexpr-0.1.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file circuitdk_lossless_sexpr-0.1.0.tar.gz.

File metadata

  • Download URL: circuitdk_lossless_sexpr-0.1.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for circuitdk_lossless_sexpr-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2179d77eb5f1fac223cb0ac072b41f69f1d083ee7586f835168f3e5804158987
MD5 9e69feb23627817497728a43c369e63a
BLAKE2b-256 56140104e3692005d39ec4791b9d6b22fea9b21e16d9c22e1dbe9ac2678cacae

See more details on using hashes here.

File details

Details for the file circuitdk_lossless_sexpr-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: circuitdk_lossless_sexpr-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for circuitdk_lossless_sexpr-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 14edd97c3422743fe00736d60d2addf4a650c786170e454887945f111bea4ef1
MD5 09f6acded8ea00170398477ed4ed2b73
BLAKE2b-256 0b6da84322d156d152b475a7c4c84bcb4e0d540f28e12a7438bc49a07b991036

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page