API¶
Specification Interface¶
-
hallmarkfe.spec.parse_generic(arg)[source]¶ Create Hallmark specification object
Parameters: arg (object) – Specification (a dictionary) or file location (a string)
-
hallmarkfe.spec.register(cls)[source]¶ Register specification handler
Parameters: cls (class) – Handler class
-
hallmarkfe.spec.unregister(cls)[source]¶ Unregister specification handler
Parameters: cls (class) – Handler class
-
class
hallmarkfe.spec.SpecRegistry[source]¶ Bases:
objectRegistry of all the loaded specification handlers
-
classmethod
find_handler_for_schema(spec)[source]¶ Find loader for a given schema.
A class can load one or more schema types.
-
classmethod
-
class
hallmarkfe.spec.SpecMeta(name, bases, dct)[source]¶ Bases:
abc.ABCMetaMeta class for all elements with schemas. This allows for registration, validation, and tracking of the schema implementors.
-
mro() → list¶ return a type’s method resolution order
-
register(subclass)¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
-
class
hallmarkfe.spec.SpecBase(*args, **kwargs)[source]¶ Bases:
objectBase abstract class for spec implementors
-
description¶ Property-like access to specification’s description element
-
classmethod
match(schemas)[source]¶ Check if this handler can service a given set of schemas
This is a conservative function
-
name¶ Property-like access to specification’s name element
-
order= None¶ Order in which the elements must be stored/printed
-
owner¶ Property-like access to specification’s owner element
-
schema= 'global:default:v1'¶ Every Spec metadata class should specify a schema (a string or a list of strings)
-
spec= None¶ Internal dict representation of the specification
required elements: name, description
-
-
class
hallmarkfe.spec.SpecManagerBase(*args, **kwargs)[source]¶ Bases:
objectManage a specification directory
-
exception
hallmarkfe.spec.SpecNoHandler[source]¶ Bases:
ExceptionNot class to handle metadata with a given schema
-
with_traceback()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
exception
hallmarkfe.spec.SpecInvalidSchema[source]¶ Bases:
ExceptionInvalid schema definition
-
with_traceback()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-