Hacker News new | past | comments | ask | show | jobs | submit login

This is a short list I have compiled a few months ago, FWIW:

    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/



Django is a pretty big omission from your list.


Especially considering Django powers Instagram and Pinterest's backends.

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.


> One important feature Django lacks right now is asyncio support.

Have you looked at Django-channels?


Andrew Godwin is on the job: https://www.youtube.com/watch?v=oMHrDy62kgE


Good point. I was specifically looking for "base-level" frameworks that focus on routing and responses (so are well-suited for API development) rather than full-stack solutions (e.g. FastAPI isn't there either). Just copy/pasted that from my notes -- as I said, FWIW.


Django’s REST library is incredible. Steep learning curve compared to flask etc, but truly an industrial strength library that is brilliantly designed.


I still think WSGI is the main reason for so many frameworks in Python. So probably it will be nice to divide framework or libraries in WSGI and ASGI.


Welcome to php world, 5 years ago, when there where an astonishing number of frameworks. It seems to have coalessed around just a few (maybe the lack of the languague being as hot.. has limited resources)

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.

eg: https://symfony.com/


Not really 5 years ago Python and its framework were cleaner as it is today. They are mostly based on WSGI or ASGI. The only different breed were grand daddy of all framework called Zope and Twisted Matrix (for network programming besides web). Obviously Zope modernized as library with WSGI support and async support is built into Python.


There are a ton of frameworks, but most deployments choose either Django or Flask, unless they have some really specific need (asyncio is one).


Zope is probably the granddaddy of them all. Tried and failed miserably to use it 20 years ago.


Zope was my way into Python, way back in 2000. Brilliant concept, but hard to use well.


The framework I got into Python with was [Webware for Python](https://cito.github.io/w4py/), written in reaction to Zope.


Zope 2 was so ahead of the market when it appeared I had trouble explaining my clients it didn't need a SQL database to persist the data.

I wish it had gotten more attention and care in the past decade.


I saw that gnu.org was using plone, and I couldnt get it working about 15 years ago. But I didn't know python at all then.


Any of those have good Swagger integration?

https://swagger.io/


FastAPI (built on Starlette) essentially generates your OpenAPI docs for free via intuitive use of decorators and type hints/Pydantic models.


+1 for FastAPI. It also has really good documentation


Good howto/tutorial documentation, I had some problems with the reference stuff. For example, finding the places where you have to put some info (attributes, annotations, docstrings) so that it appears in the generated swagger docs (really needed if you want to publish them for external customers).


https://github.com/Pylons/pyramid_openapi3

https://github.com/ergo/pyramid_apispec

I'm pretty sure all other popular frameworks have integrations too.


It is extremely easy to integrate Django (well, DRF) with Swagger: https://django-rest-swagger.readthedocs.io/en/latest/



Weppy is considered a known older one. That's a sign that I'm getting old.


Is there any python framework that optimizes for developer productivity?


We're talking about Python frameworks, so "all of them". It's not like they're optimized to win req/s competitions or run on embedded nanocontrollers.

"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")


Django's tagline is "The Web framework for perfectionists with deadlines".


.. That comes with a brief documentation of 1941 pages (as of August 20, 2019)..


That's because it comes with a load of built in functionality.

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.)


Having extensive docs is a very good thing, much better than having a short readme and then rely on stack overflow to eventually fill in the gaping holes.


It might be a lot of pages, but Django has some of the best documentation out there. Speaking as someone who had to recently use it for a project for the first time, it was very easy for me to find the information I needed in their docs.


Why is that a bad thing?

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.


Isn't there a way to abstract that, using some of Django's libraries ?


Flask is pretty good. Stays out of your way and does what a framework must, and has some extras for forms etc.. if you want to use them. Tornado is fun to use, but less resources and libraries.


I started working with Django when it was pre 1.0 (0.96), as it was explicit in nature compared to Ruby on rails in 2003-4. Subsequently I tried flask and recently async framework. Our team still use flask just for one reason, it's a thin layer over wsgi making it easier and once application or service grows it can disappear completely.

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 traditionally like using the libraries not the Flask integrations (as in your sqlalchemy example) however I do find myself using Flask Admin and Flask-WTForms, since while they do have downsides and you have to commit to using them, they do a lot for you.

I haven't checked out CherryPy, I should next hobby project.

Gunicorn is awesome, uWSGI is also good and feels more "production" to me.


My problem with those additional projects are that I am dependent on one another layer of abstraction and not sure if the team is able to continue to develop it if core developers abandon it. Thats the reason I prefer using libraries, which if not supported can be supported by my team or replaced if necessary.

We use Flask mostly for REST API, so flask-admin and WTForms do not add that much value as all those are done on client side SPA (I do not like SPA, but it makes job easier as same API is leveraged for integration and mobile app).


For my apps I'm not worried about abandonment. They are internal applications generally with no access from the web.

Also the code is solid enough where I feel I could maintain it if I needed to, but most likely it would get picked up by someone else.


I find Tornado and Falcon really helpful in that manner, particularly when building REST(ful) APIs. Tornado used to be my go-to tool before discovering Starlette.


for just simple api apps I love hug and flask_restfull


Flask, and only Flask.


That seems like a rather extreme statement.


Like any answer here, it's my opinion. If it were not extreme, then it would be not a very strong opinion or worth considering.


Strong opinions should be carefully considered and have compelling reasons behind them. They shouldn't be extreme just for the sake of it.

I say this as someone who happily uses Flask at work.



I don't think Falcon is "old guard". It got stable just about 3 years ago.


Welcome to Hacker News, where anything older than two weeks is utterly obsolete and unusable, unless it’s LISP.


This looks ridiculously like PHP back in what, 2011ish? Kohana, Cake, Zend, etc etc etc. Ultimately they all collapsed into Laravel or Zend.


Well if you will notice all this framework are abstraction over WSGI or ASGI (these are standards in Python Language interface for web programming). So the situation is not same as PHP.

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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: