Registry / devops / pyhelper-utils

pyhelper-utils

JSON →
library2.0.3pypypi✓ verified 88d ago

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.

pip install pyhelper-utils
INSTALL
IMPORT
SIG · PYHELPER-UTILS
P
pyhelper-utils
devopspythonv2.0.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

run_command
✓ from pyhelper_utils.shell import run_command
✗ from pyhelper_utils import run_command
run_command is in submodule shell
get_env_var
✓ from pyhelper_utils.env import get_env_var
✗ from pyhelper_utils import get_env_var
get_env_var is in submodule env
generate_docs
✓ from pyhelper_utils.docs import generate_docs
✗ from pyhelper_utils import generate_docs
generate_docs is in submodule docs

Basic usage: running shell commands and reading environment variables.

import os from pyhelper_utils.shell import run_command from pyhelper_utils.env import get_env_var # Run a shell command output, exit_code = run_command(['echo', 'hello'], check=False) print(output) # Get an environment variable with default value = get_env_var('MY_VAR', default='fallback') print(value)
Debug
Known issues
breakingVersion 2.0.0 removed deprecated functions previously available at top-level import.
fix
Always import from submodules (e.g., pyhelper_utils.shell, pyhelper_utils.env, pyhelper_utils.docs).
affects: >=2.0.0
gotchaThe run_command function returns (output, exit_code) tuple, not just output string.
fix
Capture both elements: output, exit_code = run_command(...)
affects: all
gotchaThe run_command function has check=True by default, which raises CalledProcessError on non-zero exit.
fix
Set check=False if you want to handle non-zero exit codes yourself.
affects: all
Errors
Common errors & fixes
AttributeError: module 'pyhelper_utils' has no attribute 'run_command'
Importing from top-level module instead of submodule.
fix
Use: from pyhelper_utils.shell import run_command
ImportError: cannot import name 'get_env_var' from 'pyhelper_utils'
Symbol not exposed at top-level, must import from submodule.
fix
Use: from pyhelper_utils.env import get_env_var
Upgrade
Version history
2.0.3latest on PyPI · released May 13, 2026
Audit
Dependencies
packagingrequiredUsed for version parsing and comparison
python-dotenvoptionalUsed for loading environment variables from .env files
Agent activity
4 hits · last 30 days
node
4
Resources
pyhelper-utils — pip install pyhelper-utils · libregistry