Froi (Flask Router Object Interface)
A wrapper for Flask’s native routing as a form of template. Routes will be defined as objects to easily define domains.
# Inside some route object
from froi import Froi
class SomeRoute(Froi):
def __init__(self, app):
super().__init__(app, 'SomeRoute', '/some_route')
def install(self):
# define a get route on base
self.setget().route(func=sample_fxn_1)
# define a post
self.setpost().route('/do_something', func=sample_fxn_2)
# define a put
self.setput().route('/edit_something', func=sample_fxn_3)
# define a delete
self.setdelete().route('/delete_something', func=sample_fxn_4)
# Inside your server handler
from flask import Flask
from some_route import SomeRoute
app = Flask(config.APP_NAME)
SomeRoute(app).install()
app.run()
If you want a RESTful pattern to handle the routes, you can omit defining the install function.
from froi import Froi
class SomeRoute(Froi):
def __init__(self, app):
super().__init__(app, 'SomeRoute', '/some_route')
def get(self):
... do something
def post(self):
... do something
This will automatically create the defined GET, POST, PUT, and DELETE endpoints.
Metadata
Release files for froi 0.4.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| froi-0.4.7.tar.gz | 3.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| froi-0.4.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.7 kB
Release files / froi-0.4.7.tar.gz
| Download URL | froi-0.4.7.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
de2f05fb21a0133d8dbb4a65a7842e2b76a38363cee2a3a8ee47748cdca1e7c1
|
|
BLAKE2b-256 checksum How to use checksums |
324868fdfdff182b2b52806fa6c17040ed8aa20d8a00f365fcca83cb779144ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.17 CPython/3.6.8 Darwin/19.2.0
|
Release files / froi-0.4.7-py3-none-any.whl
| Download URL | froi-0.4.7-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
453bd5792a8e4730a8dc0b751b59d815b33a83ac4968f23dff1871a08afe6005
|
|
BLAKE2b-256 checksum How to use checksums |
d85a41cb2ef359e35159b220d25b91f1a5db4dbbfbd52992200777705f0aea22
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.17 CPython/3.6.8 Darwin/19.2.0
|
Security for froi 0.4.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.