plexus.cli.shared.fetch_score_configurations module

Functions to fetch and cache score configurations from the API.

plexus.cli.shared.fetch_score_configurations.fetch_score_configurations(client, scorecard_data: Dict[str, Any], target_scores: List[Dict[str, Any]], cache_status: Dict[str, bool] | Tuple[List[str], List[str]], use_cache: bool = True) Dict[str, str]

Fetch and cache missing score configurations from the API.

Args:

client: GraphQL API client scorecard_data: The scorecard data containing name and other properties target_scores: List of score objects to process cache_status: Either a dictionary mapping score IDs to their cache status (bool)

or a tuple of (cached_ids, uncached_ids) lists

use_cache: Whether to return configurations from cache (True) or use in-memory data (False)

When True: after fetching, load everything from cache files When False: return API results directly without loading from cache

Returns:

Dictionary mapping score IDs to their parsed configurations

plexus.cli.shared.fetch_score_configurations.load_cached_configurations(scorecard_data: Dict[str, Any], target_scores: List[Dict[str, Any]]) Dict[str, str]

Load all cached score configurations from the local filesystem.

Args:

scorecard_data: The scorecard data containing name and other properties target_scores: List of score objects to process

Returns:

Dictionary mapping score IDs to their configuration strings