Skip to main content

ANSI > UTF-8 Conversion

Project description

ANSI Art Converter

GitHub Actions Workflow Status PyPI - Version

A tool to convert original ANSI art files for viewing in a modern terminal.

[!IMPORTANT] This is not an AI-generated project! I wrote this as a labor of love. I test it extensively against original artwork.


Demos

I made some videos of demo conversions that are on youtube:

Installation

You can install the ansi-art-convert package via pip:

pip install ansi-art-convert

[!IMPORTANT] As a prerequisite, you will need to install the ANSI megafont on your system via your regular font installer, and ensure that your terminal emulator is configured to use it.

Alternatively, you can install it via a one-liner (you will still need to configure your terminal to use it):

install commands:
# osx
curl -sOL --output-dir ~/Library/Fonts/ https://github.com/tmck-code/ansi-megafont/releases/download/v0.1.1/ANSICombined.ttf \
  && fc-cache -f ~/Library/Fonts/ \
  && fc-list | grep "ANSICombined"

# linux
curl -sOL --output-dir ~/.fonts/ https://github.com/tmck-code/ansi-megafont/releases/download/v0.1.1/ANSICombined.ttf \
  && fc-cache -f ~/.fonts/ \
  && fc-list | grep "ANSICombined"

Usage

usage: ansi-art-convert [-h] --fpath FPATH [--encoding ENCODING] [--sauce-only] [--verbose] [--ice-colours] [--font-name FONT_NAME] [--width WIDTH]

options:
  -h, --help            show this help message and exit
  --fpath, -f FPATH     Path to the ANSI file to render.
  --encoding, -e ENCODING
                        Specify the file encoding (cp437, iso-8859-1, ascii, utf-8) if the auto-detection was incorrect.
  --sauce-only, -s      Only output the SAUCE record information as JSON and exit.
  --verbose, -v         Enable verbose debug output.
  --ice-colours         Force enabling ICE colours (non-blinking background).
  --font-name FONT_NAME
                        Specify the font name to determine glyph offset (overrides SAUCE font).
  --width, -w WIDTH     Specify the output width (overrides SAUCE tinfo1).

Documentation

Resources

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

ansi_art_convert-0.4.0.tar.gz (35.6 kB view details)

Uploaded Source

Built Distribution

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

ansi_art_convert-0.4.0-py3-none-any.whl (38.0 kB view details)

Uploaded Python 3

File details

Details for the file ansi_art_convert-0.4.0.tar.gz.

File metadata

  • Download URL: ansi_art_convert-0.4.0.tar.gz
  • Upload date:
  • Size: 35.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ansi_art_convert-0.4.0.tar.gz
Algorithm Hash digest
SHA256 0362cacdc2f1f636b086a89869b5c16f4bbea438e10f2372d06ca72c361649eb
MD5 456303ddcd447267fa32923e4674c4b1
BLAKE2b-256 0985dfba25c45367fd0e9c65b42015f8c5c93557d1f2ae542d36662aef3d4fc2

See more details on using hashes here.

File details

Details for the file ansi_art_convert-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: ansi_art_convert-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 38.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ansi_art_convert-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f99aec488506e52cd4213172c47c6a23ed8055104b1e79c3e29d9c714a99d4ed
MD5 e498012ac69302a08debbb064a2cd0e5
BLAKE2b-256 e280d226d4bbf9a5cef1ea45cd6ca69b87a4c0469c929157a57d8440b40b92b7

See more details on using hashes here.

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