Convenient routing for a flask application
Project description
Flouter (Flask Router) is a convenience add-on for the Flask library. It converts a directory structure into valid routes for a Flask application. This allows developers to quickly layout complex applications, and easily navigate to existing code. This library is under heavy development and may not yet support a feature you need. If that is the case, please submit a feature request so the library can continue to improve.
Installing
Install and update using pip:
pip install -U flouter
Basic Usage
Flouter will convert the following routes directory structure…
routes/
|-- api/
|-- index.py
|-- echo.py
|-- _foo.py
…to the corresponding routes in a flask application.
/api/
/api/echo/
/api/<foo>
In one of these files, methods are defined by simple named functions that are called when the appropriate HTTP request is passed to the route.
# echo.py
def get():
return 'Hello World'
def post(request):
# returns are turned into valid responses by the library
return request
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
Hashes for flouter-0.0.1.dev0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee107f62ac2a9159890a1450a938811251afd631dd01020cb606ad520dc52154 |
|
MD5 | 4a0a08b9346ce72a62f2890c6f007833 |
|
BLAKE2b-256 | 475f87b5660ca5d0e20d5b49a30ac01c53fa3fc03f98e8b364ef92596b54f466 |