{"id":24408,"library":"pystyle","title":"PyStyle","description":"PyStyle is a Python library for styling terminal text with colors, gradients, patterns, and effects (e.g., bold, underline). It provides an intuitive API for cross-platform terminal ANSI color output, with support for custom color sequences and animations. The current version is 2.9, with sporadic releases.","status":"active","version":"2.9","language":"python","source_language":"en","source_url":"https://github.com/billythegoat356/pystyle","tags":["terminal","colors","ansi","gradient","effects","styling"],"install":[{"cmd":"pip install pystyle","lang":"bash","label":"pip"}],"dependencies":[],"imports":[{"note":"pystyle does not export all classes via top-level import; you must import them explicitly.","wrong":"import pystyle","symbol":"Center","correct":"from pystyle import Center, Anime, Colors, Colorate, System, Tools, Write"},{"note":"Colors is a class with static attributes (e.g., Colors.blue) not a module.","wrong":"from pystyle.Colors import *","symbol":"Colors","correct":"from pystyle import Colors"},{"note":"Write is a class with class methods, not a module.","wrong":"from pystyle.Write import ...","symbol":"Write","correct":"from pystyle import Write"}],"quickstart":{"code":"from pystyle import Colors, Write\nWrite.Print('Hello, PyStyle!', Colors.blue_to_cyan, interval=0.05)","lang":"python","description":"Prints a string with a blue-to-cyan gradient effect."},"warnings":[{"fix":"Use Write.Print('text', Colors.blue) or Write.Input('prompt', Colors.red_to_yellow)","message":"Calling Write.Print() without passing a color may raise an error or not style output. Always provide a color or gradient.","severity":"gotcha","affected_versions":"all"},{"fix":"Set terminal width explicitly or use a fallback: Center.XCenter(text) might not work as expected in non-terminal environments.","message":"The 'Center.XCenter' and similar methods rely on terminal width, which may be inaccurate in some IDEs or subprocesses, causing misalignment.","severity":"gotcha","affected_versions":"all"},{"fix":"Use os.system('cls' if os.name == 'nt' else 'clear') directly for clearing the console.","message":"The 'System' module functions like System.Clear() may be removed in future versions; they rely on OS-specific commands.","severity":"deprecated","affected_versions":">=2.6"},{"fix":"Check terminal color support or fall back to basic Colors.blue style.","message":"Gradient effects (e.g., Colors.blue_to_cyan) may not display correctly on terminals that do not support true color (16.7 million colors).","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install pystyle' in your terminal.","cause":"pystyle is not installed or the installation is incomplete.","error":"ModuleNotFoundError: No module named 'pystyle'"},{"fix":"Use 'from pystyle import Colors' instead of 'import pystyle' and then pystyle.Colors.","cause":"Importing pystyle as a module instead of specific submodules.","error":"AttributeError: module 'pystyle' has no attribute 'Colors'"},{"fix":"Call Write.Print('text', Colors.green) or use Write.Input() for input prompts.","cause":"Write.Print() requires a color/gradient argument.","error":"TypeError: Print() missing 1 required positional argument: 'color'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}