Cache Management¶
nflreadpy.clear_cache ¶
Clear cached data entries matching a pattern.
This is the main function for clearing nflreadpy's cache. It provides a simple interface to the underlying CacheManager functionality.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern
|
str | None
|
Optional string pattern to match against cached data. If None, clears all cached data. Pattern matching is performed on cache keys, which typically contain URLs and parameters. |
None
|
Examples:
>>> import nflreadpy as nfl
>>> nfl.clear_cache() # Clear all cached data
>>> nfl.clear_cache("pbp_2023") # Clear 2023 play-by-play data
>>> nfl.clear_cache("roster") # Clear all roster data
Note
This affects both memory and filesystem cache depending on your cache configuration. See nflreadpy.config for cache settings.