pystreaming.listlib package¶
Submodules¶
pystreaming.listlib.circulardict module¶
- class pystreaming.listlib.circulardict.CircularOrderedDict(maxsize)[source]¶
Bases:
objectA dictionary that never exceeds a given size. If the size limit is reached, the least recently inserted element is removed.
- Parameters
maxsize (int) – Maximum size of the dictionary.
- Raises
ValueError – Raised if maxsize argument is not a positve integer.
- insert_end(key, value)[source]¶
Insert key-value pair into end of dictionary. If the key already exists, the key-value pair will be moved to the end of the dictionary and the value will be updated.
- Parameters
key (pyobj) – Key in key-value pair.
value (pyobj) – Value in key-value pair.
pystreaming.listlib.circularlist module¶
- class pystreaming.listlib.circularlist.CircularList(maxsize=10)[source]¶
Bases:
objectInitialize a Circular List with maximum size.
- Parameters
maxsize (int, optional) – Maximum number of elements the list can store before it begins to overwrite old elements. Defaults to 10.
- Raises
ValueError – Raised if maxsize argument is not a positve integer.
- full()[source]¶
Check whether the current list size is the maximum size.
- Returns
True if full else False.
- Return type
boolean