adsfolio.pubcache

Persistent user-level cache for the user’s ADS publication universe.

class adsfolio.pubcache.CachedPublications(fetched_at, profile, documents)[source]

Bases: object

Publication cache payload loaded from disk.

Parameters:
documents: list[dict[str, Any]]
fetched_at: str
profile: dict[str, Any]
adsfolio.pubcache.cache_path()[source]

Return the user-level publication cache path.

Return type:

pathlib.Path

adsfolio.pubcache.clear()[source]

Remove the publication cache and report whether it existed.

Return type:

bool

adsfolio.pubcache.load_publications()[source]

Load the cache, returning None for missing or invalid data.

Return type:

adsfolio.pubcache.CachedPublications | None

adsfolio.pubcache.profile_matches(cached_profile, current_profile)[source]

Return whether a cache profile snapshot equals the current profile.

Parameters:
Return type:

bool

adsfolio.pubcache.save_publications(profile, documents)[source]

Atomically save a publication cache.

Parameters:
  • profile (mapping or dataclass) – Snapshot of the setup profile used for the query.

  • documents (list of mapping) – ADS document dictionaries.

Returns:

The written cache path.

Return type:

pathlib.Path