:mod:`viz.amount` ================= .. py:module:: viz.amount Module Contents --------------- .. py:class:: Amount(amount_string='0 VIZ') Bases: :class:`dict` .. autoapi-inheritance-diagram:: viz.amount.Amount :parts: 1 :private-bases: This class helps deal and calculate with the different assets on the chain. :param str amount_string: Amount string as used by the backend (e.g. "10 VIZ") .. attribute:: __repr__ .. attribute:: __truediv__ .. attribute:: __truemul__ .. method:: amount(self) :property: .. method:: symbol(self) :property: .. method:: asset(self) :property: .. method:: __str__(self) .. method:: __float__(self) .. method:: __int__(self) .. method:: __add__(self, other) .. method:: __sub__(self, other) .. method:: __mul__(self, other) .. method:: __floordiv__(self, other) .. method:: __div__(self, other) .. method:: __mod__(self, other) .. method:: __pow__(self, other) .. method:: __iadd__(self, other) .. method:: __isub__(self, other) .. method:: __imul__(self, other) .. method:: __idiv__(self, other) .. method:: __ifloordiv__(self, other) .. method:: __imod__(self, other) .. method:: __ipow__(self, other) .. method:: __lt__(self, other) .. method:: __le__(self, other) .. method:: __eq__(self, other) .. method:: __ne__(self, other) .. method:: __ge__(self, other) .. method:: __gt__(self, other) .. method:: __contains__() True if the dictionary has the specified key, else False. .. method:: __delattr__() Implement delattr(self, name). .. method:: __delitem__() Delete self[key]. .. method:: __dir__() Default dir() implementation. .. method:: __format__() Default object formatter. .. method:: __getattribute__() Return getattr(self, name). .. method:: __getitem__() x.__getitem__(y) <==> x[y] .. method:: __iter__() Implement iter(self). .. method:: __len__() Return len(self). .. method:: __reduce__() Helper for pickle. .. method:: __reduce_ex__() Helper for pickle. .. method:: __setattr__() Implement setattr(self, name, value). .. method:: __setitem__() Set self[key] to value. .. method:: __sizeof__() D.__sizeof__() -> size of D in memory, in bytes .. method:: __subclasshook__() Abstract classes can override this to customize issubclass(). This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached). .. method:: clear() D.clear() -> None. Remove all items from D. .. method:: copy() D.copy() -> a shallow copy of D .. method:: get() Return the value for key if key is in the dictionary, else default. .. method:: items() D.items() -> a set-like object providing a view on D's items .. method:: keys() D.keys() -> a set-like object providing a view on D's keys .. method:: pop() D.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised .. method:: popitem() D.popitem() -> (k, v), remove and return some (key, value) pair as a 2-tuple; but raise KeyError if D is empty. .. method:: setdefault() Insert key with a value of default if key is not in the dictionary. Return the value for key if key is in the dictionary, else default. .. method:: update() D.update([E, ]**F) -> None. Update D from dict/iterable E and F. If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k] .. method:: values() D.values() -> an object providing a view on D's values