Files
plex-playlist-old/docs/adrs/002-configuration-file-format.md
2023-10-20 16:27:17 -04:00

1.3 KiB

ADR 002: Choose a good configuration file format.

A good configuration file format needs to be selected. There are three main choices that were considered:

  1. JSON - this is the primary data format used for the web and communications, but is not as readable as the other options.
  2. YAML - this is a much more readable format, and is a superset of JSON (able to load JSON as YAML), however there are weird nuances in this format that can cause problems.
  3. TOML - this is a format similar to the old Windows Config format, but with better structuring. It is readable, and clear like YAML, but without the weird corner cases that YAML has which could break things. However support is small as it is relatively new.

Decision

TOML was decided to be used for the configuration file.

Rationale

TOML is very readable, does not have the bizarre error problems that YAML does, and is an up-and-coming technology. While the support is relatively light right now, it already is showing up in the standard Python libraries, as well as a handful of other libraries.

Status

Accepted

Consequences

Using the toml library means accepting a relatively new library with a version 0.10, which could have issues until it matures to a full system. Might need to revisit and pick another library for the config files if the toml library doesn't work.