Flask-ReqArg

A Flask extension that maps request arguments into function arguments
Download

Flask-ReqArg Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • Chi-En Wu
  • Publisher web site:
  • https://github.com/jason2506/

Flask-ReqArg Tags


Flask-ReqArg Description

Flask-ReqArg is a Flask extension that maps request arguments into function arguments.OverviewIf we want to get the request arguments, such as parameters passed by GET or POST method, one common way is fetching value from a dictionary-like object for each argument:from flask import request@app.route('/foo')def bar(): arg1 = request.args.get('arg_name1') arg2 = request.args.get('arg_name2') arg3 = request.args.get('arg_name3') # rest of codeBy using ReqArg, you can simply apply the @request_args decorator to bind request arguments to function arguments:from flaskext.reqarg import request_args@app.route('/foo')@request_argsdef bar(arg_name1, arg_name2, arg_name3): # rest of codeThis can make your code simpler and more clear.TestingThis package is tested using nose, which is a unit-test framework for python and makes writing and running tests easier.If you want to test this package by yourself, you need to install it first and then run tests by executing the following commands: cd path/to/package nosetestsProduct's homepage


Flask-ReqArg Related Software