We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Pyramid and the Pylons Project in the wild

00:00

Formal Metadata

Title
Pyramid and the Pylons Project in the wild
Title of Series
Number of Parts
72
Author
Contributors
License
CC Attribution 3.0 Germany:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language
Production Year2020

Content Metadata

Subject Area
Genre
Abstract
Freelancers, small development shops, and large business teams appreciate how Pyramid serves their needs.  Pyramid is a web framework for Python and one of many projects under the Pylons Project.  We will discuss the latest developments in Pyramid and other Pylons Project projects.  We will then demonstrate a recently developed Pyramid application used by public electric utilities to analyze and reduce costs associated with injury and illness.  The Pyramid application integrates with OAuth and Django REST Framework providers.   It was a collaboration with a small team, with one person taking the lead, and serves as a good example of what a one-person shop with a little help can do with Pyramid.
Zoom lensCore dumpSoftware maintenanceProjective planeCore dumpPresentation of a groupBitSoftware developerTouchscreenCloningSoftware maintenanceComputer animationMeeting/Interview
Zoom lensSelf-organizationGroup actionOpen sourceSelf-organizationSoftwareGroup actionCategory of beingPerpetual motionOrder (biology)Software testingProcess (computing)Repository (publishing)Multiplication signRevision controlWindowLevel (video gaming)Software repositoryWebsiteCloningComputer animation
PiZoom lensSoftware frameworkEmailWebsiteSheaf (mathematics)Electronic visual displaySelf-organizationWeb pageComputer animation
Zoom lensDemo (music)Software testingAlpha (investment)HTTP cookieElectronic visual displayRight angleState of matterSoftware bugOpen setDemo (music)Beta functionComputer animation
Zoom lensSoftware frameworkDrop (liquid)Information securityLogical constantMathematicsKey (cryptography)ImplementationRemote procedure callMobile appUniform resource locatorDecimalHuman migrationWeb applicationAuthoring systemMoment (mathematics)Medical imagingAdditionWave packetVideoconferencingVideo gameInformation securityPoint (geometry)CodeLibrary (computing)AuthenticationAuthorizationWindowMultiplication signSoftware developerMaterialization (paranormal)Single-precision floating-point formatGame controllerType theorySoftware frameworkNamespaceSerial portElectronic mailing listDesign by contractCartesian coordinate systemLogical constantTrailPlastikkarteComputer animation
Zoom lensLibrary (computing)Repository (publishing)Serial portDecision theorySoftware testingMultiplication signDemo (music)Default (computer science)Object (grammar)Data typeCodeForm (programming)Information securityBootstrap aggregatingGoodness of fitArtistic renderingCASE <Informatik>SpacetimeAttribute grammarMusical ensembleMathematicsGUI widget1 (number)Different (Kate Ryan album)ImplementationoutputLibrary (computing)Standard deviationShared memoryHecke operatorExpected valueCuboidPerfect groupRead-only memorySource codeJSONXML
Associative propertyZoom lensLoginReduction of orderRule of inferenceWave packetUtility softwareOperator (mathematics)WebsiteLattice (order)Row (database)Wave packetMobile appAddress spaceIncidence algebraPhysical systemCategory of beingProcess (computing)TwitterClient (computing)Hecke operatorTerm (mathematics)Traffic reportingPower (physics)Procedural programmingCondition numberNetwork topologyNear-ringJSONXML
Demo (music)LoginPower (physics)Utility softwareMessage passingRow (database)Software testingMessage passingObject-oriented programmingUtility softwareElectronic mailing listSystem administratorAngular resolutionSheaf (mathematics)Right angleComputer animation
Demo (music)Computer iconRow (database)Utility softwareMessage passingRule of inferenceSoftware testingCodeSimultaneous localization and mappingTotal S.A.NumberPay televisionPower (physics)Lagrange-MethodeWater vaporWhiteboardInclusion mapPhysical systemLink (knot theory)Term (mathematics)Image registrationPasswordEmailTime zonePoint (geometry)Boundary value problemPerimeterCodierung <Programmierung>FrequencyCone penetration testLocal ringStandard deviationOperations researchSign (mathematics)AreaGlobale BeleuchtungProduct (business)WebsiteConfiguration spaceProgrammable read-only memoryDrill commandsBroadcast programmingTask (computing)Reduction of orderStress (mechanics)WorkloadBoss CorporationObject (grammar)Data typeGroup actionConsistencyState observerInfinite conjugacy class propertyComputer fileDependent and independent variablesFood energySource codeGUI widgetChecklistHazard (2005 film)InformationSpacetimeNP-hardElectric generatorOpen setFormal verificationProper mapPartial derivativeAddress spaceCountingCategory of beingIntegrated development environmentEvent horizonMultitier architectureError messageCausalityHost Identity ProtocolSalem, IllinoisStatisticsBit rateCASE <Informatik>Heat transferExplosionCalculationPersonal digital assistantWage labourNichtlineares GleichungssystemOnline helpInstance (computer science)Scale (map)Incidence algebraType theoryMessage passingUtility softwarePhysical systemTable (information)Real-time operating systemInformationCuboidHazard (2005 film)Incidence algebraComputer fileLattice (order)Presentation of a groupMultiplication signDigital photographyMassElectronic mailing listElectronic signatureSoftware testingStandard deviationText editorTraffic reportingForm (programming)NumberMeasurementBit rateSheaf (mathematics)Plug-in (computing)Right angleDifferent (Kate Ryan album)CalculationTotal S.A.Latent heatFrequencyData managementDefault (computer science)Error messageSource codeComputer animation
StatisticsUsabilityBit rateCountingZoom lensDemo (music)Plane (geometry)InformationRepository (publishing)WebsitePresentation of a groupUniform resource locatorComputer animation
Transcript: English(auto-generated)
All right, thank you, Erick, Ericko. Can you all hear me and see my screen? All right, let's get started. So, welcome. My name is Steve Piercy, and my presentation for today is Pyramid and Pylons Project in the Wild. Just a little bit about me. I am a self-employed, one-person shop.
So, I'm the full-stack developer and try to do as much as I can, and I play well with others when I'm on teams and working on projects. I'm also a core contributor to Pyramid,
and this year I became the Deform Maintainer, and I love to write documentation. I'm also, I live out here on the West Coast in Eugene, Oregon. I'm going to start talking about one thing that is kind of like the elephant in the room.
About two years ago, over in Japan, we made an announcement, or I made an announcement, that the Pylons Project was going to be assimilated by the Clone Foundation, and that never really happened. And there's a lot of reasons why,
but we spent some time, first of all, identifying what needed to be done, and we found that there were some roadblocks. First was that the Clone Foundation Contributor License Agreement had a process that was too cumbersome for what the Pylons Project folks wanted to do, and that there was one clause in there that wasn't agreeable.
And we do know that the Clone Foundation is totally open to amending it. However, there was more stuff going on at the same time. I know that the Clone Foundation was kind of busy
acquiring Zope, which definitely took precedence over going for merging with us. Internally, we also had problems with trying to re-license all of our software. We wanted to get stuff away from the repost public license and re-license it as MIT,
and doing it once and only once, and never doing it again. So, licensing is hard. We also wanted to make sure that copyright of the software and intellectual property was going to be maintained in perpetuity, and then of course COVID-19 hit, and then everything has kind of been on hold for
well over a year now. Well, we're about to start doing some revisiting of all this, and that means that we still have to get ourselves in order as far as an organization. We have been in discussion with the Python Software Foundation, and we'll probably start
talking again with Clone Foundation now that they have come, that's come over the Zope hurdle. So, what else have we been doing as an organization? Infrastructure. First of all, Travis CI and AppBear have gone out the window, and that's primarily due to Travis changing
its plans for open source projects. Their free level is pretty much insufficient with the amount of builds that we're trying to do. So, we switched over to GitHub Actions for
most of our active, for most of our active repositories and projects. The only thing that's missing is that we really wish we could have is the allowed failures feature from Travis CI. This allows us to test future versions of Python on our software to make sure that when that future version is deployed, then it will continue to run.
Besides that, we have been doing a lot of work on our marketing websites. The pylonsproject website for pylonsproject.org and trypyramid.com are now being automatically built using Hugo
and deployed on GitHub pages. This is really cool because now people who want to make a contribution can do so, and when their PR is merged, it gets automatically deployed.
It's so much easier and so much more pleasant to use. And we are definitely encouraging people who have an add-on for Pyramid or have a company, organization, project, or website that uses Pyramid to add themselves and be contributors to the add-on or the community section and proudly
display that they are powered by Pyramid. Show off your Pyramid flair. Aside from that, we have been really super busy with a release party of lots of updates to our projects.
Colander has gotten a new release. Dform and DformDemo are now up to 2.0.14, and .15 is hopefully coming out the door by this weekend. Pacedeploy just came underneath the pylonsproject this year.
The most interesting project, of course, to most of y'all is Pyramid. That's been updated to 1.10.5, and the first alpha release of Pyramid 2.0 has made it out the door. And the cookie cutter, which is used to generate projects, and if you saw my lightning
talk on Monday, you can see it actually being used and integrated into PyCharm Professional. It's really cool to see that. Go back and watch the lightning talk if you haven't seen it yet.
The Pyramid Debug Toolbar has a new feature as well. You can now watch sessions as session values come into your request and go out of your request and see the values change accordingly. That's really awesome. That was contributed by Jonathan Vanasco. Pyramid Open API is continuing
to be actively developed, so if you want to have a quick and easy way to have your API documented and functional and tested, check that project out. We've also had a few other projects. Waitress is probably the big one that's used by Plone,
and we've had another beta release. We want to get feedback so that when it's ready to be released as a final 2.0 that there's as few bugs as possible. When we released the first beta,
we found a bug really quick, fixed it, and was released within 24 hours. So we're right on top of it. Please let us know. So that's a brief overview of the pylons project. Now let's take a look at the state of Pyramid. So in the beginning,
I joined Pyramid as a groupie of a heavy metal band, and the after-parties were amazing. But at some point, we had to look respectable. So over the 10 years or so of Pyramid's
development, there are now over 419 projects in PyPI that have the Trove Classifier Framework Pyramid. In addition, Warehouse itself, the cheat shop or PyPI, is running on Pyramid.
Talk Python to Me, which provides technical training for Python data science web application development and run by Michael Kennedy, a fellow Oregonian, also uses Pyramid. Check him out. He has really good materials if you want to learn Pyramid and other Python technologies.
And finally, Mozilla, Roadcode, Cards.com, SurveyMonkey, Yelp, and NASA Image and Video Library are all using Pyramid. So what's new in Pyramid 2.0? First, we dropped Python 2.
3.4 and 3.5 are also end of life, so they're gone, and PyPI will be out the window. Where we've been supporting Python 3 for quite some time, but now we're supporting up to Python 3.9 as well as PyPI 3. We have a new security policy. This is the big one. So basically,
we had two policies, authentication and authorization in Pyramid 1.x. So those two have been merged into a single security policy in Pyramid 2.0.
The authentication and authorization policies can still be used, and they will continue to function normally for the time being, but this is the time to start learning about and adapting
your code to use the new security policy. You'll be much happier with it. Trust us. To go with that, we have new security APIs. Those have been added to support an overall of the authentication and authorization system. We have exposed some ACL constants.
ACL is an access control list for permissions. The constants that have been exposed are all permissions and deny all, so no permissions at all. These are now importable from the
Pyramid.authorization namespace. It's a nice convenience. We have a new serializer. We are throwing pickle out the window and now using JSON as the serializer.
Now, we did this because this basically is a stricter contract than the previous requirement because of security purposes. Previously, if a client-side session implementation was compromised, it left the application vulnerable to remote code execution
and using specially crafted sessions that could execute code when deserialized. That would be really bad to get owned. With this change, it is backward incompatible, and you will definitely need to update your code for that. The keys and values in your session
data must be JSON serializable, so that means dates and decimals, you're going to have to fiddle around with them to make them work. There's a few other highlights. Trailing slash routing, improvement of CSRF handling, pre-compressed static assets, we fixed a deprecation warning
from Imp, and a few other minor features. To see what all of these features are, as well as getting some documentation about how to make the migration for your pyramid apps,
please visit this URL. I'm going to pause for a moment and see if there's any questions, and if you do have any questions, feel free to type them away in the Slack app and then
Erica will follow up with me. So, no questions from the audience, but I do have a question. Basically,
are you planning in a pyramid to use a different JSON implementation by default, instead of the standard library one, one that already serializes date and time and other times?
Yeah, that's going to be a challenge. I don't know exactly all the implementation details, but that sounds like a good thing to do. But with all of that, there's also like standards requirements, right? So, there's some expectations that have to be there.
I think that would be a good thing to put on our roadmap. Yeah, especially because of sharing my previous company. In the previous company, we use pyramid extensively and every time we had to deal with serialization,
we had a piece of code that was replicated in many repositories that was basically updating the JSON serializer to handle some new data types like set, daytime and time and stuff like
that. Yeah, exactly. Yeah. We know it's an issue, but we had to make the decision of, well, is security more important? Yeah. So, let's get that taken care of and we'll handle the rest of it when the dust settles. Perfect.
Yeah. So, next one big project that I've been working on is Dform and the Dform demo. As I said, I'm the new maintainer and in the last year, we're now up to 100%
test coverage. 100% of the tests pass and the documentation has of course been vastly improved. We've had a lot of great contributors step up on this one that I'm so pleased that people are still using it. Yeah, there still is a good use case for server-side rendering of forms,
especially if you're a one-person shop and you just don't have the time or resources to develop within a Python ecosystem, a JavaScript ecosystem, React and adapt to all of those things. So, this is great if you just want to get something out the door.
Later this week, we'll have the biggest changes are there will be read-only HTML attributes that are properly handled. That's a big, huge feature that's been requested for a long time and it's finally going out the door. We're adding a new select widget. If you know,
using select inputs are terrible and so we've adapted a new one to use in Dform. We also have a new space where unofficial widgets can be brought in. So, these are ones
that are not tested. We don't have to write tests for them, but it's more like we want to cookbook or a recipe so that you can try various solutions. So, I have one where I have these custom checkbox layouts and I work with various other objects. I'd love to share them, but writing
tests for them is not a whole heck of a lot of fun as far as the UI. So, you know, just it's something to play with. We've also switched to using pytest and now Docker containerization of both Dform and the demo. Dform 3.0 is also on our roadmap and that will include
Bootstrap 4.5 and that's to prepare it for the eventual 5.0 release of Bootstrap and we're going to be doing a lot of sprinting this week. So, I hope you can come out and play with this. Okay. Next, I wanted to show you how Pyramid is actually being used in the wild.
I have a client, the American Public Power Association, and they provide a voice for not-for-profit community-owned utilities that power 2,000 towns and cities in the United
States. Here in Oregon, there's a lot of towns, including my hometown, my town here of Eugene, Oregon. That is a publicly owned utility. They represent those utilities before the federal government and they protect the interests of more than 49 million people
that they serve. And there's about 93,000 employees of all these utilities. Finally, they advocate and advise on electricity policy, technology, trends, training, and operations. And the app that I wrote, or led, it's a project on,
addresses a lot of those, all of those issues. So, we developed, together with me, I developed eSafety Tracker. It was released in June this year,
and it helps utilities to plan and record their safety meetings. So, these are their trainings. They also plan and record job briefings. So, when there's a utility outage, they have a meeting before they go out to the job site, and they get briefed on the conditions. So,
they say, watch out, there's a lot of ice and snow and fallen trees. So, these are the procedures that we have to follow before we go out there and make sure that we reduce our injuries. It allows the utilities to record safety incidents.
As well, that includes injuries, fatalities, property damage, and near misses. The utilities also record their investigation reports of those incidents. And finally, they use it to analyze and reduce costs related to workers' compensation, medical expenses, and lost time.
Until before the Safety Tracker was developed, they were kind of, they didn't do a whole heck of a lot of collection of data. And most of it was through OSHA, which is the government agency
that they report when there's an injury or incident. And now that they have the system, it standardizes a lot of the terms and the classifications of things so that it's, um, so that they're able to identify trends and see how they met, how one utility measures
up to another in their safety performance. So, this is a huge step forward for them, and they're really, really excited to be using this. And I feel great about it because I'm helping people stay alive, not get injured, and, you know, maintain their livelihood while
trying to keep the lights on. So, let's go ahead and take a look at this. I'm going to switch over to the actual app. Let's drag it over here, full screen, and log in.
Oops. So, there's some CRSF protection right there. There we go. And we're going to get
utility. When users log in, they're first presented with a message of the day, hello, greetings, some text here, and a list of unresolved entries. I'll get into that later. Across the top, we have navigation for users to select their section that they want to navigate
to. And if you are an administrator, you can select which utility you want to go to. So, this is a nice little thing for people to, excuse me, I forgot one thing.
This table here also is just data tables. So, it's just a JavaScript plugin. So, it's a nice thing that, you know, works in real time and just is useful. So, let's start off after this. When they are, let's see,
sorry, got lost here for a second. There we are, navigation. So, dive right into managing.
In the utility section, we have a nice little filter here. And utilities can edit their information and so forth. One of the things that's super important is that they record like how many employee work hours they have, their total number of utility employees.
And these numbers are used later on in reporting and performing calculations. We also have users. So, once the utility has access and a license to the system,
they're able to add new users on their own, which is super handy. It's making a request. Come on, baby. There we go. So, when they create a new user,
they have the ability to assign them a role, one of four different roles, and pick a utility and assign them to that. By the way, this is all D form stuff. I'm going to cancel out of that. They are also able to manage their messages of the day,
so that when people log in, they're able to greet them. Let's go back over here. There we go. And this is useful. We have ways of filtering all the messages of the day
up through a specific period of time. And we automatically load like default messages, and you're able to filter reports as they come, the messages as they come in.
That's over there in management. Under meetings and briefings. So, here we can see all the different types of information that is recorded. We have a collection
of all the meetings and briefings that are held. So, this is great when utilities want to look back in time to see what has actually happened, and they're able to filter, you know, however they like to see whatever is available. They're able to edit and delete meetings as they come in,
and they're also able to add people as presenters who attended the meeting, and they can add files. This is useful if they wanted to have like a sign-in sheet,
they can take a photograph of this and upload and say that these are the people who attended. Briefings are similar, and one of the cool things about this is, this is one of the custom things that I did for them, is this lovely massive checkbox list. So, they're able to classify
all of the various safety hazards and so forth that they have here, and they're also able to add signature sheets and other goodies. All right, now the meat of this is underneath
incidents. The incidents are really cool. We have, a person can, an editor can, or a user can create an incident, whoa that was not good, and create one of four different types.
They can create their incident with the date and time. One of the cool things too is that if you try to do something too far in the future, you'll get error out what you can't do in the future. So, you know, make sure that it's
validatable, and these are also cross-referenced as well. So, this is also another thing about, that uses colander with Dform. Steve, we are approaching the end of our talk.
Yes, so I will just wrap it up. I'm going to go back over quickly to reports and just see what happens when you do some incident history stuff. So, I'll go back in time,
if that's early enough. This is what's really helpful for the utilities too, is that once they get these incident rates, these are not realistic numbers of course, that they're able to look at this and compare it to other utilities and measure against standards. So, with that, I'm
going to wrap up here, switch back over to this, and just say I wanted to thank you for attending the, for my presentation. To get involved with the Pylons project, there's our URL for
our repositories on GitHub. We have the two marketing websites, trypyramid.com and pylonsproject.org. And to contact me, there's my contact information. Thank you, Steve. It's good to have the Pylons project back with us. This is always
something I look forward in our conferences.