abaquant.marketdata.financials.cache

Import path: abaquant.marketdata.financials.cache

Domain: Provider-neutral market-data facades, normalized records, caching, and analytics.

Purpose

Atomic, versioned disk cache for financial-statement snapshots.

When to use it

This module participates in the financial-statement pipeline: provider response, normalization, cache/repository coordination, canonical line-item resolution, and analytical input construction.

Public objects

  • class: FinancialStatementCacheStore — Read and write snapshots atomically; invalid or corrupt files are cache misses. * FinancialStatementCacheStore.path — Return the deterministic cache path for one symbol, source, and period. * FinancialStatementCacheStore.load — Load and checksum-validate one cache entry. * FinancialStatementCacheStore.save — Write a cache entry through a temporary file and atomic replacement. * FinancialStatementCacheStore.remove — Remove one cache entry if it exists.

Detailed reference

Atomic, versioned disk cache for financial-statement snapshots.

class abaquant.marketdata.financials.cache.FinancialStatementCacheStore(directory, source_name='default')

Bases: object

Read and write snapshots atomically; invalid or corrupt files are cache misses.

Configure the root directory and provider namespace for snapshots.

Parameters:
  • directory (str | Path)

  • source_name (str)

path(symbol, period)

Return the deterministic cache path for one symbol, source, and period.

Parameters:
  • symbol (str)

  • period (Literal['annual', 'quarterly'])

Return type:

Path

load(symbol, period)

Load and checksum-validate one cache entry.

Parameters:
  • symbol (str)

  • period (Literal['annual', 'quarterly'])

Return type:

FinancialStatementSnapshot | None

save(snapshot)

Write a cache entry through a temporary file and atomic replacement.

Parameters:

snapshot (FinancialStatementSnapshot)

Return type:

None

remove(symbol, period)

Remove one cache entry if it exists.

Parameters:
  • symbol (str)

  • period (Literal['annual', 'quarterly'])

Return type:

None