Firebird-uuid Reference¶
- firebird.uuid.ROOT_SPEC = 'https://raw.githubusercontent.com/FirebirdSQL/firebird-uuid/master/root.oid'¶
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
- firebird.uuid.IANA_ROOT_NAME = 'iso.org.dod.internet.private.enterprise'¶
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
- firebird.uuid.oid_registry = OIDRegistry([])¶
Firebird OID registry.
- firebird.uuid.get_specification(url: str) str [source]¶
Returns YAML text of OID specification from URL.
- firebird.uuid.get_specifications(root: str = 'https://raw.githubusercontent.com/FirebirdSQL/firebird-uuid/master/root.oid') Tuple[Dict[str, str], Dict[str, Exception]] [source]¶
Function traverses the tree of OID YAML specifications, and returns accessible YAML specifications and errors encountered during tree traversal.
This function does not perform any validation of loaded specifications beoynd checks and transformations needed to parse the YAML to get links to child specifications.
- Returns tuple with two dictionaries:
First dictionary contains
url: spec_yaml
with all YAML specifications that were successfuly fetched.Second dictionary contains
url: Exception
with all errors encountered during tree traversal.
- firebird.uuid.parse_specifications(specifications: Dict) Tuple[Dict[str, Dict], Dict[str, Exception]] [source]¶
Function that parses OID YAML specifications.
- Returns tuple with two dictionaries:
First dictionary contains
url: spec_dict
, where dictionaries contain data from successfuly parsed and validated OID YAML specifications.Second dictionary contains
url: Exception
with errors encountered during parsing and validation.
- class firebird.uuid.NodeType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
Enum
- LEAF = 'leaf'¶
- NODE = 'node'¶
- PRIVATE = 'private'¶
- ROOT = 'root'¶
- class firebird.uuid.Node(*, parent: Node | None = None, oid: str | None = None, number: int | None = None, name: str | None = None, description: str | None = None, contact: str | None = None, email: str | None = None, site: str | None = None, parent_spec: str | None = None, node_spec: str | None = None, node_type: str | None = None)[source]¶
Bases:
Distinct
OID node.
- Parameters:
oid (Optional[str]) – Node OID. When
None
, OID is constructed from parent OID andnumber
parameter.number (Optional[int]) – Node order number in parent. Part of node OID for child nodes.
name (Optional[str]) – Node name.
description (Optional[str]) – Node description.
contact (Optional[str]) – Contact person for this node.
email (Optional[str]) – E-mail of contact person.
site (Optional[str]) – URL to home site of node maintainer
parent_spec (Optional[str]) – URL to YAML specification of parent node. If not specified, it’s taken from
parent
node.node_spec (Optional[str]) – URL to node TAML specification
node_type (Optional[str]) – Node type. If not specified, it’s derived from
node_spec
.
- as_toml_dict() Dict [source]¶
Returns dictionary with instance data suitable for storage in TOML format (values that are not of basic type are converted to string).
- Return type:
- classmethod from_spec(spec_url: str, data: Dict, parent: Node | None = None) Node [source]¶
Returns new node from specification.
- class firebird.uuid.OIDRegistry(data: Mapping | Sequence | Registry = None)[source]¶
Bases:
Registry
Firebird OID registry.
- Parameters:
data (Union[Mapping, Sequence, Registry]) –
- get_root() Node | None [source]¶
Returns ROOT node, or None if root node is not registered.
- Return type:
Node | None