Label

The label base class for the label manager.

class disseminate.label_manager.types.label.Label(doc_id, id, kind, order=None)

Bases: object

A label used for referencing.

Parameters
doc_idstr

The unique identifier (for documents within a label manager) for the document that owns the label.

idstr

The unique identifier(s) of the label. ex: ‘nmr_introduction’. This should be unique for the entire project.

kindTuple[str]

The kind of the label is a tuple that identifies the kind of a label from least specific to most specific. ex: (‘figure’,), (‘chapter’,), (‘equation’,), (‘heading’, ‘chapter’,)

orderOptional[Tuple[int]]

The order/number of the label. The order is a tuple of integers with a length that matches the ‘kind’ tuple. Each entry represents the order/number of each kind ex: for a kind (‘heading’, ‘chapter’) could have an order of (3, 2) which would represent the 3rd ‘heading’ and 2nd ‘chapter’ item. Some of the orders may be reset, but the first item should not–e.g. the ‘heading’ count should represent the running count of all headings, while the chapter count may be reset. This ensures that the order of labels is preserved when the counter of sub-kinds are reset. (see OrderLabels)

property number

The number for the label’s most specific kind.