texform
Python bindings for TeXForm, a LaTeX formula parser, editor, and normalizer built on a structured command knowledge base.
pip install texform
Quick start
import texform
# Normalize a formula into a canonical form chosen by profile.
engine = texform.TransformEngine(profile="corpus")
normalized = engine.normalize(r"a \over b")
assert normalized == r"\frac { a } { b }"
# Parse through the engine, transform the live document in place, then serialize.
parsed = engine.parse(r"a \over b")
if parsed["document"] is not None:
document = parsed["document"]
engine.transform(document)
assert document.to_latex() == r"\frac { a } { b }"
Profiles select the normalization target: "authoring", "faithful", "corpus", and "equiv".
Python-specific notes
normalizereturnsstr.transformupdates the document and returnsNone.normalize_with_reportreturns{"normalized", "report"}.transform_with_reportreturns the report dict. Both use the same config object and keyword overlays as the plain methods. Output text and errors follow the ordinary transform contract. Report fields, phase divisions, and counters are diagnostic and are not a stable compatibility promise.Parser.parsereturns a dict with adocumentvalue (orNone) plus adiagnosticslist — the same three-state contract as the Rust API.- All names follow Python conventions: methods and dict keys are snake_case (
to_latex,validate_argspecreturnsarg_count). configis a complete configuration class (ParseConfig/TransformConfig). Other keyword arguments are overlays (normalize(src, rewrite={"enabled": False})). Saved dicts expand with**saved_overrides. Nested override values must be dicts, not config class instances.parser.default_parse_config(),engine.default_parse_config(), andengine.default_transform_config()return the complete defaults actually in force. Nested assignment sticks:cfg = engine.default_transform_config(); cfg.rewrite.enabled = False.- Serialize options are keywords too:
document.to_latex(script_order="sup_first"). - Unknown keys, wrong types, and arrays where an object is expected raise
ConfigErrorwith a field path.None/ omitted means not set. - Parse and edit errors raise structured exceptions (
texform.ParseErrorand friends); no Rust panic ever crosses the boundary. - The package ships
py.typedand.pyistubs, so type checkers and IDE completion work out of the box. - Wheels are abi3 and require Python 3.10 or newer.
Learn more
The Python API mirrors the Rust facade one-to-one. For the full picture — the editable document tree, transform profiles, and the architecture — see the repository README.
License
Apache-2.0.
Release files for texform 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| texform-0.6.0.tar.gz | 460.3 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| texform-0.6.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details |
| texform-0.6.0-cp310-abi3-musllinux_1_2_x86_64.whl | CPython 3.10 | abi3 | Linux musl 1.2+ x86-64 | Details |
| texform-0.6.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| texform-0.6.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| texform-0.6.0-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details |
| texform-0.6.0-cp310-abi3-macosx_10_12_x86_64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 9.3 MB
Release files / texform-0.6.0.tar.gz
| Download URL | texform-0.6.0.tar.gz |
|---|---|
| Size | 460.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3018dd9f7e93e56b27c2da0b1328e60666e8ea36f4e98b696ab020d42c080014
|
|
BLAKE2b-256 checksum How to use checksums |
a41ec5483e77124dddffaa00c8281741933f600389ab30d850f79fba08932376
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency logRelease files / texform-0.6.0-cp310-abi3-win_amd64.whl
| Download URL | texform-0.6.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
6d57888d23607eb431e678456f8d37a1f3c39a05cc6aa27986569d03b62e6039
|
|
BLAKE2b-256 checksum How to use checksums |
f10abb8f6532c05c6b8d1867cceae8cc61252a293b4feb0ec80cb1c917a7665b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency logRelease files / texform-0.6.0-cp310-abi3-musllinux_1_2_x86_64.whl
| Download URL | texform-0.6.0-cp310-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
44e199884192b77515da531c8d91a488d1780e7c73ef369e87aebc6bb1b289c9
|
|
BLAKE2b-256 checksum How to use checksums |
48a83fed9086c763d8792c5650df78654743f31b66501f0cbd1479530987baa8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency logRelease files / texform-0.6.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | texform-0.6.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
b97fc093ab200e3a35edfed90779fdc471fa47315840f395e9296aad73eb292f
|
|
BLAKE2b-256 checksum How to use checksums |
f461aff6587f070f2db3a8835f2dcd4ba152faa0693c88f46f37fb2d4e6ed1ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency logRelease files / texform-0.6.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | texform-0.6.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
19c696dd5a060b24e9e66307f4e9af18e5a34b9c91b892a9dd1a3ab2a3cb15af
|
|
BLAKE2b-256 checksum How to use checksums |
49d92bd2c6923783333bc03e0ed9f6fcf3d2c7d022e3487f022577510cfcc166
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency logRelease files / texform-0.6.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | texform-0.6.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
53ad75e0fc5a03303c0c4e50c6d497fe45a687d33cae0c51e8bbb5a890b77070
|
|
BLAKE2b-256 checksum How to use checksums |
f3ee892458262737d622e271f6fe4ababd812c43b29ed7cba53040f8f46726bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency logRelease files / texform-0.6.0-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | texform-0.6.0-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
91eee5717b19f04b4c3e03939b4450343fe5d03d3ed54a31a8a9cdccec408d65
|
|
BLAKE2b-256 checksum How to use checksums |
611554903059632af21fc2798b688dbc3cfd0006b7410e99dde67562edf2c45d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency log