prototype whatever in the Jupyter notebook
Project description
``whatever-forever``
====================
Create reusable, higher-order functions using declarative syntaxes in
Python.
Installation
------------
``pip install whatever-forever``
Basic Usage
-----------
Chaining in Python
~~~~~~~~~~~~~~~~~~
.. code:: python
from whatever import *
__my_chain = __x(5).range.map(lambda x: x+3).list
__my_chain
.. parsed-literal::
[3, 4, 5, 6, 7]
A random list
'''''''''''''
.. code:: python
from random import random
__random_list = __x(5).range.map(lambda x: random()).list.value()
str(__random_list)
.. parsed-literal::
'[0.10095399022711649, 0.8604968925166636, 0.008445535846122287, 0.6610363926991931, 0.6330613356373495]'
Syntactic Sugar
~~~~~~~~~~~~~~~
.. code:: python
from random import random
__x(__random_list.__()) * (lambda s: '%3.2f' % s) | list
.. parsed-literal::
['0.08', '0.06', '0.33', '0.89', '0.71']
.. code:: python
from random import random
((__x(__random_list.__()) + (lambda x: x >.5) )
* (lambda s: '%3.2f' % s)
| list
)
.. parsed-literal::
['0.80', '0.63', '0.80', '0.64']
Development
-----------
Running the Build and Tests
^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
pip install -r requirements-dev.txt
python setup.py develop
watchmedo tricks tricks.yaml
The ``watchmedo`` script will convert your notebooks to scripts and html
files. ``py.test-ipynb`` will test all notebooks matching
``test-*.ipynb``.
Running the docs
^^^^^^^^^^^^^^^^
::
jekyll serve docs -wit
Docs are hosted at ``http://localhost:4000/whatever-forever/``.
License
-------
``whatever-forever`` is released as free software under the `BSD
3-Clause
license <https://github.com/tonyfast/whatever-forever/blob/master/LICENSE>`__.
====================
Create reusable, higher-order functions using declarative syntaxes in
Python.
Installation
------------
``pip install whatever-forever``
Basic Usage
-----------
Chaining in Python
~~~~~~~~~~~~~~~~~~
.. code:: python
from whatever import *
__my_chain = __x(5).range.map(lambda x: x+3).list
__my_chain
.. parsed-literal::
[3, 4, 5, 6, 7]
A random list
'''''''''''''
.. code:: python
from random import random
__random_list = __x(5).range.map(lambda x: random()).list.value()
str(__random_list)
.. parsed-literal::
'[0.10095399022711649, 0.8604968925166636, 0.008445535846122287, 0.6610363926991931, 0.6330613356373495]'
Syntactic Sugar
~~~~~~~~~~~~~~~
.. code:: python
from random import random
__x(__random_list.__()) * (lambda s: '%3.2f' % s) | list
.. parsed-literal::
['0.08', '0.06', '0.33', '0.89', '0.71']
.. code:: python
from random import random
((__x(__random_list.__()) + (lambda x: x >.5) )
* (lambda s: '%3.2f' % s)
| list
)
.. parsed-literal::
['0.80', '0.63', '0.80', '0.64']
Development
-----------
Running the Build and Tests
^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
pip install -r requirements-dev.txt
python setup.py develop
watchmedo tricks tricks.yaml
The ``watchmedo`` script will convert your notebooks to scripts and html
files. ``py.test-ipynb`` will test all notebooks matching
``test-*.ipynb``.
Running the docs
^^^^^^^^^^^^^^^^
::
jekyll serve docs -wit
Docs are hosted at ``http://localhost:4000/whatever-forever/``.
License
-------
``whatever-forever`` is released as free software under the `BSD
3-Clause
license <https://github.com/tonyfast/whatever-forever/blob/master/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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
whatever_forever-0.1.4-py3.5.egg
(12.9 kB
view details)
File details
Details for the file whatever-forever-0.1.4.tar.gz.
File metadata
- Download URL: whatever-forever-0.1.4.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57c3a544c9ee6b67dd2a50b7ea00146b4f8ac21ecdad75450bebba305d69b144
|
|
| MD5 |
8bc49f2033da69409e492eb7c2d2b799
|
|
| BLAKE2b-256 |
cdaec9907849d584094c8669fe589825a6d2524d17a460f77a79370ef8395b87
|
File details
Details for the file whatever_forever-0.1.4-py3.5.egg.
File metadata
- Download URL: whatever_forever-0.1.4-py3.5.egg
- Upload date:
- Size: 12.9 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07ff3dc76107b5adfd814385f88566182b8472f8be52691c1b905263481fc99c
|
|
| MD5 |
309d44f3194c57ad64b41b6d5161bb40
|
|
| BLAKE2b-256 |
3c60079751cbf63df5dc9da96d7e5073a1bbda94876fd03ee0826ae54f5375d1
|