Skip to main content

xdgpspconf

XDG Platform Suited Project CONFiguration

Gist

Source Code Repository

source Repository

pages Documentation

Badges

Pipeline Coverage PyPI - version PyPI - format PyPi - pyversion

Description

Handle platform suited xdg-base to

  • Read configuration from standard locations.

    • supported formats:
      • yaml

      • json

      • toml

      • conf (ini)

  • Write configuration to most general, writable xdg-location

  • Locate standard directories:
    • xdg_cache

    • xdg_config

    • xdg_data

    • xdg_state

XDG Specification

View xdg specifications here.

What does it do

  • Lists possible xdg-locations (existing and prospective)

CACHE

XDG_CACHE_HOME

DATA

  • XDG_DATA_HOME

  • XDG_DATA_DIRS

STATE

  • XDG_STATE_HOME

  • XDG_STATE_DIRS

CONFIG

  • Reads configuration files from standard Windows/POSIX locations, current folder and optionally all ancestors and custom locations.

Platform-specific
Windows
  • %LOCALAPPDATA%\<PROJECT>\config

  • %USERPROFILE%\AppData\Local\<PROJECT>\config

POSIX

[Linux/MacOS]

  • ${XDG_CONFIG_HOME:-${HOME}/.config}/<PROJECT>/config

  • ${XDG_CONFIG_HOME:-${HOME}/.config}/<PROJECT>

  • ${XDG_CONFIG_HOME:-${HOME}/.config}/<PROJECT>rc

  • $DIR/<PROJECT>/config for each $DIR in $XDG_CONFIG_DIRS

Environment

  • declared variable: %<PROJECT>RC% for Windows or $<PROJECT> for POSIX

Improper

  • ${HOME}/.<PROJECT>rc

Custom

  • configuration path: supplied in function

Relative

./.<PROJECT>rc

Ancestors

Any of the parents, till project root or mountpoint, that contains __init__.py, where,

  • project root is the directory that contains setup.cfg or setup.py

  • mountpoint is checked using pathlib.Path.drive on windows or pathlib.Path.is_mount() on POSIX

TODO

  • Implementation for following variables:
    • XDG_RUNTIME_DIR

    • Other XDG specifications.

    • Arbitrarily defined XDG_.* environment variables

Metadata

Release files for xdgpspconf 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xdgpspconf 1.1.1
File Size Uploaded Provenance Actions
xdgpspconf-1.1.1.tar.gz 27.3 kB Without provenance Details for xdgpspconf-1.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for xdgpspconf 1.1.1
File Interpreter ABI Platform Actions
xdgpspconf-1.1.1-py3-none-any.whl Python 3 none any Details for xdgpspconf-1.1.1-py3-none-any.whl

Total release size: 52.6 kB

Release files / xdgpspconf-1.1.1.tar.gz

Download URL xdgpspconf-1.1.1.tar.gz
Size 27.3 kB
Tags Source
SHA-256 checksum
How to use checksums
92447739b32939278cd82c66b52a9dc248f19d76d1a72ec0c44f7aad3abab077
BLAKE2b-256 checksum
How to use checksums
40ca5aec1fe2c53115316640dcb280230ef0a4c2f430652dd729fea6e82cfe4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / xdgpspconf-1.1.1-py3-none-any.whl

Download URL xdgpspconf-1.1.1-py3-none-any.whl
Size 25.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
30409ee66035f79213de7920ad5956e7fd232352c6ea5721df9aa657fc6fff70
BLAKE2b-256 checksum
How to use checksums
bda82846336252ba78c27b4b657b3604516017ca943fa055c5d1bd4a8e98bef8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Security for xdgpspconf 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page