euporie.core.convert.formats.ansi

Contain functions which convert data to formatted ansi text.

Functions

call_subproc(data, cmd[, use_tempfile, suffix])

Call the command as a subprocess and return it's output as bytes.

ceil(x, /)

Return the ceiling of x as an Integral.

chafa_convert_cmd(output_format, data[, ...])

Convert image data to ANSI text using chafa.

chafa_convert_py(output_format, data[, ...])

Convert image data to ANSI text using ::chafa.py.

commands_exist(*cmds)

Verify a list of external commands exist on the system.

get_app()

Get the current active (running) Application.

have_modules(*modules)

Verify a list of python modules are importable.

html_to_ansi_elinks(data[, width, height, ...])

Convert HTML text to formatted ANSI using elinks.

html_to_ansi_links(data[, width, height, ...])

Convert HTML text to formatted ANSI using links.

html_to_ansi_lynx(data[, width, height, fg, ...])

Convert HTML text to formatted ANSI using lynx.

html_to_ansi_py_htmlparser(data[, width, ...])

Convert HTML tables to ANSI text using HTMLParser.

html_to_ansi_w3m(data[, width, height, fg, ...])

Convert HTML text to formatted ANSI using w3m.

image_to_ansi_catimg(data[, cols, rows, fg, ...])

Convert image data to ANSI text using catimg.

image_to_ansi_icat(data[, cols, rows, fg, ...])

Convert image data to ANSI text using icat.

image_to_ansi_jp2a(data[, cols, rows, fg, ...])

Convert image data to ANSI text using jp2a.

image_to_ansi_timg(data[, cols, rows, fg, ...])

Convert image data to ANSI text using timg.

image_to_ansi_tiv(data[, cols, rows, fg, ...])

Convert image data to ANSI text using tiv.

image_to_ansi_viu(data[, cols, rows, fg, ...])

Convert image data to ANSI text using viu.

latex_to_ansi_py_flatlatex(data[, width, ...])

Convert LaTeX to ANSI using flatlatex.

latex_to_ansi_py_pylatexenc(data[, width, ...])

Convert LaTeX to ANSI using pylatexenc.

latex_to_ansi_py_sympy(data[, width, ...])

Convert LaTeX to ANSI using sympy.

pil_to_ansi_py_img2unicode(data[, cols, ...])

Convert a PIL image to ANSI text using img2unicode.

pil_to_ansi_py_timg(data[, cols, rows, fg, ...])

Convert a PIL image to ANSI text using timg.

png_to_ansi_img2txt(data[, cols, rows, fg, ...])

Convert PNG data to ANSI text using img2txt.

png_to_ansi_py_placeholder(data[, cols, ...])

Draw placeholder ANSI text.

register(from_, to[, filter_, weight])

Add a converter to the centralized format conversion system.

rich_to_ansi_py(data[, width, height, fg, ...])

Convert rich objects to formatted ANSI text.

set_background(image[, bg_color])

Remove the alpha channel from an image and set the background colour.

Classes

partial

partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.

Convert HTML text to formatted ANSI using elinks.

Convert HTML text to formatted ANSI using links.

async euporie.core.convert.formats.ansi.html_to_ansi_lynx(data: str, width: int | None = None, height: int | None = None, fg: str | None = None, bg: str | None = None, path: Path | None = None, initial_format: str = '') str

Convert HTML text to formatted ANSI using lynx.

async euporie.core.convert.formats.ansi.html_to_ansi_py_htmlparser(data: str, width: int | None = None, height: int | None = None, fg: str | None = None, bg: str | None = None, path: Path | None = None, initial_format: str = '') str

Convert HTML tables to ANSI text using HTMLParser.

async euporie.core.convert.formats.ansi.html_to_ansi_w3m(data: str, width: int | None = None, height: int | None = None, fg: str | None = None, bg: str | None = None, path: Path | None = None, initial_format: str = '') str

