README

elective

A Python configuration loader generator.

PyPI Version Documentation Status

What is elective?

elective is a Python program configuration loader generator that can leverage environment variables, configuration files (TOML, JSON, YAML, BespON), and the command line (via argparse) to generate a custom loader module to use in your Python application with a goal of being able to specify any configurable option identically via any generation method. elective supports customization of the providers file formats and of the method of combining the results from all providers.

Roadmap

  • Allow for configurable provider precedence.

  • Allow for configurable provider combination.

  • Create left merge, right merge, and join provider combiners.

  • Generate boolean options.

  • Generate string options.

  • Generate number options.

  • Generate list options.

  • Generate hash options.

  • Create configuration object interface.

  • Generate dependency requirements for parent projects (pip).

  • Generate dependency requirements for parent projects (poetry).

  • Allow for configurable file format dependencies.

  • Create TOML configuration to generate configuration generators.

  • Bootstrap to self-host the elective configuration generator.

  • Generate code that passes the project linting tests.

  • Generate an executable entry point to run the generated configuration.

  • Generate tests for the generated configuration.

Installation

Install elective with:

pip install elective
pip freeze > requirements.txt

or with poetry:

poetry add elective

Usage

In code:

>>> import elective

See the source and documentation for more information.