Skip to main content

Create easy REST APIs with Flask

Project description

[![build status](](

# Flask-RESTeasy

It starts with an itch. I was using Flask-RESTful but I soon started
having to work around it with request parsing and output fields caused
errors. I got frustrated. I loved the project, but it was doing more
than what I wanted it to do.

I just wanted something to ease the setup and binding of flask MethodViews
for handling JSON REST APIs. The rest can be handled by other packages
dedicated to their tasks. I kept the basic resource handling for both
apps and blueprints and removed the rest: request parsing, output fields,
authentication, and static error handling.

I wanted something simple in the way Flask was simple. This is my
attempt at making it so. If you have seen Flask-RESTful, this will
look very familiar.

# Install

For install you can use pip:

$ pip install flask_resteasy

# QuickStart
from flask import Flask
from flask.ext import resteasy

app = Flask(__name__)
api = resteasy.Api(app)

class HelloWorld(resteasy.Resource):
def get(self):
return {'msg': 'Hello world'}

def delete(self):
return {'msg': 'Sorry Dave.'}

if __name__ == '__main__':

Execute that code and you have a running server on port 5000. If you get an error, you probably have something else running on that port. Either stop the other process or change the port in your Flask app.

Now either check with a browser, or use the following commands.

$ curl http://localhost:5000
{"msg": "Hello world"}

$ curl http://localhost:5000 -X "DELETE"
{"msg": "Sorry Dave."}

Project details

Download files

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

Files for Flask-RESTeasy, version 0.0.8
Filename, size File type Python version Upload date Hashes
Filename, size Flask_RESTeasy-0.0.8-py2-none-any.whl (8.8 kB) File type Wheel Python version 2.7 Upload date Hashes View
Filename, size Flask-RESTeasy-0.0.8.tar.gz (6.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page