Skip to main content

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

yamlargparse-1.1.0-py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page