Upgrade your flask application by defining required arguments
Project description
Flask Required Args
A simple flask decorator that helps specify which args are required from the user. It returns a 400 error if any are missing. You specify the arguments required in your function definition, you can use default parameters like normal.
Installation
pip install flask_required_args
Example Usage
- Simple usage
from flask_required_args import required_data
@app.route('/', methods=['POST'])
@required_data
def hello_world(name):
return f'Hello {name}'
- You can use default parameters as normal
from flask_required_args import required_data
@app.route('/', methods=['POST'])
@required_data
def hello_world(name="World"):
return f'Hello {name}'
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
Close
Hashes for flask_required_args-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c63a709d42f356f50ecd1a62af894e78fec0c49635209375324d8b894bb3343b |
|
MD5 | 11edc7bb241bcef9aafd611196bc8e13 |
|
BLAKE2b-256 | 6639072e7d4f82cab85148f54d27a969e55c4d1484c2d33220658fa1e3d5e72e |
Close
Hashes for flask_required_args-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8bc2c0a0d66cbf8c5a6a77e4cf455c272df60a2f870e88e4d205e70820b896b |
|
MD5 | e23d15409dec090526b22dbe20cb4d8a |
|
BLAKE2b-256 | 54fa490813bedac19bdca7c4ff6da856ae88bd3de39465c26af42e4e1d3c38a9 |