Determines the default Lightkurve cache directory name and creates the directory if it doesn’t exist. If the directory cannot be access or created, then it returns the current directory (".").

This directory is typically $HOME/.lightkurve/cache, but if the XDG_CACHE_HOME environment variable is set and the $XDG_CACHE_HOME/lightkurve directory exists, it will be that directory. If neither exists, the former will be created and symlinked to the latter.

The value can be also configured via cache_dir configuration parameter.


The absolute path to the cache directory.


To configure “/my_research/data” as the cache_dir, users can set it:

  1. in the user’s lightkurve.cfg file:

    cache_dir = /my_research/data
  2. at run time:

    import lightkurve as lk
    lk.conf.cache_dir = '/my_research/data'

See configuration for more information.