Manage Configurations: Intro

As I just started to write some code from scratch, I was searching for how to manage the configurations.

We may assume that both the config writer and the config user should adhere to the same interface, and the goal of good configuration practice is to help both to satisfy the interface. This has two meanings:

  1. The config writer wants to express the data precisely, and easily.
  2. The config parser wants to understand the data precisely, and easily.

Both are not that trivial to achieve. For the config writer, he may pick up a configuration format and write the configuration. In case of ambiguity, the library should refuse to guess instead of producing a wrong output.

There will be 3 sections for this topic:

  • Configuration Languages. What are the options and how can we compare them?
  • Representation in Python. How should I represent the configuration in Python?
  • CLI interface. It should be fine to pass values in CLI. How should I generate CLI interface?