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

Why Pyramid instead of Flask or Bottle?

I have not used Pyramid or Flask framework in production, but I have played with both and watched their development over the years.

Flask is easier to learn and you could probably master it. It is well suited to projects with a smaller scope. (I leave it to you to decided how small is small, and how big is big. There is no clear cut line.)

Pyramid's documentation has been -- relative to Flask -- difficult. I know that the Pyramid team has been working to improve the documentation and the linked page looks like part of that effort.

The name Pyramid dates to 2010, prior to which it was know as repoze. It has even deeper roots and includes ideas and code from many prior projects: Zope, Plone, Grok, Pylons and probably more. However, working with Pyramid is more like Flask than Zope, more of a lightweight framework than a giant monolith. It is my understanding that Pyramid can draw on a much larger set of tools to build complex websites that require complex security, workflows, scalable servers, etc.

This is false. Pyramid was not known as "repoze" which is a project to port interesting/good pieces of code from Zope to be standalone libraries of code.

Pyramid used to be known as repoze.bfg or just bfg. It made liberal use of modern "light-weight" framework architecture decisions along with much more advanced and flexible workflows and code introduced through other repoze.* libraries (from Zope).

In general though, I agree that Pyramid is well suited for large projects and ill-suited for small ones. Although I do use it for my small projects.

I stand corrected.

The major benefit (for me) of Pyramid is the security system. You can setup the routing infrastructure to check access control lists on anything, you could make sure a user has access to a file on disk or a certain row in the database and thats all built-in and easy to use even though Pyramid relies on no auth system or database.

Which really shows the power of Pyramid.

Flask and Bottle have Authentication and Authorization extensions but they just aren't as flexible or as powerful as Pyramids.

A lot of the power of Pyramid (especially the security system baked in) comes from its long history and the large applications built on top of Zope, Pylons, and repoze. The knowledge and experiencing coming from those frameworks shines through when you start building something larger than a blog or todo list and you have "real world" requirements.

Also, the amount of tests, documentation, and hard work that goes into supporting Python3 are great benefits of using Pyramid.

Excellent point. It took me a long time to figure out the authorization mechanism of Pyramid, but the power it gives you as a developer is definitely worth the learning curve.

Pyramid has come off as a very well engineered framework from the get go since I started using it 1.5 years ago.

Pyramid's ACL + Traversal is unmatched. I love Traversal (makes building RESTful API's super easy).

because in my opinion its better and more mature + it has more features while maintaining at least the fexibility of flask if not better.

Also first stable and known framework with full python 3.x support

Framework vs Github followers

Tornado 4,551

Flask 4,019

Bottle 1,381

Pyramid 876

EDIT: Just adding some figures to the debate.

I've been a Pyramid user for over a year now, I'm active on IRC and the mailing lists, I do not "follow" pyramid on github.

Statistics like this are silly because they rely on people actually wanting to use GitHub and I don't feel the Pyramid community of developers really cares that much for it outside of being a host of the repository.

How about comparing the number of real-life web applications (i.e., not counting final year projects) in each framework, or the number of users each of them serves?

BTW, I've been a long time Pyramid user (since the Pylons days) and can't be happier with my choice.

This is meaningless. Pyramid is a newer framework (newest of those listed?)

Yes and no. Yes, because popularity of a given technology is usually related to the size of its ecosystem/number of tutorials. No, because we are talking about micro-framework, which architecturally use a bunch of loosely-coupled Python components, so having "plugins" is less important than for other frameworks for many use cases.

I went and "starred" and "watched" Pyramid so that it could join the cool club, not really sure what either feature does though.

php has more users than python -> clearly it must be better language argument?

I'd rather compare by design decisions than meaningless numbers.

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