json
ensembl.io.genomio.schemas.json
¶
Handling and verification of JSON schemas module.
schema_factory(manifest_dir, metadata_types, output_dir)
¶
Generates one JSON file per metadata type inside manifest
, including "manifest.json" itself.
Each JSON file will have the file name of the metadata type, e.g. "seq_region.json".
Parameters:
Name | Type | Description | Default |
---|---|---|---|
manifest_dir
|
PathLike
|
Path to the folder with the manifest JSON file to check. |
required |
metadata_types
|
List[str]
|
Metadata types to extract from |
required |
output_dir
|
PathLike
|
Path to the folder where to generate the JSON files. |
required |
Source code in src/python/ensembl/io/genomio/schemas/json/factory.py
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 57 58 59 60 61 62 63 |
|
schema_validator(json_file, json_schema)
¶
Validates a JSON file with the provided JSON schema.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
json_file
|
PathLike
|
Path to the JSON file to check. |
required |
json_schema
|
Union[str, PathLike]
|
JSON schema to validate |
required |
Source code in src/python/ensembl/io/genomio/schemas/json/validate.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
|