AG

Angelo Gladding
lahacker.net

dlv5vbq7lzlthol5 4b942a3185b37d00

Home CodewebAPI

web

tools for a metamodern web environment

Strongly influenced by Aaron Swartz' "anti-framework" `web.py` this library aims to cleanly abstract low-level web functionality through a Pythonic API.

Think about the ideal way to write a web app. Write the code to make it happen.

--- Aaron Swartz

Descendants

Members

Globals

form

<class 'type'>

['__class__', '__contains__', '__delattr__', '__delitem__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattr__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'clear', 'copy', 'fromkeys', 'get', 'items', 'keys', 'pop', 'popitem', 'setdefault', 'update', 'values']

tx

<class 'web.Transaction'>

['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'db', 'host', 'kv', 'log', 'origin', 'owner', 'request', 'response', 'user', 'view']

Functions

application(name, *wrappers, prefix='', mount_prefix='', **path_args)

listing A A

serve(app_name, processes=3, threads=20, max_requests=100, lifespan=60)

serve callable `app` at given `port`

listing A A

listing A A

best_match(handlers, *args, **kwargs)

listing A A

anti_csrf(handler)

listing A A

get_nonce()

listing A A

get_token(nonce)

return a token for given `secret` and `nonce`

listing A A

secure_form(*args, **kwargs)

listing A A

sessions(**defaults)

returns an application hook for session handling using given redis `db`

listing B A

require_auth(*roles)

listing A A

Classes

Application

a web application

reload_config(self, path=None)

listing A A

add_wrappers(self, *wrappers)

listing A A

add_path_args(self, **path_args)

listing A A

get(self, path)

listing A A

wrap(self, handler)

decorate a generator to run at various stages during the request

listing A A

route(self, path_template=None)

decorate a class to run when request path matches template

listing A A

mount(self, *apps)

add an `application` to run when request path matches template

listing A A

try_socket(self)

listing A A

get_controller(self, path)

listing C A

get_handler(self, controller, method='GET')

listing A A

__repr__(self)

listing A A

__call__(self, environ, start_response)

WSGI callable

listing C A

Metrics

full listing

Lines of Code

Source Docstrings Comments
830 0 168