latexcodec
A lexer and codec to work with LaTeX code in Python.
Decision gist · record as of 2026-08-14
Yes, if you need to convert between LaTeX and Unicode for short text fragments in academic or bibliography workflows. The package is stable, has no dependencies, and carries a permissive license. The aging maintenance status (423 days since last release) is not a blocker for stable use, but be aware that new LaTeX commands will not be added without community contribution.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low install friction with no runtime dependencies.
- Maintenance is aging—last release was 423 days ago—but the package remains in production/stable status and the repository is not archived.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
last release 2025-06-17 (423 days) · last repo commit 2025-06-17 · 30 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,857,172 downloads/mo, #3,487 on PyPI
Alternatives
Verify before relying
import codecs
codecs.register(lambda name: __import__('latexcodec').LatexCodec())
latex_text = b'\\"u'
decoded = latex_text.decode('latex')
print(decoded)- Whether the package's stated recommendation to use an alternative reflects a known limitation or deprecation plan.
- Completeness of LaTeX command coverage and whether unrecognized commands degrade gracefully in real-world use.
What it is and what it does
latexcodec is a Python codec that translates between LaTeX markup and Unicode text. It works by registering a codec that lets you encode Unicode strings into LaTeX commands and decode LaTeX commands back into Unicode characters. The package is designed for short text fragments—like individual BibTeX fields or paragraphs—rather than full LaTeX documents, because it does not run a full LaTeX compiler and its handling of non-character-selecting commands (macros, formatting directives) is best-effort and may require manual adjustment.
The encoder converts Unicode characters outside the ASCII range into LaTeX equivalents (e.g., `ü` becomes `\"u`, `¥` becomes `\yen`), and the decoder reverses this process. The codec also normalizes whitespace and removes comments during decoding. LaTeX commands that the codec does not recognize are passed through unchanged, which can result in hybrid strings containing both literal Unicode and unexpanded LaTeX control sequences.
Use it for
- Normalize and convert author names or titles in BibTeX entries between LaTeX and Unicode representations.
- Decode LaTeX-encoded metadata fields in academic document processing pipelines.
- Encode Unicode text with accented characters into LaTeX for inclusion in .tex files.
- Clean and canonicalize LaTeX fragments in text mining or citation parsing workflows.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to convert between LaTeX and Unicode for short text fragments in academic or bibliography workflows.
The package is stable, has no dependencies, and carries a permissive license. The aging maintenance status (423 days since last release) is not a blocker for stable use, but be aware that new LaTeX commands will not be added without community contribution.
Install
latexcodec on PyPI
Before you install
Low install friction with no runtime dependencies. Maintenance is aging—last release was 423 days ago—but the package remains in production/stable status and the repository is not archived.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
import codecs
codecs.register(lambda name: __import__('latexcodec').LatexCodec())
latex_text = b'\\"u'
decoded = latex_text.decode('latex')
print(decoded)
Verify before relying
- Whether the package's stated recommendation to use an alternative reflects a known limitation or deprecation plan.
- Completeness of LaTeX command coverage and whether unrecognized commands degrade gracefully in real-world use.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Aging 423 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,857,172 / month, #3,487 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Text Processing :: FiltersTopic :: Text Processing :: Markup :: LaTeX |
Evidence: latexcodec-3.0.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “latex to unicode conversion”
- latexcodecProvides a Python codec to convert between LaTeX-encoded text and…
- pylatexencConverts between LaTeX code and Unicode text in both directions,…
- sphinx-jupyterbook-latexA Sphinx extension that adds LaTeX output infrastructure for Jupyter…
Give your agent the search over MCP, or paste the wish link into any chat.
More Markup packages
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
A Python markdown parser that converts markdown to HTML following the CommonMark specification, with support for plugins and custom syntax rules.
Install it if you need reliable markdown-to-HTML conversion.
Beautiful Soup parses HTML and XML documents into a navigable tree, providing Pythonic methods to search, iterate, and modify the parsed content.
Install it if you need to parse or extract data from markup documents.
et_xmlfile writes large XML files with minimal memory overhead by serializing elements to disk as they are created, rather than holding the entire tree in memory.
Install it if incremental XML writing fits your use case; skip it if your XML documents are small or you already use lxml.
Parses and edits TOML files while preserving formatting, comments, and structure, then serializes them back with layout intact.
Install it if you're building tools that touch TOML files and user readability of the source matters.
Parses Python docstrings in ReST, Google, Numpydoc, and Epydoc formats, extracting structured information like descriptions, parameters, return types, and exceptions.
Install it if you need to programmatically read and extract structured data from Python docstrings.
See also mbstrdecoder · pylatexenc · pybtex · rtfunicode · ftfy · anyascii · Unidecode · zalgolib · base2048 · morphys