ts_ids_core.scripts.programmatic_ids_to_jsonschema module¶
- convert_programmatic_ids_to_jsonschema(ids_location: str) Dict[str, Any][source]¶
Generate the JSON Schema of the import-able Python object.
- Parameters:
ids_location –
The ‘location’ of the IDS class to export to JSON Schema. This may be…
1. …an import-able module, e.g.
my_ids_package.my_subpackage, in which case thets_ids_core.schema.IdsSchemasubclass in the module is exported. If nots_ids_core.schema.IdsSchemasubclass is found export the module’sts_ids_core.base.ids_element.IdsElementif there’s exactly one in the module.2. …an import-able module and
ts_ids_core.base.ids_element.IdsElementsubclass, e.g.my_ids_package.my_subpackage.MyIds.WARNING: The specified Python module will be imported, so it should have no consequential side effects.
- Returns:
The JSON schema as a Python dictionary.
- get_module_classes(module: ModuleType, *, name: str | None = None, base_class: Type[IdsElement] | None = None) List[Type[IdsElement]][source]¶
Return the classes defined in a Python module.
- Parameters:
module – The module to return the classes of.
name – If
nameis notNone, return only classes with this name.base_class – If
base_classis notNone, return only classes derived frombase_class.
- Returns:
The Python classes, as described above.