ActiveState first shared the source of their Python appdirs package in 2010, before which it had been developed as part of Komodo. It has since evolved at slow intervals, and seems to be a go-to package in the Python ecosystem. This package is a Rust port of the Python code.
It exposes the same six primitives:
user_data_dir()
site_data_dir()
user_config_dir()
site_config_dir()
user_cache_dir()
user_log_dir()
Windows Vista and later, macOS and other Unices are tested. Android support should be coming soon; iOS needs some more investigation. The following documents have been guiding development:
- Microsoft Windows knowledge base entry
- Apple's File System Programming Guide
- The XDG Base Directory Specification