texform
The LaTeX math toolkit
Python bindings for TeXForm, which parses, edits, and normalizes LaTeX math using a knowledge base of command and environment specifications.
Website · Documentation · Python API reference · Playground · Changelog
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". See Transforms for what each profile changes.
Command line
The package also installs the texform command-line tool, which is also available as python -m texform. To run it without installing, use uvx texform:
$ uvx texform normalize --profile corpus 'a \over b'
\frac { a } { b }
See the command-line guide for all commands.
Python-specific notes
- The Python API mirrors the Rust facade one-to-one, with Python naming: methods and dict keys are snake_case (
to_latex,validate_argspecreturnsarg_count). Parser.parsereturns a dict with adocumentvalue (orNone) plus adiagnosticslist — the same three-state contract as the Rust API.normalizereturnsstr;transformupdates the document and returnsNone.configis a complete configuration class (ParseConfig/TransformConfig). Other keyword arguments are overlays (normalize(src, rewrite={"enabled": False})), and serialize options are keywords too (document.to_latex(style="compact")).- Pass the same
KnowledgeBaseto each parser, engine, or document that should interoperate; omitting it uses a process-wide default. - Parse, edit, and configuration errors raise structured exceptions (
texform.ParseError,texform.ConfigError, and 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
- Quick start — profiles, the document tree, and parse results in ten minutes
- Edit a document — construct, edit, and locate nodes in the document tree
- Analyze formula structure at scale — export documents as columnar tables for Arrow or DataFrames
- Normalize a corpus — run one engine over a dataset and aggregate statistics
- Python API reference — every class, method, and exception
License
Apache-2.0.
Metadata
Release files for texform 0.10.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| texform-0.10.1.tar.gz | 596.4 kB | With provenance | Details for texform-0.10.1.tar.gz |
Built distributions (wheels)
Total release size: 13.2 MB
Release files / texform-0.10.1.tar.gz
| Download URL | texform-0.10.1.tar.gz |
|---|---|
| Size | 596.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
74d13231a3ab5d1467bd112979fad71ebcb6c8769e9593334d01212e983774e9
|
|
BLAKE2b-256 checksum How to use checksums |
12eff4fa93d8e9fc42a1319110378f340b66bdd923d4fcef31e170720f252f41
|
| 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 Oct 28, 2026.
Transparency logRelease files / texform-0.10.1-cp310-abi3-win_amd64.whl
| Download URL | texform-0.10.1-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
40c19ac6b5c026e32bb4300ac497fe4bd85109c30509ee5ac2977a7b8199bfbb
|
|
BLAKE2b-256 checksum How to use checksums |
d8822595d73f20d71c7d108ca205927a84c87665d95329ab9bbdea769dba0356
|
| 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 Oct 28, 2026.
Transparency logRelease files / texform-0.10.1-cp310-abi3-musllinux_1_2_x86_64.whl
| Download URL | texform-0.10.1-cp310-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
e9284e9694ec50f9ede95f72db502bcb804bcbe9d0bbcf907cf39023d67bdcd7
|
|
BLAKE2b-256 checksum How to use checksums |
d358cdf738ec452117a94b301cd1c6cb4a2a03a624f5ca5d761ef483d1b77530
|
| 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 Oct 28, 2026.
Transparency logRelease files / texform-0.10.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | texform-0.10.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
fb0f18b0b660e58c30ed3657f52b73202aaa970d5b9f6bb0ec10cd09214dd499
|
|
BLAKE2b-256 checksum How to use checksums |
b8e3e445f418de37b3fbdfc7af64c294ad2f3c8b18acce10b2c79a89d9c53e8a
|
| 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 Oct 28, 2026.
Transparency logRelease files / texform-0.10.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | texform-0.10.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 2.2 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
da0bd21b11b28d1b5be3ed7b7f4f7097d2599b43103ed07b26906c3a573c7223
|
|
BLAKE2b-256 checksum How to use checksums |
9e6be05755bdcb6c965c153c69000b24f50702a1c9d65c2947e82aa38cabb1ab
|
| 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 Oct 28, 2026.
Transparency logRelease files / texform-0.10.1-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | texform-0.10.1-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
e71165487f009c73b621463cd4931bd1987f68d5740721887a9d60caa78dd4e6
|
|
BLAKE2b-256 checksum How to use checksums |
b6b612c8f1f6eb5dd076d3d26793f8365974c697e874da60705922dd9c99ba66
|
| 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 Oct 28, 2026.
Transparency logRelease files / texform-0.10.1-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | texform-0.10.1-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
b289c4b3400d270f11544af38cb83c39d01170d3413c35e74dfeccbd6ae09591
|
|
BLAKE2b-256 checksum How to use checksums |
c2f376ac61ed0d7a881e2f0e701ef935dbdb27ce8f2a8094bdbe1374f5034221
|
| 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 Oct 28, 2026.
Transparency logSecurity for texform 0.10.1
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.
Full provenance
All 7 files in this release have been uploaded with provenance metadata.
Attestation for texform-0.10.1.tar.gz
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 Oct 28, 2026.
Transparency logA 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.