pycancensus.remove_from_cache

pycancensus.remove_from_cache(cache_keys: List[str] | None = None, all_cache: bool = False) None[source]

Remove items from cache.

Parameters:
  • cache_keys (list of str, optional) – Specific cache keys to remove. If None and all_cache=False, does nothing.

  • all_cache (bool, default False) – If True, removes all cached data.

Examples

>>> import pycancensus as pc
>>> # Remove specific cache entries
>>> pc.remove_from_cache(["regions_CA16", "vectors_CA16"])
>>>
>>> # Remove all cache (use with caution!)
>>> pc.remove_from_cache(all_cache=True)