Source code for fm_weck.online_fm_data

# This file is part of fm-weck: executing fm-tools in containerized environments.
# https://gitlab.com/sosy-lab/software/fm-weck
#
# SPDX-FileCopyrightText: 2024 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0

import logging

import httpx
import yaml

logger = logging.getLogger(__name__)

GITLAB_FM_TOOLS_RAW_URL = "https://gitlab.com/sosy-lab/benchmarking/fm-tools/-/raw/main/data"


[docs] def fetch_online_tool_data(tool_name: str, timeout: float = 2.0) -> dict | None: url = f"{GITLAB_FM_TOOLS_RAW_URL}/{tool_name}.yml" try: response = httpx.get(url, timeout=timeout, follow_redirects=True) response.raise_for_status() return yaml.safe_load(response.text) except Exception as e: logger.debug("Could not fetch online tool data for '%s': %s", tool_name, e) return None