Treasury Analytics Core
  • Home
  • API Reference
  • Examples
  • Credentials
  • Global Settings
  1. API Reference
  2. Core Components
  3. cache
  • Overview
    • Treasury Analytics Core
  • Credential Management
    • Secure Credential Management
    • Global Settings
  • Examples
    • Example Projects
  • API Reference
    • Function reference
    • Core Components
      • FinanceDataEngine
      • engine_factory
      • engine
      • database
      • cache
      • processor
      • analyzer
    • Configuration
      • settings
      • settings_factory
      • global_settings_manager
    • Utilities
      • credentials
      • dataframe_utils
      • setup_logging
      • env_checker
      • query_timer
      • setup_helper
      • logging
      • constants
      • types
    • Scripts
      • configure_db
      • create_project
      • manage_settings

On this page

  • cache
    • Classes
      • CacheManager

Other Formats

  • Github (GFM)
  1. API Reference
  2. Core Components
  3. cache

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
database
processor
 
 
  • Built with [Quarto](https://quarto.org/) and [quartodoc](https://machow.github.io/quartodoc/)