codelists
Format the usage codelist into a convenient JSON file for the JavaScript app.
Functions:
| Name | Description |
|---|---|
format_codelist_json |
Helper script to format the CSV codelist into a more convenient JSON file. |
format_codelist_json(input_csv_path, output_json_path)
Helper script to format the CSV codelist into a more convenient JSON file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_csv_path
|
pathlib.Path
|
The input CSV path to the codelist. |
required |
output_json_path
|
pathlib.Path
|
The output JSON path of the formatted codelist. |
required |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If a code is duplicated in the input. |
RuntimeError
|
If a CSV row does not have a code. |
Source code in python/src/data_pipeline/utils/codelists.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |