Skip to main content
import json

from flask import Flask, jsonify

from flask_args import args


app = Flask(__name__)
app.debug = True


@app.route('/foo', methods=['POST'])
@args('form', bar=int)
@args('args', baz=float, spam=str)
def foo(bar, baz, spam):
return jsonify({'bar': bar, 'baz': baz, 'spam': spam})


@app.route('/echo', methods=['GET', 'POST'])
@args('values', msg=str)
def echo(msg):
return msg

if __name__ == '__main__':
with app.test_client() as client:
r = client.post('/foo?baz=3.14&spam=spam', data={'bar': 2718281828})
assert json.loads(r.data) == {
'baz': 3.14, 'bar': 2718281828, 'spam': 'spam'}

r = client.get('/echo?msg=hello')
assert r.data == 'hello'

r = client.post('/echo', data={'msg': 'hello'})
assert r.data == 'hello'

Metadata

Release files for flask-args 0.3.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-args 0.3.0
File Size Uploaded Provenance
flask-args-0.3.0.zip 3.1 kB Without provenance Details

Release files / flask-args-0.3.0.zip

Download URL flask-args-0.3.0.zip
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f8feb6dfbea3b9f84c20f20b82609ea55971e619fdd876c5c39ab5e159c0300a
BLAKE2b-256 checksum
How to use checksums
1d5cd9f85d7dd387a5c6989306986d5e243f919aa157e454da9fef2e56a6ecb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for flask-args 0.3.0

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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