yadg.core package

yadg.core.infer_datagram_handler(parser)

Helper function to distribute work to parsers.

Parameters:

parser (str) – Name of the parser from schema.

Returns:

(process, version) – A tuple containing the handler function as Callable and the handler version as str.

Return type:

tuple[Callable, str]

yadg.core.process_schema(dataschema, strict_merge=False)

Main worker function of yadg.

Takes in a DataSchema object and returns a single annotated datagram created from the dataschema. It is the job of the user to supply a validated schema.

Parameters:

dataschema (DataSchema) – A fully validated dataschema object.

Returns:

datagram – An unvalidated datagram. The parsers included in yadg should return a valid datagram; any custom parsers might not do so. Use the function yadg.core.validators.validate_datagram() to validate the resulting datagram.

Return type:

DataTree