Skip to main content

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}'

You can use url parameters as normal

from flask_required_args import required_data

@app.route('/<user_name>', methods=['POST'])
@required_data
def hello_world(greeting, user_name):
    return f'{greeting} {user_name}'

Release files for flask-required-args 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flask-required-args 1.0.0
File Size Uploaded
flask_required_args-1.0.0.tar.gz 2.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flask-required-args 1.0.0
File Interpreter ABI Platform
flask_required_args-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.1 kB

Release files / flask_required_args-1.0.0.tar.gz

Download URL flask_required_args-1.0.0.tar.gz
Size 2.6 kB
Tags Source
SHA-256 checksum
How to use checksums
236d83be7d23de96f733b366b87491eb06848ffb0e54789884817241fb0479e5
BLAKE2b-256 checksum
How to use checksums
3c5becd69180bb5dd7c85202eaa2bf97cebf9ccfa00b2c15085175d64b7d8eb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

Release files / flask_required_args-1.0.0-py3-none-any.whl

Download URL flask_required_args-1.0.0-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5788edfcf47a59cbec9dd9b39faebaa2822b7448b7d07591848e68a62f8f683
BLAKE2b-256 checksum
How to use checksums
86d395446f4b1c18d69403f125020f0c6867eaa74553637807f2417f412a162e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page