appdirs

A small Python module for determining appropriate platform-specific dirs, e.g. a "user data dir".

https://github.com/activestate/appdirs

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 34 committers (2.9%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.3%) to scientific vocabulary

Keywords from Contributors

unit-testing closember cloud-management autopep8 codeformatter formatter gofmt pre-commit-hook yapf asyncio
Last synced: 10 months ago · JSON representation

Repository

A small Python module for determining appropriate platform-specific dirs, e.g. a "user data dir".

Basic Info
Statistics
  • Stars: 1,069
  • Watchers: 65
  • Forks: 97
  • Open Issues: 48
  • Releases: 0
Created almost 16 years ago · Last pushed over 3 years ago
Metadata Files
Readme Changelog License

README.rst

.. image:: https://secure.travis-ci.org/ActiveState/appdirs.png
    :target: https://travis-ci.org/ActiveState/appdirs

Note: This project has been officially deprecated. You may want to check out https://pypi.org/project/platformdirs/ which is a more active fork of appdirs. Thanks to everyone who has used appdirs. Shout out to ActiveState for the time they gave their employees to work on this over the years.

the problem
===========

What directory should your app use for storing user data? If running on macOS, you
should use::

    ~/Library/Application Support/

If on Windows (at least English Win XP) that should be::

    C:\Documents and Settings\\Application Data\Local Settings\\

or possibly::

    C:\Documents and Settings\\Application Data\\

for `roaming profiles `_ but that is another story.

On Linux (and other Unices) the dir, according to the `XDG
spec `_, is::

    ~/.local/share/


``appdirs`` to the rescue
=========================

This kind of thing is what the ``appdirs`` module is for. ``appdirs`` will
help you choose an appropriate:

- user data dir (``user_data_dir``)
- user config dir (``user_config_dir``)
- user cache dir (``user_cache_dir``)
- site data dir (``site_data_dir``)
- site config dir (``site_config_dir``)
- user log dir (``user_log_dir``)

and also:

- is a single module so other Python packages can include their own private copy
- is slightly opinionated on the directory names used. Look for "OPINION" in
  documentation and code for when an opinion is being applied.


some example output
===================

On macOS::

    >>> from appdirs import *
    >>> appname = "SuperApp"
    >>> appauthor = "Acme"
    >>> user_data_dir(appname, appauthor)
    '/Users/trentm/Library/Application Support/SuperApp'
    >>> site_data_dir(appname, appauthor)
    '/Library/Application Support/SuperApp'
    >>> user_cache_dir(appname, appauthor)
    '/Users/trentm/Library/Caches/SuperApp'
    >>> user_log_dir(appname, appauthor)
    '/Users/trentm/Library/Logs/SuperApp'

On Windows 7::

    >>> from appdirs import *
    >>> appname = "SuperApp"
    >>> appauthor = "Acme"
    >>> user_data_dir(appname, appauthor)
    'C:\\Users\\trentm\\AppData\\Local\\Acme\\SuperApp'
    >>> user_data_dir(appname, appauthor, roaming=True)
    'C:\\Users\\trentm\\AppData\\Roaming\\Acme\\SuperApp'
    >>> user_cache_dir(appname, appauthor)
    'C:\\Users\\trentm\\AppData\\Local\\Acme\\SuperApp\\Cache'
    >>> user_log_dir(appname, appauthor)
    'C:\\Users\\trentm\\AppData\\Local\\Acme\\SuperApp\\Logs'

On Linux::

    >>> from appdirs import *
    >>> appname = "SuperApp"
    >>> appauthor = "Acme"
    >>> user_data_dir(appname, appauthor)
    '/home/trentm/.local/share/SuperApp
    >>> site_data_dir(appname, appauthor)
    '/usr/local/share/SuperApp'
    >>> site_data_dir(appname, appauthor, multipath=True)
    '/usr/local/share/SuperApp:/usr/share/SuperApp'
    >>> user_cache_dir(appname, appauthor)
    '/home/trentm/.cache/SuperApp'
    >>> user_log_dir(appname, appauthor)
    '/home/trentm/.cache/SuperApp/log'
    >>> user_config_dir(appname)
    '/home/trentm/.config/SuperApp'
    >>> site_config_dir(appname)
    '/etc/xdg/SuperApp'
    >>> os.environ['XDG_CONFIG_DIRS'] = '/etc:/usr/local/etc'
    >>> site_config_dir(appname, multipath=True)
    '/etc/SuperApp:/usr/local/etc/SuperApp'


``AppDirs`` for convenience
===========================

::

    >>> from appdirs import AppDirs
    >>> dirs = AppDirs("SuperApp", "Acme")
    >>> dirs.user_data_dir
    '/Users/trentm/Library/Application Support/SuperApp'
    >>> dirs.site_data_dir
    '/Library/Application Support/SuperApp'
    >>> dirs.user_cache_dir
    '/Users/trentm/Library/Caches/SuperApp'
    >>> dirs.user_log_dir
    '/Users/trentm/Library/Logs/SuperApp'


    
Per-version isolation
=====================

If you have multiple versions of your app in use that you want to be
able to run side-by-side, then you may want version-isolation for these
dirs::

    >>> from appdirs import AppDirs
    >>> dirs = AppDirs("SuperApp", "Acme", version="1.0")
    >>> dirs.user_data_dir
    '/Users/trentm/Library/Application Support/SuperApp/1.0'
    >>> dirs.site_data_dir
    '/Library/Application Support/SuperApp/1.0'
    >>> dirs.user_cache_dir
    '/Users/trentm/Library/Caches/SuperApp/1.0'
    >>> dirs.user_log_dir
    '/Users/trentm/Library/Logs/SuperApp/1.0'

