cmem_client.models.package¤
Marketplace package models.
A marketplace package bundles graphs, projects and Python packages into one installable
unit. The packages installed in a deployment are the items of
client.marketplace_packages, keyed by their package ID, while the packages a
marketplace server offers are browsed through client.marketplace.
Classes:
- Package – Installed marketplace package.
- PackageInstallationMetadata – Metadata about how and when a marketplace package was installed.
- PackageLock – Package lock.
- PackageMetadata – Package metadata.
Package¤
Bases: ReadRepositoryItem
Installed marketplace package.
Represents a package installed in Corporate Memory with all its metadata, file specifications, and version information as stored in the marketplace catalog graph.
Attributes:
- package_version (
PackageVersion) – Manifest and contents of the installed version. Itsmanifest.package_idis the key of the repository. - installation_metadata (
PackageInstallationMetadata | None) – How and when the package was installed, orNonefor a package installed before this was recorded.
Functions:
- get_id – Get the package identifier.
get_id¤
Get the package identifier.
Returns:
str– The package_id which uniquely identifies this package.
installation_metadata¤
model_config¤
package_version¤
PackageInstallationMetadata¤
Bases: Model
Metadata about how and when a marketplace package was installed.
This metadata is stored as JSON in the RDF graph and used to determine whether packages can be automatically removed when they are dependencies.
Attributes:
- dependency_level (
int) – Depth at which the package was pulled in.0means it was installed directly, anything above that means it came in as a dependency and may be removed again with the package which required it. - installed_at (
datetime) – When the package was installed. - python_dependency_already_existed (
list[str]) – Python dependencies of the package which were already installed beforehand, so uninstalling must leave them alone. - package_dependency_already_existed (
list[str]) – Marketplace packages this one depends on which were already installed beforehand. - origin_type (
Literal[‘file’, ‘marketplace’] | None) – Where the package came from, amarketplaceserver or a localfile.Nonefor packages installed before this was tracked. - origin_url (
str | None) – URL of the marketplace server the package came from. Only set whenorigin_typeismarketplace.
dependency_level¤
installed_at¤
is_direct_installed¤
Indicates whether this package was installed directly
model_config¤
origin_type¤
origin_url¤
package_dependency_already_existed¤
python_dependency_already_existed¤
PackageLock¤
Bases: BaseModel
Package lock.
A lock is written for the duration of an install or uninstall, so two clients do not work on the same package at once.
Attributes:
- package_id (
str) – ID of the locked package. - timestamp (
datetime) – When the activity started. - user_account (
str) – Account which started the activity. - activity (
Literal[‘Install’, ‘Uninstall’]) – What is being done,InstallorUninstall.
activity¤
package_id¤
timestamp¤
user_account¤
PackageMetadata¤
Bases: Model
Package metadata.
Attributes:
- name (
str) – Human readable name of the package. - description (
str) – What the package provides. - comment (
str | None) – Additional remark about the package.