obspy.core.util.attribdict.AttribDict¶
- class AttribDict(*args, **kwargs)[source]¶
Bases: _abcoll.MutableMapping
A class which behaves like a dictionary.
Parameters: data (dict, optional) Dictionary with initial keywords. Basic Usage
You may use the following syntax to change or access data in this class.
>>> stats = AttribDict() >>> stats.network = 'BW' >>> stats['station'] = 'ROTZ' >>> print(stats.get('network')) BW >>> print(stats['network']) BW >>> print(stats.station) ROTZ >>> x = stats.keys() >>> x = sorted(x) >>> print(x[0], x[1]) network station
Attributes
__abstractmethods__ frozenset() -> empty frozenset object __dict__ __doc__ unicode(string [, encoding[, errors]]) -> object __hash__ __module__ str(object) -> string __weakref__ list of weak references to the object (if defined) defaults dict() -> new empty dictionary readonly list() -> new empty list Public Methods
clear copy get items iteritems iterkeys itervalues keys pop popitem setdefault update values Private Methods
_pretty_str Return better readable string representation of AttribDict object. Special Methods
__contains__ __deepcopy__ __delattr__ __delitem__ __eq__ __getattr__ Py3k hasattr() expects an AttributeError no KeyError to be __getitem__ __getstate__ __init__ An AttribDict can be initialized in two ways. It can be given an __iter__ __len__ __ne__ __repr__ __setattr__ __setitem__ __setstate__ __subclasshook__