flask-RESTful vs flask-RESTless, which should be used, and when [closed] flask-RESTful vs flask-RESTless, which should be used, and when [closed] python python

flask-RESTful vs flask-RESTless, which should be used, and when [closed]


While I'm sure there's going to be a significant of overlap between Flask-RESTful and Flask-RESTless, here's the difference in orientation as far as I can tell:

Flask-RESTful aims to be generic, it's a "lightweight abstraction that works with your existing ORM/libraries". Your resources don't even have to be a model tied to a database, and it could be anything.

On the other hand, Flask-RESTless makes it clear that their best use case is "creating simple ReSTful JSON APIs from SQLAlchemy models"

So if you have a lot of SQLAlchemy models and need fairly standard REST API from those, you can use Flask-RESTless to speed up the development, you need minimal code to expose your models into the API.

If you have custom endpoints, or want to use models that aren't backed by SQLAlchemy you can create your own on Flask-RESTful

How to decide / or use both

You can do customize Flask-RESTless too (serialization, custom queries etc), with sufficient code you can use either frameworks.

To decide e.g. ask yourself do you have more structured model-based APIs or more custom APIs, that would save you the most development time and only deal with special cases when they arise.

And You can use both in a single Flask app, no problems there, you just e.g. map /api/resource-a/ to a Flask-RESTless API and /api/resource-b/ to another API from made with Flask-RESTful