to_json.py

View code on Github

Functions to convert data returned from the Scribe-Data CLI to JSON files.

scribe_data.cli.convert.to_json.convert_to_json(language: str, data_types: str | list[str] | None, input_file: Path, output_dir: Path, output_type: str, overwrite: bool = False, identifier_case: str = 'camel') None[source]

Convert a CSV/TSV file to JSON.

Parameters:
languagestr

The language of the file to convert.

data_typesUnion[str, List[str]]

The data type of the file to convert.

input_filePath

The input CSV/TSV file path.

output_dirPath

The output directory path for results.

output_typestr

The output format, should be “json”.

overwritebool

Whether to overwrite existing files.

identifier_casestr

The case format for identifiers. Default is “camel”.

Returns:
None

A JSON file.