Middleware for every occasion
Project description
mediate
Middleware for every occasion
Installation
pip install mediate
Usage
import mediate
middleware = mediate.Middleware()
@middleware
def shout(call_next, name):
return call_next(name.upper())
@middleware
def exclaim(call_next, name):
return call_next(name + '!')
@middleware.bind
def hello(name):
print(f'Hello, {name}')
>>> hello('sam')
Hello, SAM!
>>>
>>> middleware.remove(shout)
>>> hello('sam')
Hello, sam!
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
mediate-0.1.4.tar.gz
(2.7 kB
view hashes)