doc_maker

Contsructor to take a Python dict containing an API Documentation and create a HydraDoc object for it

hydra_python_core.doc_maker.check_namespace(id_: str = None) → str

A helper method to check if the classes and properties are in the same namespace and if not bring them into the right namespace :param id_ The id to check :return: correct url

hydra_python_core.doc_maker.create_class(expanded_class: Dict[str, Any], endpoint: bool)hydra_python_core.doc_writer.HydraClass

Creates HydraClass from the expanded API document;

Parameters
  • apidoc – object of HydraDoc type

  • expanded_class – the expanded class

  • endpoint – boolean True if class is an endpoint, False if class is not endpoint

Returns

HydraClass object that can be added to api doc

hydra_python_core.doc_maker.create_collection(endpoint_collection: Dict[str, Any])hydra_python_core.doc_writer.HydraCollection

Creates the instance of HydraCollection from expanded APIDOC

Parameters

endpoint_collection – creates HydraCollection from expanded API doc

Returns

instance of HydraCollection

hydra_python_core.doc_maker.create_doc(doc: Dict[str, Any], HYDRUS_SERVER_URL: str = None, API_NAME: str = None)hydra_python_core.doc_writer.HydraDoc

Create the HydraDoc object from the API Documentation.

Parameters
  • doc – dictionary of hydra api doc

  • HYDRUS_SERVER_URL – url of the hydrus server

  • API_NAME – name of the api

Returns

instance of HydraDoc which server and agent can understand

Raises

SyntaxError – If the doc doesn’t have an entry for @id , @context, @type key.

Creates the instances of HydraLink

Parameters

supported_property – expanded Property

Returns

instance of HydraLink

hydra_python_core.doc_maker.create_operation(supported_operation: Dict[str, Any])hydra_python_core.doc_writer.HydraClassOp

Creates the instance of HydraClassOp

Parameters

supported_operation – The expanded supported operation from the API DOC

Returns

HydraClassOp

hydra_python_core.doc_maker.create_property(supported_property: Dict[str, Any]) → Union[hydra_python_core.doc_writer.HydraLink, hydra_python_core.doc_writer.HydraClassProp]

Creates the HydraClassProp from the expanded supported property

Parameters

supported_property – supported property dict from the expanded api doc

Returns

HydraClassProp

hydra_python_core.doc_maker.create_status(possible_status: List[Any]) → List[hydra_python_core.doc_writer.HydraStatus]

Creates instance of HydraStatus from expanded API doc

Parameters

possible_status – possible status from the expanded API doc

Returns

List of instances of HydraStatus