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

1.3 KiB

ADR 003: Choose location of configuration and other files

It is important to store files in a way that is appropriate for whatever platform the application is running on, as such there is a library that can handle this correctly and efficiently. Two different libraries were reviewed:

  1. appdirs - sets up directories which can be written to easily, in a synchronous manner.
  2. app-paths - does what appdirs does, but with Path objects (or AsyncPath), and allows for async file operations.

Decision

app-paths was chosen.

Rationale

Using the library app-paths allows for the different paths needed for configuration, logs, etc to be defined in such a way as to be platform-agnostic, and will automatically make the paths be put in an appropriate location for the system that the application is running on. The fact that it allows for files to be operated on asynchronously and using an AsyncPath object makes it an obvious choice for this application.

Status

Accepted

Consequences

Not exactly certain what concequences there will be with this choice. It seems the better choice all around. app-paths also is only at a version 0.0, which does not give much confidence in the library, and hopes are it will mature quickly over time. However it is built on top of appdirs and aiopathlib both of which are more mature.