Owner

  • Name: ActiveState Software
  • Login: ActiveState
  • Kind: organization
  • Location: Vancouver, BC

GitHub Events

Total
  • Commit comment event: 1
  • Issues event: 1
  • Watch event: 31
  • Issue comment event: 2
  • Fork event: 1
Last Year
  • Commit comment event: 1
  • Issues event: 1
  • Watch event: 31
  • Issue comment event: 2
  • Fork event: 1

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 169
  • Total Committers: 34
  • Avg Commits per committer: 4.971
  • Development Distribution Score (DDS): 0.834
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Trent Mick t****m@g****m 28
Jeff Rouse jr@i****o 22
Eddy Petrișor e****r@g****m 17
Sridhar Ratnakumar s****a@g****m 13
Sridhar Ratnakumar s****r@a****m 12
Sridhar Ratnakumar g****b@s****e 12
Jon Dufresne j****e@g****m 10
Benjamin Drung b****g@p****m 7
cpburnz c****z@g****m 7
Thomas Grainger t****n@g****m 4
Matěj Cepl m****l@r****m 3
Sridhar Ratnakumar me@s****e 3
carlgeorge c****e@r****m 3
Joe Esposito j****e@j****m 3
Hugo h****k 2
Jakub Wilk j****k@j****t 2
Ofek Lev o****r@g****m 2
Sergey Fedoseev f****y@g****m 2
Sridhar Ratnakumar s****d@s****a 2
Adam J. Stewart a****6@g****m 1
Dale E. Moore D****e@g****m 1
Donald Stufft d****d@s****o 1
Jason R. Coombs j****o@j****m 1
John W. O'Brien j****n@s****m 1
Yen Chi Hsuan y****5@g****m 1
Joshua Root j****r@m****g 1
Kevin McClusky k****y@i****m 1
Leonardo Rochael Almeida l****l@g****m 1
Michael McMahon m****l@g****g 1
Rex Kerr r****r@g****m 1
and 4 more...

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 51
  • Total pull requests: 51
  • Average time to close issues: over 2 years
  • Average time to close pull requests: 10 months
  • Total issue authors: 47
  • Total pull request authors: 32
  • Average comments per issue: 3.16
  • Average comments per pull request: 1.67
  • Merged pull requests: 19
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • jaraco (2)
  • JPLeBreton (2)
  • pradyunsg (2)
  • elbenfreund (2)
  • elsiehupp (1)
  • sotte (1)
  • srenfo (1)
  • smessmer (1)
  • noloader (1)
  • hugovk (1)
  • bkanuka (1)
  • emcd (1)
  • gnadelwartz (1)
  • srid (1)
  • NickleDave (1)
Pull Request Authors
  • jdufresne (15)
  • xavfernandez (2)
  • sir-sigurd (2)
  • hugovk (2)
  • pradyunsg (2)
  • untzag (2)
  • dignissimus (1)
  • 2xB (1)
  • YariKartoshe4ka (1)
  • Kevin-McClusky (1)
  • hrnciar (1)
  • iLLiCiTiT (1)
  • eukreign (1)
  • Kriskras99 (1)
  • terminalmage (1)
Top Labels
Issue Labels
test (1)
Pull Request Labels

Packages

  • Total packages: 4
  • Total downloads:
    • pypi 25,811,353 last-month
  • Total docker downloads: 3,724,421,509
  • Total dependent packages: 1,559
    (may contain duplicates)
  • Total dependent repositories: 71,210
    (may contain duplicates)
  • Total versions: 17
  • Total maintainers: 2
pypi.org: appdirs

A small Python module for determining appropriate platform-specific dirs, e.g. a "user data dir".

  • Versions: 8
  • Dependent Packages: 1,381
  • Dependent Repositories: 70,456
  • Downloads: 25,811,353 Last month
  • Docker Downloads: 3,724,421,509
Rankings
Docker downloads count: 0.0%
Dependent packages count: 0.0%
Dependent repos count: 0.0%
Downloads: 0.1%
Average: 1.4%
Stargazers count: 2.7%
Forks count: 5.9%
Maintainers (1)
Last synced: 10 months ago
spack.io: py-appdirs

A small Python module for determining appropriate platform-specific dirs, e.g. a "user data dir".

  • Versions: 3
  • Dependent Packages: 25
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 2.8%
Average: 5.3%
Stargazers count: 7.6%
Forks count: 10.8%
Maintainers (1)
Last synced: 11 months ago
conda-forge.org: appdirs
  • Versions: 4
  • Dependent Packages: 138
  • Dependent Repositories: 377
Rankings
Dependent packages count: 0.5%
Dependent repos count: 1.5%
Average: 8.4%
Stargazers count: 13.0%
Forks count: 18.6%
Last synced: 11 months ago
anaconda.org: appdirs
  • Versions: 2
  • Dependent Packages: 15
  • Dependent Repositories: 377
Rankings
Dependent packages count: 2.5%
Dependent repos count: 8.7%
Average: 16.7%
Stargazers count: 24.1%
Forks count: 31.5%
Last synced: 11 months ago

Dependencies

Dockerfile docker
  • activestate/activepython 2.7 build