get_cache_dir_path#
- astropy.config.get_cache_dir_path(rootname='astropy', *, ensure_exists=True)[source]#
Determines the cache directory associated with a namespace and, optionally, creates the directory if it doesn’t exist.
This directory is typically
$XDG_CACHE_HOME/<namespace>, but can be overwritten with theASTROPY_CACHE_DIRenvironment variable, or withtemporary_cache_dir_path().Changed in version 8.0: In previous versions, the return value pointed to
$HOME/.astropy/cacheby default. A new environment variableASTROPY_CACHE_DIRis now supported. Symlinks are no longer created in any situation.- Parameters:
- rootname
python:str, optional Namespace associated with the directory. For example, for
'pkgname', the directory would be$XDG_CACHE_HOME/pkgname. Default:'astropy'- ensure_existsbool, keyword-only, optional
Whether to create the directory (and its parents) if it’s missing. Default: True
Added in version 8.0.0.
- rootname
- Returns:
- Path
The absolute path to the cache directory.