Module Expr Str Import alias identifier ImportFrom alias alias ImportFrom alias alias ImportFrom alias alias Assign NameStore Call NameLoad NameLoad Assign NameStore Dict Str Call AttributeLoad NameLoad attr keyword Str FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad Dict Str Call AttributeLoad Str attr SubscriptLoad NameLoad Index Str decorator_list Call AttributeLoad NameLoad attr Str keyword ListLoad Str Call NameLoad NameLoad Assign NameStore Dict Str Str Call AttributeLoad NameLoad attr keyword NameLoad Call AttributeLoad NameLoad attr keyword NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call NameLoad Dict Str BinOpAdd NameLoad NameLoad decorator_list Call AttributeLoad NameLoad attr Str keyword ListLoad Str Call NameLoad NameLoad Assign NameStore Dict Str Str Str Call AttributeLoad NameLoad attr keyword NameLoad Call AttributeLoad NameLoad attr keyword NameLoad keyword Call AttributeLoad NameLoad attr keyword Num Call AttributeLoad NameLoad attr keyword Str keyword Call AttributeLoad NameLoad attr ListLoad Str Str FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore BoolOpOr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr If CompareEq NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad Assign NameStore BinOpAdd NameLoad NameLoad Return Call NameLoad Dict Str Call AttributeLoad NameLoad attr decorator_list Call AttributeLoad NameLoad attr Str keyword ListLoad Str Call NameLoad NameLoad FunctionDef arguments args NameParam defaults body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str Return TupleLoad Call NameLoad Dict Str AttributeLoad NameLoad attr Num decorator_list Call AttributeLoad NameLoad attr Num If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr keyword Num keyword NameLoad
N/A N/A A simple number and datetime addition JSON API.
Run the app:

    $ python examples/flask_example.py

Try the following with httpie (a cURL-like utility, http://httpie.org):

    $ pip install httpie
    $ http GET :5001/
    $ http GET :5001/ name==Ada
    $ http POST :5001/add x=40 y=2
    $ http POST :5001/dateadd value=1973-04-10 addend=63
    $ http POST :5001/dateadd value=2014-10-23 addend=525600 unit=minutes
 N/A datetime dt flask Flask jsonify webargs fields validate webargs.flaskparser use_args use_kwargs N/A app N/A Flask __name__ N/A hello_args N/A name N/A N/A fields Str missing Friend index N/A N/A args N/A N/A N/A A welcome page.
     N/A N/A jsonify N/A message N/A N/A Welcome, {}! format N/A args N/A name N/A N/A N/A app route / methods N/A GET N/A use_args hello_args N/A add_args N/A x y N/A N/A fields Float required True N/A N/A fields Float required True add N/A N/A x y N/A N/A N/A An addition endpoint. N/A N/A jsonify N/A result N/A x y N/A N/A N/A app route /add methods N/A POST N/A use_kwargs add_args N/A dateadd_args N/A value addend unit N/A N/A fields DateTime required False N/A N/A fields Int required True validate N/A N/A validate Range min 1 N/A N/A fields Str missing days validate N/A N/A validate OneOf N/A minutes days dateadd N/A N/A value addend unit N/A N/A N/A A datetime adder endpoint. N/A value N/A value N/A N/A N/A dt datetime utcnow N/A N/A unit minutes N/A N/A delta N/A N/A dt timedelta minutes addend N/A N/A delta N/A N/A dt timedelta days addend N/A result N/A value delta N/A N/A jsonify N/A result N/A N/A result isoformat N/A N/A N/A app route /dateadd methods N/A POST N/A use_kwargs dateadd_args handle_validation_error N/A N/A err N/A N/A N/A exc N/A N/A err data N/A exc N/A N/A N/A jsonify N/A errors N/A exc messages 422 N/A N/A N/A app errorhandler 422 N/A N/A __name__ __main__ N/A N/A N/A N/A app run port 5001 debug True