Registry / serialization / config-parser

config-parser

JSON →
library0.0.1pypypiunverified

This library, referred to as 'configs' on GitHub, provides wrappers for handling configuration through JSON, YAML, environment variables, and command-line arguments. It aims to simplify the process of loading and accessing hierarchical configuration settings. It is currently at version 0.0.1, indicating an early development stage with an infrequent release cadence.

pip install git+https://github.com/mattpaletta/configs.git#egg=configs
INSTALL
IMPORT
SIG · CONFIG-PARSER
C
config-parser
serializationpythonv0.0.1
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
build_error
Code
Verified usage

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

Config
from configs.config import Config
import config-parser
The actual library name in the provided GitHub repository is 'configs', not 'config-parser', and the primary class is 'Config' within the 'configs.config' module.

Initializes the Config object, which by default attempts to load `config.json` or `config.yaml` from the current directory, and also processes environment variables. Configuration values are accessible via attribute access or a dictionary-like `get` method.

import os from configs.config import Config # Create a dummy config.json file for demonstration with open('config.json', 'w') as f: f.write('{"database": {"host": "localhost", "port": 5432}}') # Set an environment variable (optional) os.environ['APP_ENV'] = 'development' # Initialize Config - it will look for config.json or config.yaml by default # in the current directory, and also process environment variables. # For demonstration, we explicitly pass a config file path or let it discover. # In a real app, you might pass sys.argv for argparse processing. # Example 1: Load from default config.json app_config = Config() print(f"DB Host: {app_config.database.host}") print(f"DB Port: {app_config.database.port}") print(f"App Environment (from env var): {app_config.app_env}") # Example 2: Accessing values dynamically or with a default port_value = app_config.get('database.port', default=5432) print(f"DB Port (via .get() with default): {port_value}") # Clean up dummy file and env var os.remove('config.json') del os.environ['APP_ENV']
Debug
Known issues
gotchaThe PyPI slug 'config-parser' (as specified in the prompt) does not directly correspond to the GitHub repository 'mattpaletta/configs' (which has version 0.0.1). The `pip install config-parser` command will install a different, unrelated library. To install the library described here, it must be installed directly from its GitHub repository.
fix
Use `pip install git+https://github.com/mattpaletta/configs.git#egg=configs` to install the correct library.
affects: 0.0.1
gotchaThe library is in a very early development stage (version 0.0.1) and lacks comprehensive documentation. Its API, features, and stability may change frequently without explicit breaking change notices.
fix
Review the GitHub repository's source code for the most up-to-date usage patterns and be prepared for potential API changes in future versions.
affects: 0.0.1
gotchaBy default, the `Config` class attempts to load configuration from `config.json` or `config.yaml` files located in the current working directory. If these files are not present or explicitly specified, configuration might be empty or incomplete.
fix
Ensure `config.json` or `config.yaml` files are correctly placed or explicitly pass the file path during `Config` initialization if default discovery is not desired.
affects: 0.0.1
gotchaAccessing nested configuration values (e.g., `app_config.database.host`) relies on the underlying structure. Attempting to access a non-existent key will likely result in an `AttributeError` or `KeyError` depending on the access method, without robust error handling built into the accessor.
fix
Use the `.get()` method with a `default` value for potentially missing keys (e.g., `app_config.get('database.host', 'default_host')`) or implement custom error checking around attribute access.
affects: 0.0.1
Upgrade
Version history
0.0.1latest on PyPI · released Jan 21, 2019
Audit
Dependencies
PyYAMLoptionalRequired for parsing YAML configuration files.
Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources
config-parser — pip install config-parser · libregistry