Install & Compatibility
Where this runs
tested against v0.4.19 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.071s · 21.8MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 1.8s · import 0.065s · 22MB
20MB installed
● package 20MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Configurator
✓ from configurator import Configurator
✗ from pyconfigurator import Configurator
The package is named 'pyconfigurator' for PyPI, but the primary module is 'configurator'.
This quickstart demonstrates how to initialize `Configurator` with an INI file and environment variables, then access configuration settings using attribute-style access. It highlights environment variable substitution and default values.
import os
from configurator import Configurator
# 1. Create a dummy configuration file
config_file_path = 'my_app_config.ini'
with open(config_file_path, 'w') as f:
f.write('[default]
app_name=MyApplication
data_path=/var/data
log_level=${LOG_LEVEL_ENV:INFO}
[database]
host=localhost
port=5432
user=admin
password=${DB_PASSWORD_ENV:secret}')
# 2. Set environment variables (optional, for demonstration)
os.environ['LOG_LEVEL_ENV'] = 'DEBUG'
# os.environ['DB_PASSWORD_ENV'] = 'super_secret'
# 3. Initialize the Configurator
# It loads files, then environment variables, then CLI args (if any)
config = Configurator(
files=[config_file_path],
environ=os.environ, # Pass os.environ to enable env var substitution
# cli_args=['--database-user', 'cli_user'] # Example for CLI overrides
)
# 4. Access configuration values
print(f"Application Name: {config.default.app_name}")
print(f"Data Path: {config.default.data_path}")
print(f"Log Level: {config.default.log_level}")
print(f"Database Host: {config.database.host}")
print(f"Database User: {config.database.user}")
print(f"Database Password: {config.database.password}")
# Clean up the dummy file
os.remove(config_file_path)
pyconfigurator --version
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'configurator'
Attempting to import `Configurator` from `pyconfigurator` instead of `configurator`.
fixChange your import statement from `from pyconfigurator import Configurator` to `from configurator import Configurator`.
AttributeError: 'Configurator' object has no attribute 'some_missing_key'
Attempting to access a configuration key that does not exist in any loaded configuration source.
fixEnsure the key exists in your configuration files, environment variables, or CLI arguments. You can check for existence using `if 'some_key' in config.section:` or provide default values during access if the library supports it (though direct attribute access usually doesn't).
FileNotFoundError: [Errno 2] No such file or directory: 'non_existent.ini'
One of the files specified in the `files` argument to `Configurator` does not exist at the given path.
fixVerify that all file paths provided to `Configurator(files=...)` are correct and the files actually exist. Use absolute paths or ensure your relative paths are correct from the execution directory.
Upgrade
Version history
0.4.19latest on PyPI · released May 6, 2025
Audit
Dependencies
No dependency data recorded yet.