My project cihai (
http://cihai.git-pull.com/) and
unihan-etl (
https://github.com/cihai/unihan-etl) both use
the XDG specification.
The reason I like it is it provides directories to
use across platforms (edit: Not sure about Windows), relative to the user. Since the
applications download a file (UNIHAN database [1]) to bootstrap,
we want to store it in the user's files, not the systems.
The other thing I do that's helpful is using sqlite (which is
often built with Python).
This combination gives a database, and a place to store
configuration, downloaded/built files, in an organized
way across systems.
The nice things XDG "standardizes" which I'm using:
$XDG_DATA_HOME defines the base directory relative to which user specific data files should be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used.
$XDG_CONFIG_HOME defines the base directory relative to which user specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.
$XDG_CACHE_HOME defines the base directory relative to which user specific non-essential data files should be stored. If $XDG_CACHE_HOME is either not set or empty, a default equal to $HOME/.cache should be used.
Why the implementation is helpful:
It defines a common directory for cache/data/config files, with applications inside them, e.g. ~/.config/i3, ~/.config/tmuxp, rather than adding more stuff to ~/.i3, ~/.tmuxp. When standards aren't being followed, programs end up storing their configurations / data / etc all over.
Another thing is it defines directories relative to the user themselves and for the system files. Dotfiles may imply configuration / artifacts in the users home directory, it doesn't have. The thing I like is I can check for configuration in user files (for instance ~/.gtk-3.0/), then fall back on checking the system files (/etc/gtk-3.0).
The benefit of user files is they're writable out of the box, so if there's going to be any file generated that the user needs to keep (like an unzipped version of UNIHAN) that can be cached so they don't have to download it again.
(XDG Link: https://specifications.freedesktop.org/basedir-spec/basedir-...)
[1] https://www.unicode.org/reports/tr38/