{"id":4431,"library":"art","title":"ASCII Art Library For Python","description":"ART is a Python library for converting text to ASCII art and generating 1-line ASCII art. It's currently at version 6.5 and is actively maintained with frequent releases, adding new fonts and features, and dropping support for older Python versions.","status":"active","version":"6.5","language":"en","source_language":"en","source_url":"https://github.com/sepandhaghighi/art","tags":["ascii-art","text-art","cli-tools","typography","console-output","fun"],"install":[{"cmd":"pip install art","lang":"bash","label":"Install with pip"}],"dependencies":[],"imports":[{"note":"The primary functions like `text2art` are directly importable. While `from art import *` is often used in examples, explicit imports are generally recommended.","wrong":"import art; art.text2art()","symbol":"text2art","correct":"from art import text2art"},{"note":"The `art` function generates 1-line ASCII art and can be directly imported for clarity.","wrong":"import art; art.art()","symbol":"art","correct":"from art import art"}],"quickstart":{"code":"from art import text2art\nfrom art import art\n\n# Convert text to ASCII art\nascii_text = text2art(\"Hello, World!\", font=\"block\")\nprint(ascii_text)\n\n# Generate a 1-line ASCII art\none_line_art = art(\"coffee\")\nprint(one_line_art)\n\n# Example of using a non-default font for 1-line art (if supported)\n# try:\n#     fancy_art = art(\"random\", font=\"hideki\") # Note: 'random' often doesn't use font arg explicitly\n#     print(fancy_art)\n# except Exception as e:\n#     print(f\"Could not generate fancy art: {e}\")","lang":"python","description":"Demonstrates converting a string to multi-line ASCII art using a specified font and generating a random 1-line ASCII art."},"warnings":[{"fix":"Upgrade your Python interpreter to version 3.7 or higher.","message":"Python 3.6 support has been dropped as of version 6.5. Ensure your environment uses Python 3.7 or newer. Earlier versions (v6.0) dropped Python 2.7 and 3.4.","severity":"breaking","affected_versions":"6.5 and later"},{"fix":"Review release notes for v6.3 and update code paths or variable names if directly interacting with previously exposed internal modules or dictionaries.","message":"Version 6.3 introduced significant internal restructuring, renaming modules and core dictionaries. For example, `art_param` changed to `params`, the `art` module was split, and `text_dic1`, `art_dic`, `decor_dic` were renamed to `fonts1`, `arts`, and `decorations` respectively. Direct access to these internal structures will break.","severity":"breaking","affected_versions":"6.3 and later"},{"fix":"Test in your target environment. Consider using more universally supported fonts or simpler arts if broad compatibility is required. The library's output is string-based, so environment rendering is a factor.","message":"Some terminal environments or fonts may not fully support all 1-line ASCII arts or complex multi-line art characters, leading to display issues or missing characters.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Place multiline strings at the beginning of the line, or use `textwrap.dedent()` to programmatically remove unwanted whitespace.","message":"When incorporating multiline ASCII art directly into Python code as f-strings or triple-quoted strings, be mindful of indentation. Python's indentation rules can introduce unwanted leading spaces to each line of the ASCII art, misaligning it in the output.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always ensure function arguments match the expected data types (e.g., `art(\"coffee\")`, `art(\"woman\", number=2)`). Refer to the documentation for specific function signatures.","message":"The `art()` and `text2art()` functions are strict about parameter types. For instance, `artname` must be a `str` and `number` must be an `int`. Providing incorrect types will raise an `artError`.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}