Convert HTML text to formatted ANSI using w3m.

async euporie.core.convert.formats.ansi.image_to_ansi_catimg(data: bytes, cols: int | None = None, rows: int | None = None, fg: str | None = None, bg: str | None = None, path: Path | None = None, initial_format: str = '') str

Convert image data to ANSI text using catimg.

async euporie.core.convert.formats.ansi.image_to_ansi_icat(data: bytes, cols: int | None = None, rows: int | None = None, fg: str | None = None, bg: str | None = None, path: Path | None = None, initial_format: str = '') str

Convert image data to ANSI text using icat.

async euporie.core.convert.formats.ansi.image_to_ansi_jp2a(data: bytes, cols: int | None = None, rows: int | None = None, fg: str | None = None, bg: str | None = None, path: Path | None = None, initial_format: str = '') str

Convert image data to ANSI text using jp2a.

async euporie.core.convert.formats.ansi.image_to_ansi_timg(data: bytes, cols: int | None = None, rows: int | None = None, fg: str | None = None, bg: str | None = None, path: Path | None = None, initial_format: str = '') str

Convert image data to ANSI text using timg.

async euporie.core.convert.formats.ansi.image_to_ansi_tiv(data: bytes, cols: int | None = None, rows: int | None = None, fg: str | None = None, bg: str | None = None, path: Path | None = None, initial_format: str = '') str

Convert image data to ANSI text using tiv.

async euporie.core.convert.formats.ansi.image_to_ansi_viu(data: bytes, cols: int | None = None, rows: int | None = None, fg: str | None = None, bg: str | None = None, path: Path | None = None, initial_format: str = '') str

Convert image data to ANSI text using viu.

async euporie.core.convert.formats.ansi.latex_to_ansi_py_flatlatex(data: str, width: int | None = None, height: int | None = None, fg: str | None = None, bg: str | None = None, path: Path | None = None, initial_format: str = '') str

Convert LaTeX to ANSI using flatlatex.

async euporie.core.convert.formats.ansi.latex_to_ansi_py_pylatexenc(data: str, width: int | None = None, height: int | None = None, fg: str | None = None, bg: str | None = None, path: Path | None = None, initial_format: str = '') str

Convert LaTeX to ANSI using pylatexenc.

async euporie.core.convert.formats.ansi.latex_to_ansi_py_sympy(data: str, width: int | None = None, height: int | None = None, fg: str | None = None, bg: str | None = None, path: Path | None = None, initial_format: str = '') str

Convert LaTeX to ANSI using sympy.

async euporie.core.convert.formats.ansi.pil_to_ansi_py_img2unicode(data: PilImage, cols: int | None = None, rows: int | None = None, fg: str | None = None, bg: str | None = None, path: Path | None = None, initial_format: str = '') str

Convert a PIL image to ANSI text using img2unicode.

async euporie.core.convert.formats.ansi.pil_to_ansi_py_timg(data: PilImage, cols: int | None = None, rows: int | None = None, fg: str | None = None, bg: str | None = None, path: Path | None = None, initial_format: str = '') str

Convert a PIL image to ANSI text using timg.

async euporie.core.convert.formats.ansi.png_to_ansi_img2txt(data: bytes, cols: int | None = None, rows: int | None = None, fg: str | None = None, bg: str | None = None, path: Path | None = None, initial_format: str = '') str

Convert PNG data to ANSI text using img2txt.

async euporie.core.convert.formats.ansi.png_to_ansi_py_placeholder(data: bytes, cols: int | None = None, rows: int | None = None, fg: str | None = None, bg: str | None = None, path: Path | None = None, initial_format: str = '') str

Draw placeholder ANSI text.

async euporie.core.convert.formats.ansi.rich_to_ansi_py(data: RenderableType, width: int | None = None, height: int | None = None, fg: str | None = None, bg: str | None = None, path: Path | None = None, initial_format: str = '') str

Convert rich objects to formatted ANSI text.