crowsetta.formats.register_format

crowsetta.formats.register_format#

crowsetta.formats.register_format(format_class: Type) Type[source]#

Decorator to register annotation formats.

Adds class to crowsetta.formats. The decorator maps the class variable name, a string, to the class itself, so that calling crowsetta.formats.by_name() with that string will return the class.

Parameters:

format_class (class) – A class that has the required class variables and adheres to one of the interfaces defined in crowsetta.interface, either SeqLike or BBoxLike.

Returns:

format_class – The same class, unchanged. This decorator only adds the class to crowsetta.formats.FORMATS.

Return type:

class