Skip to content

EuroEndpoint

cl_forge.cmf.EuroEndpoint dataclass

EuroEndpoint(api_key: str)

Bases: CmfEndpoint[EuroRecord]

Client for the CMF Euro endpoints.

Parameters:

Name Type Description Default
api_key str

CMF API key.

required
Source code in src/cl_forge/core/endpoints.py
def __init__(self, api_key: str) -> None:
    """
    Initialize the Euro endpoint client.

    Parameters
    ----------
    api_key : str
        CMF API key.
    """
    super().__init__(api_key, "/euro", EuroRecord, "Euros")

current

current() -> EuroRecord

Get the latest available Euro value.

Returns:

Type Description
EuroRecord

The latest Euro record.

Source code in src/cl_forge/core/endpoints.py
def current(self) -> EuroRecord:
    """
    Get the latest available Euro value.

    Returns
    -------
    EuroRecord
        The latest Euro record.
    """
    return super().current()

year

year(year: int | None = None) -> list[EuroRecord]

Get the Euro values for a given year.

Parameters:

Name Type Description Default
year int | None

The year for which to retrieve Euro values. If None, defaults to the current year.

None

Returns:

Type Description
list[EuroRecord]

A list of Euro records for the specified year.

Source code in src/cl_forge/core/endpoints.py
def year(self, year: int | None = None) -> list[EuroRecord]:
    """
    Get the Euro values for a given year.

    Parameters
    ----------
    year : int | None
        The year for which to retrieve Euro values. If None, defaults to the
        current year.

    Returns
    -------
    list[EuroRecord]
        A list of Euro records for the specified year.
    """
    return super().year(year)