Skip to main content

Python bindings for the TeXForm LaTeX parser

Project description

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")
result = engine.normalize(r"a \over b")
assert result["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

  • 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).
  • 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 GitHub repository.

License

Apache-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

texform-0.2.0.tar.gz (374.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

texform-0.2.0-cp310-abi3-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.10+Windows x86-64

texform-0.2.0-cp310-abi3-musllinux_1_2_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

texform-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

texform-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

texform-0.2.0-cp310-abi3-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

texform-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file texform-0.2.0.tar.gz.

File metadata

  • Download URL: texform-0.2.0.tar.gz
  • Upload date:
  • Size: 374.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for texform-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f0127970f5598d09a5b6fb6bd1d917d0d313c361d8d4036fedd815ebe3902a0e
MD5 9db5da2693bfb53d3261f4f623afbae8
BLAKE2b-256 6522e0d81c917d53b19c4db308376636014071ccbec78cb867ab2d20aa64bfba

See more details on using hashes here.

Provenance

The following attestation bundles were made for texform-0.2.0.tar.gz:

Publisher: release.yml on texform-dev/texform

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file texform-0.2.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: texform-0.2.0-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for texform-0.2.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 12580fb6e75fe11287c760d6fe24a39b468eae4e86491de9a7fd0c4b9c497e72
MD5 a364d6542eb48bc10125275553d4d681
BLAKE2b-256 a1aebfd0da1d1d999f4c95d0c254f98f50a06892f0b2413b82dd81a66a2b57c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for texform-0.2.0-cp310-abi3-win_amd64.whl:

Publisher: release.yml on texform-dev/texform

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file texform-0.2.0-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for texform-0.2.0-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 d3bc727e8560d5923b5121bb956ecb4edbac951ee0b3d49f8d7671a24b86d066
MD5 31a7a82b0171f255399d882d6147a989
BLAKE2b-256 e70220feb6be015d4fe8cbb97980711525cbb1386cf3c8182ad8015e102adc9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for texform-0.2.0-cp310-abi3-musllinux_1_2_x86_64.whl:

Publisher: release.yml on texform-dev/texform

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file texform-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for texform-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 73af30a3cc0e72e65954944778c5506f6e5bfb5d99ae182d3d1b68c2c5fe568c
MD5 d13fefd4038891a05cb816249004a7dd
BLAKE2b-256 8101beea38235231b665db5e1ab234f3ef6d8dff391b47378dd29fd9626a44f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for texform-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on texform-dev/texform

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file texform-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for texform-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6c0389678e0ecdea36548d8aa4db134e344dde98d8c805bc00772e743bc126d9
MD5 565aed3ded167eb26fadb6bf41d9f900
BLAKE2b-256 7feb567b5b2f19847da378fe86ac6e70f3af0d6d61e056a0de19a649ead6777d

See more details on using hashes here.

Provenance

The following attestation bundles were made for texform-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on texform-dev/texform

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file texform-0.2.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for texform-0.2.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 34e231a47e2faf0191165bd0812fb4dc591077f6e7b077c210c9e99bdf86a209
MD5 ca9ae869082211304ef4d5826ca451ed
BLAKE2b-256 12a78ca654a05923f37d96489c0b8e304e90e90f9329d00581946fdcb6c0701c

See more details on using hashes here.

Provenance

The following attestation bundles were made for texform-0.2.0-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on texform-dev/texform

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file texform-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for texform-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9dd1c09ec0cb56a8198267e8913b59934847ce25e1d679f05801088985c574e2
MD5 c47b96a6128e8ee78644512dca31a7f9
BLAKE2b-256 172d4f99abb6caf8b1d101449db7e994bedb7824740f4eeb0f0780830da2b502

See more details on using hashes here.

Provenance

The following attestation bundles were made for texform-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on texform-dev/texform

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page