Skip to main content

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

  • normalize returns str. transform updates the document and returns None.
  • normalize_with_report returns {"normalized", "report"}. transform_with_report returns 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.parse returns a dict with a document value (or None) plus a diagnostics list — the same three-state contract as the Rust API.
  • All names follow Python conventions: methods and dict keys are snake_case (to_latex, validate_argspec returns arg_count).
  • config is 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(), and engine.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 ConfigError with a field path. None / omitted means not set.
  • Parse and edit errors raise structured exceptions (texform.ParseError and friends); no Rust panic ever crosses the boundary.
  • The package ships py.typed and .pyi stubs, 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.5.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 texform 0.5.0
File Size Uploaded
texform-0.5.0.tar.gz 444.4 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for texform 0.5.0
File
texform-0.5.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
texform-0.5.0-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details
texform-0.5.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.5.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
texform-0.5.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
texform-0.5.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.5.0.tar.gz

Download URL texform-0.5.0.tar.gz
Size 444.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ac1262514b84fe052dcf0c94a30210d27e4235162bca4ce5ffe30a560519f1f2
BLAKE2b-256 checksum
How to use checksums
2bdd83128572a6b3c1d9c2daeee70fb545c0eb782e84c2f05d48188cae2b93d6
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 23, 2026.

Transparency log

Release files / texform-0.5.0-cp310-abi3-win_amd64.whl

Download URL texform-0.5.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
6a552e82cde82c2f367ddcfc759952e7780bb7bd692ae6c88a06c0050a507219
BLAKE2b-256 checksum
How to use checksums
6f3ec20257c7a2e5000b891da43f885d373fd21e9f0cc25b0a5d6e8ae6141fcb
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 23, 2026.

Transparency log

Release files / texform-0.5.0-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL texform-0.5.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
a31b73204d4f51b229abb046ba379a9114011becc237f0bd6aea764502566c37
BLAKE2b-256 checksum
How to use checksums
68400cd587c5cfe389c0bf732d795a5dea7380b5ebafc3a4507ad2318147b9aa
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 23, 2026.

Transparency log

Release files / texform-0.5.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL texform-0.5.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
19d4bb9203faf2d9d3f7fa1a9ca8282e4849036fd9bf3a2f5da91271d1c4e955
BLAKE2b-256 checksum
How to use checksums
638d652e9de5e1daa98b5f37015d125fd423da37eb0bf6c4f772408f29bd0e2d
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 23, 2026.

Transparency log

Release files / texform-0.5.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL texform-0.5.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
5346d8c2473c0653c5901b7ad53b1b67fb8873ecd7babd736988470ba42ec796
BLAKE2b-256 checksum
How to use checksums
c20cbb9ca22b20aa3de1a8aa208b818c9fc69dac3d219e9187ca5e69b8ad7cd2
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 23, 2026.

Transparency log

Release files / texform-0.5.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL texform-0.5.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
850aa1963d8767529c39e7f04c25abdf1fb42b6998c84d58aa72cd4ba1bf5262
BLAKE2b-256 checksum
How to use checksums
0bd7f6aab8d0f674d9c145ec9e91056431f5618295929c1ecc70c030e9e5e24f
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 23, 2026.

Transparency log

Release files / texform-0.5.0-cp310-abi3-macosx_10_12_x86_64.whl

Download URL texform-0.5.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
fce5a7671e9388d96a87aba089d2b57053582fe447b878fccecfd0db016913c1
BLAKE2b-256 checksum
How to use checksums
08d83070d5e47c9fdfa2ff9f8cd348bbda397d3b7d1014a93b64dc103de55c17
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 23, 2026.

Transparency log

Release history Release notifications | RSS feed

0.6.0

7 release files

This release

0.5.0 This release

7 release files

0.4.0

7 release files

0.3.0

7 release files

0.2.1

7 release files

0.2.0

7 release files

0.1.0

6 release 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