#100DaysOfWeb in Python Transcripts
Chapter: Days 37-40: Introduction to Pyramid framework
Lecture: Pyramid principles
0:00 Let's talk briefly about Pyramid's principals.
0:03 The core idea is that the developers
0:05 are using to guide what should be in there
0:08 what shouldn't, and what is important to the framework.
0:11 One of the principals I really love about Pyramid
0:13 is this pay only for what you eat approach.
0:16 The idea is that you can get results from using Pyramid
0:19 even if you have a partial understanding of the framework.
0:22 You don't need to use its role based security.
0:25 Then you don't even need to think about
0:26 you'll never see it it doesn't matter
0:28 but it's there if you want to add it in.
0:31 If you want to work with sessions
0:33 there's something you could add in for sessions
0:35 but you don't care or need to know about that
0:37 if you're not using it.
0:39 So it has this really simple
0:40 pay only for what you eat approach.
0:43 It's also in the micro framework world
0:45 which is another way of saying
0:46 it's sort of a minimalist framework.
0:48 It solves the fundamental problems of
0:50 web application, mapping your URLs to code
0:52 templating, security, and serving static asssets.
0:55 Not a whole lot more than that
0:56 but it does those really well.
0:59 The core developers on the Pyramid team
1:01 definitely take documentation seriously
1:04 and their goal is to have no aspect of Pyramid
1:06 remained undocumented.
1:08 It's not too hard because there's not too many pieces
1:10 but they also drive a little bit of the features
1:13 and changes that they accept
1:14 or don't accept because well
1:16 maybe adding some minor change to the framework is not big
1:19 it might have a big impact on the demo's
1:21 documentation and so
1:22 you could file a thing about all these things.
1:23 They definitely try to keep these
1:24 very much in sync. I touched on this to the opening
1:27 but Pyramid is a fast python web framework. It serves up
1:32 things like templates and simple response generation
1:35 say Json API. Things like that really really quickly.
1:38 To the extent that I've tested it
1:39 which is not massively, but somewhat
1:41 you know look at the benchmarks and whatnot
1:43 faster that Django, faster than Flask.
1:45 So, that's pretty good right there.
1:48 And, I also talked about serving
1:50 thousands of current users
1:52 on 10 dollars of hardware
1:53 prior, we've done it on 5, easily.
1:56 So these things are great.
1:57 And although hardware is cheap
1:59 you can scale out autoscale on the cloud.
2:02 It's still overhead to maintain
2:04 many servers, and sooner than you really have to.
2:07 So the fact that this is fast and quick
2:09 really great. Pyramid is reliable.
2:11 Like I said, I've been using it for 4 years
2:13 and it has been absolutely bullet proof.
2:15 They have a 100% statement coverage for their unit tests.
2:18 Their test coverage suite
2:20 so I've never had Pyramid break on me.
2:22 From upgrading from version to version
2:26 Not directly, maybe some of the dependencies
2:28 that I've sucked in but not Pyramid itself.
2:30 So very reliable framework
2:32 and they have the courage to ensure it stays that way.
2:36 And finally, it's open source.
2:37 You know, what would you expect, right.
2:39 What would you expect in a python space
2:41 of course it's open source.
2:42 But, it has a permissive license
2:44 and it is open source so you can just grab it
2:46 and run with it.
2:47 Right here at github.com/pylons/pyramid
2:51 Those are the principals.
2:52 I bet they resinate with you.
2:53 I know they resinate with me, and it makes for a really
2:55 nice framework.