Flask-RESTful is an extension for Flask that adds support for quickly building REST APIs. It is a lightweight abstraction that works with your existing ORM/libraries. Flask-RESTful encourages best practices with minimal setup. If you are familiar with Flask, Flask-RESTful should be easy to pick up. Flask-RESTful Documentation
It’s time to write your first REST API. This guide assumes you have a working understanding of Flask, and that you have already installed both Flask and Flask-RESTful. Here
#!/usr/bin/pythonfrom flask import Flaskfrom flask_restful import Api, Resourceapp =Flask(__name__)api =Api(app)classDataSensorRestApi(Resource):defget(self): data ='This is data from a sensor'return dataapi.add_resource(DataSensorRestApi, '/datasensor')if__name__=='__main__': app.run(host='0.0.0.0', debug=True)