'envscanner' is a Python library and command-line interface (CLI) tool for scanning and managing environment variables in a structured and automated way.
It allows you to define your project configuration via asettings.jsonfile, set project paths, and filter system environment variables efficiently.
- Load environment configurations from a
settings.jsonfile - Persist custom project and root paths locally
- CLI with multiple commands powered by Typer
- Filter environment variables by pattern
- Easily extendable and readable codebase
Install directly from source or via pip (after packaging):
pip install envscanner
git clone https://github.com/your-user/envscanner.git
cd envscanner
pip install -e .envscanner/
├── envscanner/
│ ├── __init__.py
│ ├── cli.py # CLI commands (Typer)
│ ├── config.py # Load settings.json
│ ├── env_reader.py # Read and filter environment variables
│ └── project_path.py # Define and persist paths
├── settings.json.example # Example configuration file
├── tests/
│ └── test_envscanner.py
├── pyproject.toml
├── README.md
└── LICENSE
To configure envscanner, place a settings.json file in your project root directory with the following format:
{
"project_name": "my_project",
"environment_variable": "Development"
}
Then set the project path:
python -m envscanner.cli set-path "C:\path\to\my_project"
Set project or root path:
python -m envscanner.cli set-path "<absolute_project_path>"
python -m envscanner.cli set-root "<absolute_root_path>"
Scan settings:
python -m envscanner.cli scan
List environment variables (with filters):
python -m envscanner.cli list-envs
python -m envscanner.cli list-envs --contains PATH
python -m envscanner.cli list-envs --starts-with PY
python -m envscanner.cli list-envs --ends-with HOME