by BerislavLopac · 7y ago · 0 comments
New kids on the block:
- Starlette https://www.starlette.io
- Vibora https://vibora.io
- Xweb https://github.com/gaojiuli/xweb
- Storm https://github.com/jiajunhuang/storm
- Responder http://python-responder.org
- Quart https://pgjones.gitlab.io/quart/
- Sanic https://sanic.readthedocs.io
- Bocadillo https://bocadilloproject.github.io/
- Japronto https://github.com/squeaky-pl/japronto
The old guard:
- Flask http://flask.pocoo.org
- Tornado http://www.tornadoweb.org
- Falcon https://falconframework.org/
- Bottle https://bottlepy.org
- Pyramid https://trypyramid.com/
- CherryPy https://cherrypy.org/
Less known older ones:
- Wheezy Web https://pythonhosted.org/wheezy.web/
- API Hour https://pythonhosted.org/api_hour/
- Morepath https://morepath.readthedocs.io/en/latest/toc.html
- Klein https://github.com/twisted/klein
- Weppy http://weppy.org/At some point, Python's creator Guido van Rossum also said "My personal favorite -- and I expect that that will remain a personal favorite for a long time -- is something named Django. ... I highly recommend it."
Personally, I use Django with REST Framework (https://www.django-rest-framework.org). I've enjoyed using it tremendously for the past few years.
One important feature Django lacks right now is asyncio support. There are plans to add it though (https://groups.google.com/forum/#!topic/django-developers/Kw...). Hopefully that happens soon.
Have you looked at Django-channels?
Where php ended up somewhat confusingly is the frameworks are now frameworks and components to make web programming easier (syfony/zend...), which seem to be driving drupal and wordpress development.
I wish it had gotten more attention and care in the past decade.
https://github.com/ergo/pyramid_apispec
I'm pretty sure all other popular frameworks have integrations too.
"Developer productivity" is so vague, I'd regard it as weasely if it would be in a framework's description.
What's the developers aim and workflow? Depending on that, you can probably make an argument for most frameworks on the list.
- Django is your all-batteries included framework for standard CRUD with an integrated admin interface. For "average" jobs that feeds the productivity.
- But then you can make the argument that this approach gets in the way if you deviate from the norm, and Flask is the new productive toy.
- And isn't all the hubbub about a "pythonic" style getting in the way? Web2Py has some magic that might not be mainstream, but is just bound to ramp up productivity! (No experience myself, just using this for the argument and for nostalgia when every mention of it brought the main developer in the thread, arguing about this, just like redux today)
- But hey, man, we're all doing JS frontends and just need a web scale API. Erm, okay, then Django Rest Framework? The various Flask addons? FastAPI?
- I'm an ex-00s-Java developer who misses writing XML by hand. What's best for my productivity? Well, what about the endless joys of writing YAML by hand! Use connexion...
Salt this discussion with complaints about speed (charge of the Rust brigade), deployment hassles (Gophers emerge from the ground) and the collective "this isn't static and thus we're doooomed!" outcries (erm, Haskell?).
(And from the Waldorf & Statler balcony, enterprise programmers who get paid by the hour, laughing about "productivity")
I am sure Flasks documentation is a lot smaller but its essentially just a few parts of Django (it doesn't have a built in ORM from what I understand). Start adding in the documentation for SQL alchemy, documentation for an authentication library and whatever else you need and you will probably start getting something similar but without the guarantee that the pieces will play nicely together.
(Djangos documentation is really good.)
It's got wide feature coverage and excellent documentation.
I think maybe you're insinuating it's overly complex or hard to learn in which case come out and say that so we can engage with a specific assertion.
So it has right level of abstraction making it between a library and framework and you can use it either as library or framework. The difference is "framwwork calls your code" and "your code calls library code". I like the second paradigm more.
In order to make job very easy to develop there are excellent libraries so I have used flask, sqlalchemy (direct no flasl-sqlalchemy), alembic, marshmallow, celery, machine learning libraries (sci-kit, tensorflow, keras) and few more.
For development use cherrypy to graft wsgi app and for production use gunicorn or uwsgi. Our team is extremely happy and our test coverage is 98% as we use code as libraries not asnframework, so it makes it easy to test rest API and celery task code.
Also when needed for performance (not often as most libraries are better tested and designed), did take away the library abstraction and write our own code.
I haven't checked out CherryPy, I should next hobby project.
Gunicorn is awesome, uWSGI is also good and feels more "production" to me.
Moreover if you look at the framework code of many of them you can replace them easily, for example Flask and bottle.py can be completely replaced by your own code if your service or app grows the intended performance. The lowest common denominator in both is WSGI.