prototype whatever in the Jupyter notebook
Project description
from whatever import *
whatever-forever
Syntactic sugar to build complex functions in Python; it’s just a class.
Multiple dispatching dicts.
Stupid easy cell magics.
Chaining
Chain and _X
Chain(5).range.list
[0, 1, 2, 3, 4]
_X(5) | range | list
[0, 1, 2, 3, 4]
A random list
from random import random
random_list = _X(5).range | map(lambda x: random()) > list
str(random_list)
'[0.9935285316596995, 0.014724817177512728, 0.8948846635050951, 0.8599661767263426, 0.2981499631390274]'
from random import random
_X(random_list) * (lambda s: '%3.2f' % s) | list
['0.99', '0.01', '0.89', '0.86', '0.30']
from random import random
((_X(random_list) + (lambda x: x >.5) )
* (lambda s: '%3.2f' % s)
| list
)
['0.99', '0.89', '0.86']
magical
Easy to construct cell magics
Cell Magics
Create a jinja to Markdown magic.
from jinja2 import Template
@magical('jinja2', lang='jinja2', display='Markdown')
def render_jinja_with_globals(cell):
return Template(cell).render(**globals())
Development
Running test and the docs server.
watchmedo tricks tricks.yaml jekyll serve docs -wit
License
whatever-forever is released as free software under the BSD 3-Clause license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for whatever_forever-0.0.13-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ec7a967d823e7b97783498ec1154a9ec5094d412fd34ed92192c21f5a527573 |
|
MD5 | a23b98eaf152553627ad06d8c6633c82 |
|
BLAKE2b-256 | 7195891d709a1f1a10a61cbef8e17c9844aa76ac129d9fbc100467d14aec5233 |