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.11.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.11.0
File Size Uploaded Provenance Actions
texform-0.11.0.tar.gz 634.5 kB With provenance Details for texform-0.11.0.tar.gz

Built distributions (wheels)

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

Total release size: 11.2 MB

Release files / texform-0.11.0.tar.gz

Download URL texform-0.11.0.tar.gz
Size 634.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ecc45d88323a2ff421333967d7d0e692bfd68c9431e3d742040a902fd4a86ecc
BLAKE2b-256 checksum
How to use checksums
73067150a605668832cca96a023a5a17e89b27e299279ee5b1802c229eab2c3f
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 23, 2026.

Transparency log

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

Download URL texform-0.11.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
96d259c3ddabaf0dff7e544e07ca314081d5b5d68f8abeeddc7cd3a8f7225610
BLAKE2b-256 checksum
How to use checksums
e011ab9ed91418eb96cb473fc0f7a0908dfe07ec215d5f41ba3002ae0fc8e629
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 23, 2026.

Transparency log

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

Download URL texform-0.11.0-cp310-abi3-musllinux_1_2_x86_64.whl
Size 2.1 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
c28cb3dae37d3c5df8c9d9a37c23716299d09a2c53a2a27efa37ea408e76c998
BLAKE2b-256 checksum
How to use checksums
286558a402ae9170f607109fd7eb97a2d3f206de4999fa1d21fb5ba6acbc53f2
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 23, 2026.

Transparency log

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

Download URL texform-0.11.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.8 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
1ee2d382c176e48a05a82676a660eac67344634e2c72be263752269d29190233
BLAKE2b-256 checksum
How to use checksums
60949b68fa3f916611edce0f8603ca15d2c8c98561b2c21aa591119e3315f8db
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 23, 2026.

Transparency log

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

Download URL texform-0.11.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
dc9d02c4940ab3089f0b1800947ffbdfe2bd27443d9cd6e2e7d8be31da25c7de
BLAKE2b-256 checksum
How to use checksums
d79599552ab75b7cb8bcf84226acc1138fc17801ae91a4e572034825c62f0520
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 23, 2026.

Transparency log

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

Download URL texform-0.11.0-cp310-abi3-macosx_11_0_arm64.whl
Size 1.6 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c4f28aa89a466535b38de39b0b16d375a37a52cbcf73d92bbdf7c6f065b3817b
BLAKE2b-256 checksum
How to use checksums
658a6343e55e111a1845b09e2b9db4926de85be49301d40c8e9b0d2f46156e0d
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 23, 2026.

Transparency log

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

Download URL texform-0.11.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 1.7 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
4e44a173236d12afbfd3d51e78e31f7f361ceb3c9bcf19522b2415ec48f9d4b1
BLAKE2b-256 checksum
How to use checksums
8a27f842fe21f2a2d24fdc7679deaa8afef3323f375cc85037a692eb793da19f
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 23, 2026.

Transparency log

Security for texform 0.11.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.11.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 23, 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