lamindb.core.IsVersioned¶
- class lamindb.core.IsVersioned¶
Bases:
Model
Base class for versioned models.
Attributes¶
- property stem_uid: str¶
Universal id characterizing the version family.
The full uid of a record is obtained via concatenating the stem uid and version information:
stem_uid = random_base62(n_char) # a random base62 sequence of length n_char version_uid = encode_base62(md5_hash(version))[:4] # version is, e.g., "1" or "2.1.0" or "2022-03-01" uid = f"{stem_uid}{version_uid}" # concatenate the stem_uid & version_uid
- property versions: QuerySet¶
Lists all records of the same version family.
>>> new_artifact = ln.Artifact(df2, is_new_version_of=artifact) >>> new_artifact.save() >>> new_artifact.versions()
Fields¶
-
version:
str
¶ Version (default
None
).Defines version of a family of records characterized by the same
stem_uid
.Consider using semantic versioning with Python versioning.
Methods¶