Metadata Python Module¶
Contents:
This is the metadata library.
The pacifica.uploader.metadata module exports classes and methods for manipulating and serializing the metadata for bundles of files.
Encoding and decoding to the JSON data format is supported for compatible objects (see pacifica.uploader.metadata.Json module for more information).
-
class
pacifica.uploader.metadata.MetaData(*args, **kwargs)[source]¶ Class to hold a list of MetaObj and FileObj objects.
This class is a sub-class of
listthat implements the index protocol (__getitem__,__setitem__and__delitem__) as a proxy to the indices of the value of themetaIDfield of the associated instance of thepacifica.uploader.metadata.MetaObjclass.Instances of this class are upper-level objects that provide the metadata for interacting with the designated Pacifica Ingest server.
-
class
pacifica.uploader.metadata.MetaObj[source]¶ MetaObj class holding a specific metadata element.
Instances of this class represent units of metadata whose representation is disjoint to a file, i.e., units of metadata that are describe but are not stored as part of a file.
-
class
pacifica.uploader.metadata.FileObj[source]¶ FileObj class for holding file metadata.
Instances of this class represent individual files, including both the data and metadata for the file. During a file upload, instances of this class are automatically associated with new instances of the
pacifica.uploader.metadata.MetaDataclass.The above named fields are identical to those of the
pacifica.metadata.orm.Filesclass, provided by the Pacifica Metadata library.
-
class
pacifica.uploader.metadata.MetaUpdate(user, *args, **kwargs)[source]¶ Class to update the MetaData object.
This class is a sub-class of the
pacifica.uploader.metadata.MetaDataclass that is specialized to issue and handle queries to Pacifica Policy servers.-
__init__(user, *args, **kwargs)[source]¶ Pull the user from the arguments so we can use that for policy queries.
-
-
pacifica.uploader.metadata.metadata_encode(md_obj)[source]¶ Encode the MetaData object into a json string.
This method encodes the given instance of the
pacifica.uploader.metadata.MetaDataclass,md_obj, as a JSON object, and then returns its JSON serialization.Associated instances of the
pacifica.uploader.metadata.MetaObjandpacifica.uploader.metadata.FileObjclasses are automatically included in the JSON object and the resulting JSON serialization.
-
pacifica.uploader.metadata.metadata_decode(json_str)[source]¶ Decode the json string into MetaData object.
This method deserializes the given JSON source,
json_str, and then returns a new instance of thepacifica.uploader.metadata.MetaDataclass.The new instance is automatically associated with new instances of the
pacifica.uploader.metadata.MetaObjandpacifica.uploader.metadata.FileObjclasses.