Skip to main content

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_argspec returns arg_count).
  • Parser.parse returns a dict with a document value (or None) plus a diagnostics list — the same three-state contract as the Rust API.
  • normalize returns str; transform updates the document and returns None.
  • config is 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 KnowledgeBase to 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.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

License

Apache-2.0.

Metadata

Release files for texform 0.12.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.12.0
File Size Uploaded Provenance Actions
texform-0.12.0.tar.gz 704.4 kB With provenance Details for texform-0.12.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for texform 0.12.0
File Actions
texform-0.12.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for texform-0.12.0-cp310-abi3-win_amd64.whl
texform-0.12.0-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details for texform-0.12.0-cp310-abi3-musllinux_1_2_x86_64.whl
texform-0.12.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for texform-0.12.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
texform-0.12.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for texform-0.12.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
texform-0.12.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for texform-0.12.0-cp310-abi3-macosx_11_0_arm64.whl
texform-0.12.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for texform-0.12.0-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 11.7 MB

Release files / texform-0.12.0.tar.gz

Download URL texform-0.12.0.tar.gz
Size 704.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9cf390bd0dddddc588354bb1c20ccdebcfb57b08504cce7ec2115edcc139cb0c
BLAKE2b-256 checksum
How to use checksums
0cf547b06adfd423852aa6a1ffa99c26eb78fab1b09fba65f00c67ab1b8e57e2
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 Nov 29, 2026.

Transparency log

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

Download URL texform-0.12.0-cp310-abi3-win_amd64.whl
Size 1.5 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
a03b851b5920ee3257a17ebf7ab824bc38cca66e60969543901e08e8d460ebaa
BLAKE2b-256 checksum
How to use checksums
e3252065451aee40100add54d05ab871eb979fe3ccba846cac1750f44cf657ea
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 Nov 29, 2026.

Transparency log

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

Download URL texform-0.12.0-cp310-abi3-musllinux_1_2_x86_64.whl
Size 2.2 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
03060c6b92001592ddfcc596fa03f42922aa0a3fc164884eee2131b2d8ff2bcb
BLAKE2b-256 checksum
How to use checksums
1bafbe19a0a7f2097365b209a413ae65d09174ba3583f7da3af24281a8e6e6a8
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 Nov 29, 2026.

Transparency log

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

Download URL texform-0.12.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.9 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
f0f5a660d0ca71a1e72cd52f2a79a78d119460fd5007c87a1f0432a3d7e5d230
BLAKE2b-256 checksum
How to use checksums
32a920473ada17b6e417ce1cd350d38302727dfc980e61e26b269e806986a6a7
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 Nov 29, 2026.

Transparency log

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

Download URL texform-0.12.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 1.9 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
d5da0a6285469c9468e26cca9f9e3beaf9f721449b55055959656b66e3773fcd
BLAKE2b-256 checksum
How to use checksums
64b6e34c23076072f01c2b5afb1ae5a0dcd98a15adc7b03bb49f14937955a907
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 Nov 29, 2026.

Transparency log

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

Download URL texform-0.12.0-cp310-abi3-macosx_11_0_arm64.whl
Size 1.7 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e943e7b4f629fbad652b404d59d6839be980282dbbe77d1ee00c417a6e958388
BLAKE2b-256 checksum
How to use checksums
66633beea65d7d6a49307cf1aa5c24158ca3f65f84ce92d6d750189c061c33fe
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 Nov 29, 2026.

Transparency log

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

Download URL texform-0.12.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 1.8 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
449f428e805c5dfbf00aaf3223a98d2a39eeadd02d49bcd60a73505f48dbd6a6
BLAKE2b-256 checksum
How to use checksums
39086ba370a9f0163bdcf4a396ca55038618fbb92a3062e349679a9d759f2086
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 Nov 29, 2026.

Transparency log

Security for texform 0.12.0

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.

Select from 7 files

Attestation for texform-0.12.0.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 Nov 29, 2026.

Transparency log

A 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.

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