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 the ts_ids_core.schema.IdsSchema subclass in the module is exported. If no ts_ids_core.schema.IdsSchema subclass is found export the module’s ts_ids_core.base.ids_element.IdsElement if there’s exactly one in the module.

2. …an import-able module and ts_ids_core.base.ids_element.IdsElement subclass, 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.

export_schema_cmd(func)[source]
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 name is not None, return only classes with this name.

  • base_class – If base_class is not None, return only classes derived from base_class.

Returns:

The Python classes, as described above.