Skip to content

Get, post and delete models

get_all_models(api_key)

Returns a list of all models that are registered and available on the platform.

Parameters

api_key : str
    API key used to authenticate with the Mosqlimate service.

Returns

List of Models

Source code in mosqlient/registry/_model_get_impl.py
17
18
19
20
21
22
23
24
25
26
27
28
29
30
def get_all_models(api_key: str) -> List[Model]:
    """
    Returns a list of all models that are registered and available on the platform.

    Parameters
    ----------
        api_key : str
            API key used to authenticate with the Mosqlimate service.

    Returns
    -------
    List of Models
    """
    return Model.get(api_key=api_key)

get_models(api_key, id=None, repository_owner=None, repository_organization=None, repository_name=None, disease=None, category=None, adm_level=None, time_resolution=None, imdc_year=None)

Returns a list of all models registered on the platform that match the specified filter parameters.

Parameters

api_key : str
    API key used to authenticate with the Mosqlimate service.
id: int, optional
    Model id.
repository_owner: str, optional
    Username of the repository owner.
repository_organization: str, optional
    Name of the repository organization.
repository_name: str, optional
    Name of the repository.
disease: str, optional
    Disease code. Options: 'A90' (Dengue), 'A92.0' (Chikungunya), 'A92.5' (Zika).
category: str, optional
    Model category. Options: 'quantitative', 'categorical', 'spatial_quantitative', etc.
adm_level: int, optional
    ADM level. Options: 0 (National), 1 (State), 2 (Municipality), 3 (Sub-Municipality).
time_resolution: str, optional
    Time resolution. Options: 'day', 'week', 'month', 'year'.
imdc_year: int, optional
    The year of the IMDC the model belongs to (e.g., 2024).

Returns

List of Models

Source code in mosqlient/registry/_model_get_impl.py
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
def get_models(
    api_key: str,
    id: Optional[int] = None,
    repository_owner: Optional[str] = None,
    repository_organization: Optional[str] = None,
    repository_name: Optional[str] = None,
    disease: Optional[Literal["A90", "A92.0", "A92.5"]] = None,
    category: Optional[
        Literal[
            "quantitative",
            "categorical",
            "spatial_quantitative",
            "spatial_categorical",
            "spatio_temporal_quantitative",
            "spatio_temporal_categorical",
        ]
    ] = None,
    adm_level: Optional[Literal[0, 1, 2, 3]] = None,
    time_resolution: Optional[Literal["day", "week", "month", "year"]] = None,
    imdc_year: Optional[int] = None,
) -> List[Model]:
    """
    Returns a list of all models registered on the platform that match the
    specified filter parameters.

    Parameters
    ----------
        api_key : str
            API key used to authenticate with the Mosqlimate service.
        id: int, optional
            Model id.
        repository_owner: str, optional
            Username of the repository owner.
        repository_organization: str, optional
            Name of the repository organization.
        repository_name: str, optional
            Name of the repository.
        disease: str, optional
            Disease code. Options: 'A90' (Dengue), 'A92.0' (Chikungunya), 'A92.5' (Zika).
        category: str, optional
            Model category. Options: 'quantitative', 'categorical', 'spatial_quantitative', etc.
        adm_level: int, optional
            ADM level. Options: 0 (National), 1 (State), 2 (Municipality), 3 (Sub-Municipality).
        time_resolution: str, optional
            Time resolution. Options: 'day', 'week', 'month', 'year'.
        imdc_year: int, optional
            The year of the IMDC the model belongs to (e.g., 2024).

    Returns
    -------
    List of Models
    """

    return Model.get(
        api_key=api_key,
        id=id,
        repository_owner=repository_owner,
        repository_organization=repository_organization,
        repository_name=repository_name,
        disease=disease,
        category=category,
        adm_level=adm_level,
        time_resolution=time_resolution,
        imdc_year=imdc_year,
    )