ansi2html
Convert text with ANSI color codes to HTML or to LaTeX.
Inspired by and developed off of the work of pixelbeat and blackjack.
Read the docs for more informations.
Example - Python API
from ansi2html import Ansi2HTMLConverter
conv = Ansi2HTMLConverter()
ansi = "".join(sys.stdin.readlines())
html = conv.convert(ansi)
Example - Shell Usage
$ ls --color=always | ansi2html > directories.html
$ sudo tail /var/log/messages | ccze -A | ansi2html > logs.html
$ task rc._forcecolor:yes limit:0 burndown | ansi2html > burndown.html
See the list of full options with:
$ ansi2html --help
Get this project:
$ pip3 install ansi2html
Source: https://github.com/pycontribs/ansi2html/
pypi: https://pypi.org/project/ansi2html/
License
ansi2html is licensed LGPLv3+.
Credits
- Author: Ralph Bean
- Contributor: Robin Schneider
- Contributor: Sebastian Pipping
- Contributor: Jens Timmerman
- Contributor: Sorin Sbarnea
- Contributor: Daniel Ziegenberg
- Contributor: Kuno Woudt
- Contributor: Robin Schneider
- Contributor: Martin Zimmermann
- Contributor: Paul Sherratt
- Contributor: Arusekk
Metadata
Release files for ansi2html 1.9.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ansi2html-1.9.5.tar.gz | 45.2 kB | With provenance | Details for ansi2html-1.9.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ansi2html-1.9.5-py3-none-any.whl | Python 3 | none | any | Details for ansi2html-1.9.5-py3-none-any.whl |
Total release size: 63.1 kB
Release files / ansi2html-1.9.5.tar.gz
| Download URL | ansi2html-1.9.5.tar.gz |
|---|---|
| Size | 45.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ae17e92f1d6cac0e67d367e07fb0ba8a23dac8f193fc5d7a8c8a50fe5ddd95a4
|
|
BLAKE2b-256 checksum How to use checksums |
c249682b08f7d8247d18aaafaedaf50609de6d91d5ab378c912b5508392578a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 6, 2026.
Transparency logRelease files / ansi2html-1.9.5-py3-none-any.whl
| Download URL | ansi2html-1.9.5-py3-none-any.whl |
|---|---|
| Size | 17.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fff3d25b149951474a688c7e22240f93e69ac5aa023c44ab5dce806befcba281
|
|
BLAKE2b-256 checksum How to use checksums |
c2d4104cba52b1aa94d1c60ae342c264d4308af59d3d8832b4975802e9fe8978
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 6, 2026.
Transparency logSecurity for ansi2html 1.9.5
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 2 files in this release have been uploaded with provenance metadata.
Attestation for ansi2html-1.9.5.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 Sep 6, 2026.
Transparency logA 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.