splendid

Splendid, a collection of useful, small python tools.


Keywords
splendid, tools, utils, wrappers, useful, small, often, needed, chunker, decorators, helper-functions, helpers, itertools, json, json-path-getter, library, python, python-library, timedelta, timing
License
MIT
Install
pip install splendid==1.0.0.dev0

Documentation

splendid

splendid is a collection of useful small python tools to make your life easier.

Visit us on https://github.com/pythoncircus/splendid !

Some Examples

>>> from splendid import chunker
>>> list(chunker([1, 2, 3, 4, 5], 3))
[[1, 2, 3], [4, 5]]

>>> from splendid import get_path
>>> get_path({'foo':[{'bar':3}]}, ['foo'], 'not found')
[{'bar': 3}]
>>> get_path({'foo':[{'bar':3}]}, ['foo', 'bar'], 'not found')
'not found'
>>> get_path({'foo':[{'bar':3}]}, ['foo', 0, 'bar'], 'not found')
3
>>> get_path({'foo':[{'bar':3}]}, ['foo', 0], 'not found')
{'bar': 3}

>>> from splendid import run_once
>>> @run_once
... def foo():
...     print('bar')
>>> for i in range(10):
...     foo()
bar