Parsing of command line options, yaml config files and/or environment variables based on argparse.
Project description
This module is an extension to python’s argparse which simplifies parsing of configuration options from command line arguments, yaml configuration files, environment variables and hard-coded defaults.
The aim is similar to other projects such as configargparse, yconf and confuse. The obvious question is, why yet another module similar to many already existing ones? The answer is simply that none of the existing projects had the exact features we wanted and after analyzing the alternatives it seemed simpler to create a new module.
Features
Parsers are configured just like with python’s argparse, thus it has a gentile learning curve.
Not exclusively intended for parsing command line arguments. The module has functions to parse environment variables and yaml config files.
Configuration settings are overridden based on the following precedence.
Parsing command line: command line arguments (might include config file) > environment variables > defaults.
Parsing yaml: config file values > environment variables > defaults.
Parsing environment: environment variables > defaults.
Support of nested namespaces to make it possible to parse yaml with non-flat hierarchies.
Contact
Mauricio Villegas <mauricio@omnius.com>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for yamlargparse-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f67693be4be25cc36e27f0113b10afe8f13381de2bbf84f464077e314ce46ccf |
|
MD5 | 38e3fe2383ad4a48d27e0e899d3bc39e |
|
BLAKE2b-256 | 002073388ab7ef8e9e94355c267cc9d0ac851b8f42b896eaa958ca7df434c78c |