Metadata Python Module¶
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
list
that implements the index protocol (__getitem__
,__setitem__
and__delitem__
) as a proxy to the indices of the value of themetaID
field of the associated instance of thepacifica.uploader.metadata.MetaObj
class.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.MetaData
class.The above named fields are identical to those of the
pacifica.metadata.orm.Files
class, 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.MetaData
class 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.MetaData
class,md_obj
, as a JSON object, and then returns its JSON serialization.Associated instances of the
pacifica.uploader.metadata.MetaObj
andpacifica.uploader.metadata.FileObj
classes 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.MetaData
class.The new instance is automatically associated with new instances of the
pacifica.uploader.metadata.MetaObj
andpacifica.uploader.metadata.FileObj
classes.