UnifiedMetadata Unified Metadata Object

The UnifiedMetadata object is a data container that homogenizes all other metadata readers/containers

New in version 0.1.0.

This class is the primary means by which this library is intended to be used. Specifically, this class takes a number of other metadata objects from disparate sources and seeks to homogenize the input data into a single container.

This class overrides attribute lookups (__getattr__) and uses the following logic in order to find a given attribute:

1. If the attribute is provided in the overrides dict, return the value for the given key.

2. If the attribute is in the mappings dict, the user has specified that the value should come from a specific source. Perform the attribute lookup on that source.

3. Iterate over each source in the input sources list and build a dict of found attributes where the key is source and the value is the returned value. For example: {‘SourceA’:’foo’, ‘SourceB’:’foo’, ‘SourceC’:’bar}.

4. If the previous step returns more than one instance of the source, warn the user and request that a mapping be provided to disambiguate the metadata source.

  1. If the attribute can not be found, warn the user.

  2. Return the attribute requested to the caller.

param overrides

in the form {‘key’:’value’}

type overrides

dict

param mappings

in the form {‘key’:class}, where class is one of the class definitions passed in the sources list (e.g., IsisMetadata or GDALMetadata)

type mappings

dict