Metadata-Version: 2.1
Name: formation
Version: 0.1.11
Summary: A generic functional middleware infrastructure for Python.
Home-page: https://github.com/jondot/formation
License: MIT
Keywords: flask,django,requests,middleware,functional
Author: Dotan Nahum
Author-email: jondotan@gmail.com
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Provides-Extra: lint
Requires-Dist: cytoolz (>=0.9.0,<0.10.0)
Requires-Dist: requests (>=2.20,<3.0)
Requires-Dist: toolz (>=0.9.0,<0.10.0)
Project-URL: Documentation, https://github.com/jondot/formation
Project-URL: Repository, https://github.com/jondot/formation
Description-Content-Type: text/markdown

![](media/cover.png)

# Formation

A generic functional middleware infrastructure for Python.

Take a look:

```py
from datetime.datetime import now
from formation import wrap
from requests import get

def log(ctx, call):
    print("started")
    ctx = call(ctx)
    print("ended")
    return ctx

def timeit(ctx, call):
    started = now()
    ctx = call(ctx)
    ended = now() - started
    ctx['duration'] = ended
    return ctx

def to_requests(ctx):
    get(ctx['url'])

fancy_get = wrap(to_requests, middleware=[log, timeit])
fancy_get({'url':'https://google.com'})
```

## Quick Start

Install using pip/pipenv/etc. (we recommend [poetry](https://github.com/sdispater/poetry) for sane dependency management):

```
$ poetry add formation
```

### Thanks:

To all [Contributors](https://github.com/jondot/formation/graphs/contributors) - you make this happen, thanks!

# Copyright

Copyright (c) 2018 [@jondot](http://twitter.com/jondot). See [LICENSE](LICENSE.txt) for further details.
