imflib.pkl

st0429-8-2007: Packing List

class imflib.pkl.Asset(hash: str, size: int, type: str, hash_algorithm: str = 'http://www.w3.org/2000/09/xmldsig#sha1', id: ~uuid.UUID = <factory>, original_file_name: ~typing.Optional[~imflib.UserText] = None, annotation_text: ~typing.Optional[~imflib.UserText] = None)

Bases: object

An asset packed into this IMF package

annotation_text: Optional[UserText] = None

Optional description of the asset

classmethod from_xml(xml: Element, ns: dict) Asset

Create an asset from an XML element

hash: str

Base64-encoded message digest of the asset

hash_algorithm: str = 'http://www.w3.org/2000/09/xmldsig#sha1'

Name of the digest type used by the hash

id: UUID

Unique asset identifier encoded as a urn:UUID [RFC 4122]

original_file_name: Optional[UserText] = None

Optional original file name of the asset when the PKL was created

size: int

File size of the asset in bytes

type: str

MIME-type of the asset

class imflib.pkl.Pkl(issuer: ~imflib.UserText, creator: ~imflib.UserText, issue_date: ~datetime.datetime = <factory>, assets: list['Asset'] = <factory>, id: ~uuid.UUID = <factory>, annotation_text: ~typing.Optional[~imflib.UserText] = None, group_id: ~typing.Optional[~uuid.UUID] = None, icon_id: ~typing.Optional[~uuid.UUID] = None, security: ~typing.Optional[~imflib.Security] = None)

Bases: object

An IMF PKL Packing List

annotation_text: Optional[UserText] = None

Optional description of the distribution package

assets: list['Asset']

The list of Asset s contained in this package

creator: UserText

The facility or system that created this PKL

classmethod from_file(path: str) Pkl

Parse an existing PKL from a given file path

classmethod from_xml(xml: Element, ns: Optional[dict] = None) Pkl

Parse a PKL from XML

get_asset(id: str) Asset

Get an Asset from the PKL based on the URN ID

group_id: Optional[UUID] = None

Optional UUID referencing a group of multiple packages to which this package belongs

icon_id: Optional[UUID] = None

Optional UUID reference to an image asset to be used as an icon

id: UUID

Unique package identifier encoded as a urn:UUID [RFC 4122]

issue_date: datetime

Datetime this PKL was issued

issuer: UserText

The person or company that issued this PKL

security: Optional[Security] = None

Optional digital signer and signature authenticating the PKL

property total_size: int

Total size of assets in bytes