scitacean.PID#
- class scitacean.PID(*, pid, prefix=None)[source]#
Stores the persistent identifier of a database item.
The ID is split into a prefix and the main identifier. The prefix identifies an instance of SciCat and the main identifier a dataset.
The two components are merged using a “/”, i.e.
full_id = PID.prefix + "/" + PID.pid
Equivalently,
str
can be used to construct the full id:full_id = str(PID)
Constructors
__init__
(*, pid[, prefix])Initialize an instance from individual components.
parse
(x)Build a PID from a string.
Methods
Attributes
Main part of the ID.
Prefix part of the ID if there is one.
Return a new PID with the prefix set to None.
- classmethod generate(*, prefix=None)[source]#
Create a new unique PID.
Uses UUID4 to generate the ID.