isaricanalytics.isaric_data_schema

isaricanalytics.isaric_data_schema.transform_to_isaric_data_schema(parser_file: str | Path, data_file: str | Path, arc_version: str | None = None, /, *, as_vertex_data: bool = False) → dict[str, DataFrame][source]

dict : ISARIC schema-compliant short/core- and long-format datasets as Pandas dataframes, with optional VERTEX-style output.

Parameters:
parser_filestr or pathlib.Path

The parser TOML file path.

data_filestr or pathlib.Path

The data file path.

arc_versionstr or None, default=None

Optional ARC version string used to fetch the ARC data dictionary associated with the ARC version; defaults to None.

as_vertex_databool, default=False

Optional indicator of whether to return the data as a VERTEX-style dictionary in the format:

{
    "df_map": <one-row-per-patient dataframe>,
    "daily": <patient observations dataframe>,
    "dictionary": <ARC data dictionary>
}
Returns:
dict

A dict which could be in one of two forms:

{
    "core": <ISARIC data schema core table>,
    "long": <ISARIC data schema long table>
}

or, if as_vertex_data:

{
    "df_map": <one-row-per-patient dataframe>,
    "daily": <patient observations dataframe>,
    "dictionary": <ARC data dictionary>
}
Raises
IsaricDataSchemaTransformationException

In case of an ARC API client exception.