rcmpy.xdg package — docs

Skip to main content
`Ctrl`+`K`

# rcmpy.xdg package

## Module contents

A module for working with the XDG base directory specification.

https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

rcmpy.xdg.config_directories(*parts: str, include_home: bool = True) → Iterator[Path]

  Yield a set of preference ordered base directories relative to which configuration files should be searched.

rcmpy.xdg.data_directories(*parts: str, include_home: bool = True) → Iterator[Path]

  Yield a set of preference ordered base directories relative to which data files should be searched.

rcmpy.xdg.ensure_absolute(path: Path | str | None, create: bool = False) → Path

  A wrapper to ensure that a path is an absolute one.

rcmpy.xdg.iterate_directories(data: str, sep: str = ':', create: bool = False) → Iterator[Path]

  Iterate over directories specified in a PATH-like variable (some separator).

rcmpy.xdg.root_directory(*parts: str) → Path

  Create a path from the current file-system’s root directory.

rcmpy.xdg.user_bin(*parts: str, create: bool = True) → Path

  A single base directory relative to which user-specific executable files may be written.

rcmpy.xdg.user_cache(*parts: str, create: bool = True) → Path

  A single base directory relative to which user-specific non-essential (cached) data should be written.

rcmpy.xdg.user_config(*parts: str, create: bool = True) → Path

  A single base directory relative to which user-specific configuration files should be written.

rcmpy.xdg.user_data(*parts: str, create: bool = True) → Path

  A single base directory relative to which user-specific data files should be written.

rcmpy.xdg.user_state(*parts: str, create: bool = True) → Path

  A single base directory relative to which user-specific state data should be written.