pycancensus.set_cache_path

pycancensus.set_cache_path(cache_path: str, install: bool = False) None[source]

Set the local cache path for downloaded data.

Parameters:
  • cache_path (str) – Path to directory for caching downloaded data.

  • install (bool, default False) – If True, saves the cache path persistently for future sessions.

Examples

>>> import pycancensus as pc
>>> pc.set_cache_path("./data_cache")
>>> pc.set_cache_path("./data_cache", install=True)  # Persist for future sessions