[Python-ideas] Add appdirs module to stdlib

M.-A. Lemburg mal at egenix.com
Wed Sep 2 11:30:33 CEST 2015

On 02.09.2015 10:10, Philipp A. wrote:
> ~/.appname stopped being right on linux long ago and never was right on
> other platforms, which we should teach people.

Looking at the my home dir on Linux, there doesn't seem to be
one standard, but rather a whole set of them and the good old
~/.appname is still a popular one (e.g. pip and ansible from
Python land still use it; as do many other non-Python applications
such as ncftp, emacs, svn, git, gpg, etc.).

~/.config/ does get some use, but mostly for GUI applications,
not so much for command line ones.

~/.local/lib/ only appears to be used by Python :-)
~/.local/share/ is mostly used by desktops to register application

~/.cache/ is being used by just a handful of tools, pip being one
of them.

appdirs seems to rely on the XDG Base Directory Specification for a lot
of things on Linux (http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html).
That's probably fine for desktop GUI apps (the standard was apparently
built for this use case), but doesn't apply at all for command line tools
or applications like daemons or services which don't interact with the
desktop, e.g. you typically won't find global config files for
command line tools under /etc/xdg/, but instead under /etc/.

For Windows, the CSIDL_* values have also been replaced with
new ones under FOLDERID_* (the APIs have also evolved):



BTW: I wonder why the Windows functions in appdirs don't use
the environment for much easier access to e.g. APPDATA and USERPROFILE.

Marc-Andre Lemburg

Professional Python Services directly from the Source  (#1, Sep 02 2015)
>>> Python Projects, Coaching and Consulting ...  http://www.egenix.com/
>>> mxODBC Plone/Zope Database Adapter ...       http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
2015-08-27: Released eGenix mx Base 3.2.9 ...     http://egenix.com/go83

::::: Try our mxODBC.Connect Python Database Interface for free ! ::::::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611

More information about the Python-ideas mailing list