Skip to main content

Decorators to aid your Flask application

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.

Example Usage

  1. Simple usage
from flask_required_args import required_data

@app.route('/', methods=['POST'])
@required_data
def hello_world(name):
    return f'Hello {name}'
  1. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flask_required_args-0.1.1.tar.gz (1.9 kB view hashes)

Uploaded Source

Built Distribution

flask_required_args-0.1.1-py3-none-any.whl (3.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page