{"id":45881,"library":"pyhelper-utils","title":"pyhelper-utils","description":"A collection of utility functions for Python projects, providing helpers for shell commands, environment variables, documentation generation, and more. Current version 2.0.3, released with weekly cadence.","status":"active","version":"2.0.3","language":"python","source_language":"en","source_url":"https://github.com/RedHatQE/pyhelper-utils","tags":["utilities","helper","shell","env"],"install":[{"cmd":"pip install pyhelper-utils","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Used for version parsing and comparison","package":"packaging","optional":false},{"reason":"Used for loading environment variables from .env files","package":"python-dotenv","optional":true}],"imports":[{"note":"run_command is in submodule shell","wrong":"from pyhelper_utils import run_command","symbol":"run_command","correct":"from pyhelper_utils.shell import run_command"},{"note":"get_env_var is in submodule env","wrong":"from pyhelper_utils import get_env_var","symbol":"get_env_var","correct":"from pyhelper_utils.env import get_env_var"},{"note":"generate_docs is in submodule docs","wrong":"from pyhelper_utils import generate_docs","symbol":"generate_docs","correct":"from pyhelper_utils.docs import generate_docs"}],"quickstart":{"code":"import os\nfrom pyhelper_utils.shell import run_command\nfrom pyhelper_utils.env import get_env_var\n\n# Run a shell command\noutput, exit_code = run_command(['echo', 'hello'], check=False)\nprint(output)\n\n# Get an environment variable with default\nvalue = get_env_var('MY_VAR', default='fallback')\nprint(value)","lang":"python","description":"Basic usage: running shell commands and reading environment variables."},"warnings":[{"fix":"Always import from submodules (e.g., pyhelper_utils.shell, pyhelper_utils.env, pyhelper_utils.docs).","message":"Version 2.0.0 removed deprecated functions previously available at top-level import.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Capture both elements: output, exit_code = run_command(...)","message":"The run_command function returns (output, exit_code) tuple, not just output string.","severity":"gotcha","affected_versions":"all"},{"fix":"Set check=False if you want to handle non-zero exit codes yourself.","message":"The run_command function has check=True by default, which raises CalledProcessError on non-zero exit.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'2.0.3':25 'cadenc':29 'collect':5 'command':16 'current':23 'document':19 'env':33 'environ':17 'function':8 'generat':20 'helper':13,31 'project':11 'provid':12 'pyhelp':2 'pyhelper-util':1 'python':10 'releas':26 'shell':15,32 'util':3,7,30 'variabl':18 'version':24 'week':28","created_at":"2026-06-07T12:57:11.432793+00:00","updated_at":"2026-06-07T12:57:11.432793+00:00","problems":[{"fix":"Use: from pyhelper_utils.shell import run_command","cause":"Importing from top-level module instead of submodule.","error":"AttributeError: module 'pyhelper_utils' has no attribute 'run_command'"},{"fix":"Use: from pyhelper_utils.env import get_env_var","cause":"Symbol not exposed at top-level, must import from submodule.","error":"ImportError: cannot import name 'get_env_var' from 'pyhelper_utils'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/RedHatQE/pyhelper-utils","github":"https://github.com/RedHatQE/pyhelper-utils","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}