折腾:
【已解决】Flask中获取REST API接口的传递进来的参数
期间,想要找个好的Flask中的REST的框架,用于开发REST API。
之前已经知道并用过flask-restful,是还不错。
但是想看看是否有更好的。
flask rest framework
flask best rest framework
Implementing a RESTful Web API with Python & Flask
Build a RESTful API with Flask – The TDD Way ― Scotch
Flask-RESTful — Flask-RESTful 0.3.6 documentation
REST API Best Practices: Python & Flask Tutorial – Polyglot.Ninja()
还是推荐:Flask-RESTful
What is a good Python framework for building a RESTful API? – Quora
humiaozuzu/awesome-flask: A curated list of awesome Flask resources and plugins
找到一些REST相关的:
flask-peewee – flask integration for peewee, including admin, authentication, rest api and more
Flask-MongoRest – Restful API framework wrapped around MongoEngine
Eve – REST API framework powered by Flask, MongoDB and good intentions
Flask-Restless – A Flask extension for creating simple ReSTful APIs from SQLAlchemy models
Flask-RESTful – Simple framework for creating REST APIs
Flask-RestPlus – syntaxic sugar, helpers and automatically generated Swagger documentation on top of Flask-Restful.
Flask-Potion – RESTful API framework for Flask and SQLAlchemy
flask-restful-swagger – A wrapper for flask-restful which enables swagger support
所以好像可以:
用Flask-RESTful
同时加上:flask-restful-swagger -》 方便生成swagger的接口的文档?
不过看起来:
pyeve/eve: REST API framework designed for human beings
4000+的star,貌似更不错?
Python REST API Framework: Eve, the Simple Way to REST. — Eve 0.8-dev documentation
pyeve/eve-demo: A fully functional REST Web API. Powered by Eve.
rantav/flask-restful-swagger: A Swagger spec extractor for flask-restful
flask restful vs eve
“Eve will read models for a database and create an API from that, flask doesn’t do that”
eve:REST API 框架,由 Flask, MongoDB 等驱动与其同类型相比较 | CTOLib码库
flask-restful vs eve | LibHunt
关注度eve貌似更好
-》还是抽空去试试eve吧
-〉暂时不去考虑那个swagger了
-》或许eve也有 swagger的插件呢?
果然还真有:
eve swagger
pyeve/eve-swagger: Swagger extension for Eve-powered RESTful APIs
本以为就要选择eve了。
但是看了文档:
Quickstart — Eve 0.8-dev documentation
后发现:
eve遵守HATEOAS-》看起来是更规范的API,但是感觉不是我希望和喜欢的:
<code>$ curl http://127.0.0.1:5000/people </code>
返回的是:
<code>{ </code>
“_items”: [],
“_links”: {
“self”: {
“href”: “people”,
“title”: “people”
},
“parent”: {
“href”: “/”,
“title”: “home”
}
}
}
而不是希望的:
<code>{ "code": 200, "message": "ok", "data": [] } } </code>
所以感觉不想要了
再去看到:
http://python-eve.org/features.html#hateoas
-》
http://python-eve.org/features.html#disabling-hateoas
可以关掉HATEOAS
其数据是基于:
http://python-eve.org/features.html#extensible-data-validation
去做校验的
pyeve/eve-sqlalchemy: SQLAlchemy data layer for Eve-powered RESTful APIs
那去看看,是否有全局的,用于返回response之前的统一的封装,可以加上 code,message,data的结构的
flask eve response wrapper
python 3.x – eve framework send custom response – Stack Overflow
API — Flask Documentation (0.10)
好像算是Flask的方面的事情,而不是eve的
Custom Error Pages — Flask Documentation (0.10)
flask-restful eve 对比
python RESTful API框架:Eve 快速入门 – CSDN博客
各位一般用什么来设计 restful API 服务器? – V2EX
还是选择放弃使用 Eve 作为 RESTful 框架的选择 | 明日会
和我的感觉一样:eve好像重点在于 通过模型定义,自动生成接口 -》 但是此处暂时没用到,而且好像也未必完全用得到。
python 有什么web framework 可以很方便的实现 api? – 知乎
RESTFUL SERVICES MADE EASY: THE EVE REST API FRAMEWORK – Nicola Iaro…
Python Restful API 资料整理 – CSDN博客
【总结】
最终还是决定,感觉暂时还是不需要eve,还是用flask-restful吧。
转载请注明:在路上 » 【已解决】选择好的Flask的REST API的框架