cache
core.cache
Cache management for data processing.
Classes
| Name | Description |
|---|---|
| CacheManager | Data cache management system. |
CacheManager
core.cache.CacheManager(self, cache_dir, expiry_hours=24, batch_size=10000)Data cache management system.
Methods
| Name | Description |
|---|---|
| clear_expired_cache | Remove expired cache files. |
| get_cached_data | Retrieve cached data if available and not expired. |
| save_to_cache | Save DataFrame to cache. |
clear_expired_cache
core.cache.CacheManager.clear_expired_cache()Remove expired cache files.
get_cached_data
core.cache.CacheManager.get_cached_data(query_name, validate=True)Retrieve cached data if available and not expired.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| query_name | str | Name of the cached query to retrieve | required |
| validate | bool | Whether to validate cached data, by default True | True |
Returns
| Name | Type | Description |
|---|---|---|
| Optional[pd.DataFrame] | Cached data if available and valid, None otherwise |
save_to_cache
core.cache.CacheManager.save_to_cache(df, query_name)Save DataFrame to cache.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| df | pd.DataFrame | Data to cache | required |
| query_name | str | Name of the query for the cached data | required |