{"id":27223,"library":"pansi","title":"Pansi","description":"Text mode rendering library for Python, version 2024.11.0, released monthly. Provides styled console output with support for colors, attributes, and basic terminal control.","status":"active","version":"2024.11.0","language":"python","source_language":"en","source_url":"https://github.com/technige/pansi","tags":["terminal","console","colors","text-mode","styling"],"install":[{"cmd":"pip install pansi","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Python 2/3 compatibility (legacy dependency; may be dropped in future)","package":"six","optional":true}],"imports":[{"note":"Console is a top-level export in the package's __init__.py","wrong":"from pansi.console import Console","symbol":"Console","correct":"from pansi import Console"},{"note":"Style is re-exported from the top-level module","wrong":"import pansi.style","symbol":"Style","correct":"from pansi import Style"},{"note":"Color is also re-exported at the top level","wrong":"import pansi.color","symbol":"Color","correct":"from pansi import Color"},{"note":"watch is exposed as a top-level function","wrong":"from pansi.utils import watch","symbol":"watch","correct":"from pansi import watch"}],"quickstart":{"code":"from pansi import Console, Color, Style\n\n# Create a Console that writes to stdout (default)\nc = Console()\n\n# Write styled text\nc.writeln('Hello, World!', Color.GREEN)\nc.writeln('Bold and red', Style.BRIGHT, Color.RED)","lang":"python","description":"Create a Console instance and use writeln to output styled text with colors and styles."},"warnings":[{"fix":"Update imports to use the new package structure: 'from pansi import Console' instead of 'from pansi import pansi'.","message":"Import paths changed between v2020.7.0 and v2020.7.1. Prior to v2020.7.1, pansi was a single module; afterward it became a package. Old imports like 'from pansi import pansi' will break.","severity":"gotcha","affected_versions":"<2020.7.1"},{"fix":"Do not rely on six being available as a transitive dependency; install six explicitly if needed.","message":"The 'six' dependency is likely to be removed in a future major release, breaking code that relies on implicit six imports.","severity":"deprecated","affected_versions":">=2020.7.2"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from pansi import Console'.","cause":"Incorrect import path for Console class. Console is exported from the top-level pansi module, not from pansi.console.","error":"ImportError: cannot import name 'Console' from 'pansi.console'"},{"fix":"Ensure you have version 2020.7.1 or later and use the correct import: 'from pansi import Style'.","cause":"Old code using the import style 'import pansi; pansi.Style' may fail if the package was not correctly installed or if using a very old version (pre-2020.7.1).","error":"AttributeError: module 'pansi' has no attribute 'Style'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}