{"id":26817,"library":"bx-py-utils","title":"bx_py_utils","description":"A collection of various Python utility functions, currently at version 118. It provides helpers for CLI, color output, dictionaries, Django, HTML, and more. Requires Python >= 3.11. Released sporadically on PyPI.","status":"active","version":"118","language":"python","source_language":"en","source_url":"https://github.com/boxine/bx_py_utils","tags":["utility","cli","django","color","testing"],"install":[{"cmd":"pip install bx-py-utils","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for Django-specific utilities (e.g., testing, HTML rendering).","package":"Django","optional":true},{"reason":"Used for colored terminal output (e.g., `red_sym`, `green_sym`).","package":"colorama","optional":true}],"imports":[{"note":"red_sym is a top-level attribute, not in a submodule.","wrong":"from bx_py_utils.cli import red_sym","symbol":"red_sym","correct":"from bx_py_utils import red_sym"},{"note":"BaseTest moved to test_utils subpackage.","wrong":"from bx_py_utils.base_test import BaseTest","symbol":"BaseTest","correct":"from bx_py_utils.test_utils import BaseTest"}],"quickstart":{"code":"from bx_py_utils import red_sym, green_sym\n\nprint(red_sym('Error'))   # prints red colored text with '✘' symbol\nprint(green_sym('OK'))    # prints green colored text with '✔' symbol\n\n# Output without colors (e.g., in CI):\nimport os\nos.environ['NO_COLOR'] = '1'\nprint(red_sym('still plain text'))  # no coloring","lang":"python","description":"Import and use color utilities. The NO_COLOR environment variable disables ANSI coloring."},"warnings":[{"fix":"Pin to a specific version and review changelog before upgrading.","message":"The version number is an integer (118) incremented for every release, not semantic versioning. Breaking changes can occur at any minor bump.","severity":"gotcha","affected_versions":"all"},{"fix":"Install extra dependencies: pip install bx-py-utils[django,colorama] or handle missing imports gracefully.","message":"Some utilities rely on optional dependencies like Django, colorama. Missing them causes ImportError at runtime if you directly access submodules.","severity":"gotcha","affected_versions":"all"},{"fix":"Use Django's `django.template.loader.render_to_string` instead.","message":"The function `bx_py_utils.HTMLRenderer` is deprecated in favor of Django's native template rendering.","severity":"deprecated","affected_versions":">=100"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install bx-py-utils`. Ensure your environment has the package.","cause":"Package not installed or installed under a different name (e.g., 'bx-py-utils' with hyphens).","error":"ModuleNotFoundError: No module named 'bx_py_utils'"},{"fix":"Update to latest version: `pip install -U bx-py-utils`. Then use `from bx_py_utils import red_sym`.","cause":"Wrong import path or older version where red_sym was in a submodule.","error":"AttributeError: module 'bx_py_utils' has no attribute 'red_sym'"},{"fix":"Change import to `from bx_py_utils.test_utils import BaseTest`.","cause":"BaseTest was moved to bx_py_utils.test_utils in a breaking change.","error":"ImportError: cannot import name 'BaseTest' from 'bx_py_utils'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}