datacatalog.jsonschemas.objects package

Submodules

datacatalog.jsonschemas.objects.pjso module

exception datacatalog.jsonschemas.objects.pjso.PjsCacheMiss[source]

Bases: Exception

Raised when a class object could not be loaded from its cache file

datacatalog.jsonschemas.objects.pjso.get_class_object(schema_dict, classname=None, use_cache=True)[source]
datacatalog.jsonschemas.objects.pjso.get_class_object_from_dict(schema, classname=None, cache_dir=None, use_cache=True)[source]

Instantiate a Python class from a dict

Parameters:
  • schema (dict) – A dict containing a JSON schema document
  • classname (str, optional) – Name of the instantiated class to return. Optional if only one class is defined by the schema document.
Returns:

A Python class named after and defined by the schema document

Return type:

class

datacatalog.jsonschemas.objects.pjso.get_class_object_from_file(schema_file, classname=None, use_cache=True)[source]

Instantiate a Python class object from a JSONschema file

Parameters:
  • schema_file (str) – Path to a file holding a JSONschema document
  • classname (str, optional) – Name of the instantiated class to return. Optional if only one class is defined by the schema document.
Returns:

A Python class named after and defined by the schema

Return type:

class

datacatalog.jsonschemas.objects.pjso.get_class_object_from_uri(schema_uri, classname=None, use_cache=True)[source]

Instantiate a Python class object from a JSONschema URI

Parameters:
  • schema_uri (str) – URI for a JSONschema document
  • classname (str, optional) – Name of the instantiated class to return. Optional if only one class is defined by the schema document.
Returns:

A Python class named after and defined by the schema

Return type:

class