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.

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.10.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.10.0
File Size Uploaded Provenance Actions
texform-0.10.0.tar.gz 552.8 kB With provenance Details for texform-0.10.0.tar.gz

Built distributions (wheels)

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

Total release size: 10.3 MB

Release files / texform-0.10.0.tar.gz

Download URL texform-0.10.0.tar.gz
Size 552.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f58bf396e8c347f0b16447443a35668115969d93bce98a98ddc24871bd734c96
BLAKE2b-256 checksum
How to use checksums
5eb0df42bb2610ae64eb76aec6ffd26e7f23969376612e81dfd5d04d22dd0228
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 13, 2026.

Transparency log

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

Download URL texform-0.10.0-cp310-abi3-win_amd64.whl
Size 1.4 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
8869de3bff0acc24bfc5d7bcc7dffadd197cebeee661f011815cbc4f26b77df7
BLAKE2b-256 checksum
How to use checksums
b5b1c289ddff5d82837379584448dbe267862c80c0cb7d879f9c9c631ae42fc5
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 13, 2026.

Transparency log

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

Download URL texform-0.10.0-cp310-abi3-musllinux_1_2_x86_64.whl
Size 1.9 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
645967676903ca1968cea385fd87c0e6970cf30fda52676a5a0d959038fddf09
BLAKE2b-256 checksum
How to use checksums
8ad320b8d8584de208569ff03bbf1312b2caa37ef09ff4fd2a002a77f68f7226
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 13, 2026.

Transparency log

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

Download URL texform-0.10.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.7 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
481ed8f1c4c21e001737f7e584d25687c4fb616620ced8bdbb534afca3308c55
BLAKE2b-256 checksum
How to use checksums
4172f16eb2ed313e7a31601aa4c9303ea425e84220d4e7db4c93da4df43dffe9
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 13, 2026.

Transparency log

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

Download URL texform-0.10.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.7 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
006de5e237bb2a05ee503a3a19e5242b3c8e77394ffc6edd5d08a4c1df5359df
BLAKE2b-256 checksum
How to use checksums
abf3f5fdf8d3783e303c246b3b21ea5a40518b9c41796c2279dab174c09c6ff8
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 13, 2026.

Transparency log

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

Download URL texform-0.10.0-cp310-abi3-macosx_11_0_arm64.whl
Size 1.5 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
027504114bf00a9c98474c28d56dedc3b2712512c67463bd5695d38d3bc30bf4
BLAKE2b-256 checksum
How to use checksums
6da05a5dc37d17bbe4a86db3360fe684356eb67041e6a7803ea7e40f3aa4484a
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 13, 2026.

Transparency log

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

Download URL texform-0.10.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 1.6 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
f5c44c0f38bb83912368d4bb609711c1a2654d896ecbcba8702180bc4338811b
BLAKE2b-256 checksum
How to use checksums
7d83eab42bd8751bb6f5465b93db42cc99009fd04df446432e2d353de6e005d1
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 13, 2026.

Transparency log

Security for texform 0.10.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.10.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 Oct 13, 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