{"id":13725133,"url":"https://github.com/srstevenson/xdg-base-dirs","last_synced_at":"2025-12-12T01:04:40.985Z","repository":{"id":37335921,"uuid":"65404998","full_name":"srstevenson/xdg-base-dirs","owner":"srstevenson","description":"Python module for accessing XDG Base Directory paths, simplifying handling of user cache, configuration, and data files.","archived":false,"fork":false,"pushed_at":"2025-03-30T10:45:19.000Z","size":501,"stargazers_count":136,"open_issues_count":1,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T02:05:35.782Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pypi.org/project/xdg-base-dirs","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/srstevenson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-10T18:03:18.000Z","updated_at":"2025-03-30T10:45:21.000Z","dependencies_parsed_at":"2023-09-24T13:39:47.603Z","dependency_job_id":"8a936f2f-9ca7-443e-9efc-24a27c9e1722","html_url":"https://github.com/srstevenson/xdg-base-dirs","commit_stats":{"total_commits":346,"total_committers":6,"mean_commits":"57.666666666666664","dds":0.5115606936416185,"last_synced_commit":"df1544de3cfd3d0df1f31ca59907d03767edda95"},"previous_names":["srstevenson/xdg"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srstevenson%2Fxdg-base-dirs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srstevenson%2Fxdg-base-dirs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srstevenson%2Fxdg-base-dirs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srstevenson%2Fxdg-base-dirs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/srstevenson","download_url":"https://codeload.github.com/srstevenson/xdg-base-dirs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248837274,"owners_count":21169373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","xdg","xdg-basedir"],"created_at":"2024-08-03T01:02:13.876Z","updated_at":"2025-12-12T01:04:40.938Z","avatar_url":"https://github.com/srstevenson.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# xdg-base-dirs\n\nxdg-base-dirs is a Python module that provides functions to return paths to the\ndirectories defined by the [XDG Base Directory Specification][spec], to save you\nfrom duplicating the same snippet of logic in every Python utility you write\nthat deals with user cache, configuration, or data files. It has no external\ndependencies.\n\nxdg-base-dirs currently implements version 0.8 of the specification, released on\n8th May 2021.\n\n\u003e [!NOTE]\n\u003e\n\u003e xdg-base-dirs was previously named xdg, and was renamed due to an import\n\u003e collision with [PyXDG](https://pypi.org/project/pyxdg/). If you used xdg prior\n\u003e to the rename, update by changing the dependency name from xdg to\n\u003e xdg-base-dirs, and the import from `xdg` to `xdg_base_dirs`.\n\n## Installation\n\nxdg-base-dirs requires Python 3.10 or later. To add xdg-base-dirs as a\ndependency to a project managed with [uv], use:\n\n```bash\nuv add xdg-base-dirs\n```\n\nAlternatively, since xdg-base-dirs is only a single file you may prefer to just\ncopy `src/xdg_base_dirs/__init__.py` from the source distribution into your\nproject.\n\n## Usage\n\n```python\nfrom xdg_base_dirs import (\n    xdg_cache_home,\n    xdg_config_dirs,\n    xdg_config_home,\n    xdg_data_dirs,\n    xdg_data_home,\n    xdg_runtime_dir,\n    xdg_state_home,\n)\n```\n\n`xdg_cache_home()`, `xdg_config_home()`, `xdg_data_home()`, and\n`xdg_state_home()` return [`pathlib.Path` objects][pathlib] containing the value\nof the environment variable named `XDG_CACHE_HOME`, `XDG_CONFIG_HOME`,\n`XDG_DATA_HOME`, and `XDG_STATE_HOME` respectively, or the default defined in\nthe specification if the environment variable is unset, empty, or contains a\nrelative path rather than absolute path.\n\n`xdg_config_dirs()` and `xdg_data_dirs()` return a list of `pathlib.Path`\nobjects containing the value, split on colons, of the environment variable named\n`XDG_CONFIG_DIRS` and `XDG_DATA_DIRS` respectively, or the default defined in\nthe specification if the environment variable is unset or empty. Relative paths\nare ignored, as per the specification.\n\n`xdg_runtime_dir()` returns a `pathlib.Path` object containing the value of the\n`XDG_RUNTIME_DIR` environment variable, or `None` if the environment variable is\nnot set, or contains a relative path rather than an absolute path.\n\n## Copyright\n\nCopyright © Scott Stevenson.\n\nxdg-base-dirs is distributed under the terms of the [ISC license].\n\n[isc license]: https://opensource.org/licenses/ISC\n[pathlib]: https://docs.python.org/3/library/pathlib.html#pathlib.Path\n[spec]: https://specifications.freedesktop.org/basedir-spec/latest/\n[uv]: https://docs.astral.sh/uv/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrstevenson%2Fxdg-base-dirs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrstevenson%2Fxdg-base-dirs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrstevenson%2Fxdg-base-dirs/lists"}