Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds. This is episode 405, recorded October 14th, 2024. And I'm Brian Ocken. And I'm Michael Kennedy. And this episode is sponsored by Scout APM. Please listen to them, their segment later in the show. And if you'd like to connect with us and ask us a question or submit an article, you can find us on Mastodon.com.
on Fostodon.org. We are at mkennedy, at Brian Ocken, and at Python Bytes. And if you see all three of us, it actually gets to us really a lot better. Or you can email it to us. There's a contact form on our website, pythonbytes.fm. If you'd like to watch live, you can join us on YouTube and go to pythonbytes.fm slash live, be part of the audience, or watch old episodes. It's a lot of fun. We love getting questions in the chat. And also, finally, a
If you'd like to get all the links, just listen and enjoy the show while you're listening, and then read the links later. You don't have to write anything down. Just join, go to pythonbytes.fm, and get on our mailing list. Go to Friends of the Show, or just say sign up for Newsletter, and we'll send you a weekly email with all the links and all the topics from the show. So to get started, Michael, I
That was a long intro. Maybe it could be a little more brief with you. I'm going to try it. I'm going to keep this one brief, okay? Okay. Briefer. Let's talk about Briefer from Briefer Cloud. So this is new to me. Obviously, 98.4%, according to the last survey of our listeners, know about Jupyter and Jupyter notebooks. Okay. Right? For those of you who don't, notebooks are a way to sort of explore data, mix in explanation graphics along with code and analysis. Okay.
And by far, Jupyter notebooks are the most popular way to do notebook type programming, but not the only way, right? We've talked previously about Shiny for Python, which is a really cool option. But today I want to tell you about Briefer. And my theory is the name comes from the thing that delivers a briefing because it's about not just exploratory data notebooks, but it seems to be even a little more focused on delivering a dashboard experience that
non-developers or at least not the person creating the thing comes to look at, they can just sort of explore it as an interactive webpage. Okay? Okay. So it is, I'll give you their little spiel. It's dashboards and notebooks in a single place. Create powerful and flexible dashboards using code, beautiful Notion-like notebooks and share them with your team. And yeah, that pretty much sums it up.
So I believe this used to be a commercial product. Still is a commercial product. Don't get me wrong. It used to be exclusively a commercial project because they have a big banner at the top. Briefer is now open source. Go star us on GitHub. And let's see how many people have. 3.3 thousand. That's a respectable amount of traffic, right? That's pretty good. But if you go to their web page at briefer.cloud, you can see a little bit more of like, what the heck is this thing about?
So multiplayer, as in multiple people can work on it. And I think one of the things that's unique about this compared to say a Jupyter notebook. So for example, suppose I want to talk to a Postgres database or something like that as part of my data that I need to pull back. Well, you've got to connect to Postgres and
in your notebook and you've got to put your password and your connection string in your notebook. That's not necessarily ideal. You might be able to pull in, I'm sure there's a way to pull in environment variables or something like that, but it's not super easy, right? So one of the deals I think here is you connect a database and then you write Python and SQL to query the database and transform it into the right shape and filter it and so on. And then you use this tool to create visualizations and dashboards and reports, data apps and so on out of it. Cool.
So it's like you configure the system to know about your data connection and then just any notebook can talk to the database, something along those lines. Obviously, that's not a totally universal use case, but that's the idea, okay? And it also came out of Y Combinator. Like I said, I think it was primarily just commercial at first and then expanded. So yeah, it says connect your data source, run some queries, run Python code using your query results as data frames.
And then share your results. So they've got some cool examples in here. They have AI because Y Combinator has to, apparently. But these are good looking things. And then you can have notebook styles and you can create a dashboard where you put different charts and stuff next to each other.
and then they're just web pages that people can check out. This is pretty cool. Yeah. Pretty neat, right? I like it. Yeah, I mean, then you publish it to the web. So the thing to know is if you look at pricing, there's two options. Paid and not paid, right? So open source, self-hosted, free, install it from GitHub, off to the races. Then
Then there's Community, which has a free one, a pro, and Enterprise. This is not any sort of ad or anything, right? But I do think the fact that it's open source and it has these cool features, sort of executable Python, is pretty neat. There's some more cool Python stuff about it here. I can't remember where I was reading it. Oh, yeah, you can also put like little sliders and date pickers and stuff that will, as people interact with them, right, it'll up
update what happens. But you can also, somewhere along here, is it a schedule? Yeah. You can schedule your Python blocks to run on a recurring schedule. So if it's got to go, yeah, it's got to go pull, I don't know, daily information from some CSV source or who knows, right? Yeah. So, yeah. Anyway,
That's what I got. People can check it out. And if you're over here, of course, there is a docker-compose.eml. So if you're going to self-host it, you can just docker-compose it to life. Nice.
Well, I know that school started last month for most people. It's been going on for a while, but it's still kind of near the beginning. And I was thinking about students and thinking there's a lot of people learning some new web stuff. And so I picked a couple topics around learning new things. And we're going to start with Python. So I got this from...
forgot his name already, Jose Blanca. And I think he's the dude that wrote it. That, yeah, it's an introduction to programming with Python, but it's all web-based. It's kind of nice, all web-based. And it's just a free, kind of a basic intro. And I think it'll be more than enough for a lot of people to get started on there. Like, they're taking some programming course or need to know a little Python for a course or something or a new project.
So there's a few things that I like about it. One of them is it's not a complete overview. It doesn't try to cover all every detail of Python language, just what a beginner might need to start the journey. And I know there's a lot of great training tutorials, especially over maybe at TalkPython training to get started. But if you're...
If all you got is no money and a web connection, I think this is maybe something to check out. I want to point out a couple other features. It's running, if we scroll to the bottom, it's running a
Corto, which I think we've covered this, Corto publishing system. I believe that we have. Yeah, that comes from the Shiny folks as well. Some people make Shiny for Python that I mentioned before. Well, it's based on that with a Corto live extension that allows Python to run in the browser using Pyodide. And at the bottom, we can see a GitHub link. So this whole thing is open source. That's the kind of thing that is intriguing to me. The whole project's open source. So if you want to
Like if you wanted to have an internal training for your company or for your own, like individual teachers wanted to customize this for your own class, you could, you know, fork this and do your own thing, which is, I kind of love that. And I wanted to, I was curious about, I was curious about what it's running. So I went over and I looked at the hello world. So there's, we go to hello world. There's a,
is the first time you get to actually play with the code. And there's these, like, because it's Pyodide, you're reading about Python, and then there's these little code run blocks, and you can just run stuff. And then you can start it over and do it again. But you can also just blop some new stuff in there. So I just blopped import sys, print sys version to see what Python version it was running. And it's running 3.12.1.
I was, I guess I would have been surprised if it was already running three 13. Um, but, um, but three 12 ones a bit, it kind of, I kind of expected something a little newer than that. Anyway, it's still pretty, it's better than three eight everybody, but, uh, yeah, three 12 one, not bad. So, um, just to be able to just sort of run a few things. So what all does it got in it? Let's, um, uh, if we go to the intro, there's a, uh,
I forget what I was reading. Nevermind. Yeah.
It's just Python's used everywhere. We love Python. And if some of the courses are out of reach for you or if you'd like to have something on the go, this might be something to look for. Or especially the real thing I was thinking is people like teachers trying to customize their own introduction or different things that they're trying to teach using Pyodide. This is a good example. If you don't want to start with, let's begin with what a virtual environment is and your path and that kind of stuff.
Yeah. Well that, and also just, um, uh, if you'd like to write your own, like, like online tutorial book for a particular topic that you're covering, like I was thinking, uh, seeing if I could do some of this stuff for testing concepts. Um, that'd be kind of fun. Yeah. Cause I'll tell you, I, I, um, I know some folks that do research and work with teachers like middle school teacher type folks and they're
they were choosing some kind of programming language to work with with their students, and they decided, they're like, oh, we should use R because R will install on Chromebooks more easily than Python. I said in a message, no, no, that's actually, you can install them both. However, if you're using iPads for school or Chromebooks, your web browser works just fine, right? Yeah, with something like this. It's a really good option. Yeah, exactly. Or Chromebooks.
or a lot of other new platforms. And these, so we'll see, we'll see more of this stuff coming along, I think. So,
We absolutely will. Very cool. Let me tell you real quick about Scout APM. They're big supporters of Python Bytes, so we appreciate that very much. So if you are tired of spending hours trying to find the root cause of issues impacting your performance, then you owe it to yourself to check out Scout APM. They're a leading Python application performance monitoring tool, APM, and
that helps you identify and solve performance abnormalities faster and easier. Scout APM ties bottlenecks such as memory leaks, slow database queries, background jobs, and the dreaded N plus one queries that you can end up if you do lazy loading in your Thorium, and then you say, oh no, why is it so slow? Why are you doing 200 database queries for what should be one? So you can find out things like that. And it links it back directly to source code so you can spend less time in the debugger and peeling logs and just...
finding the problems and moving on. And you'll love it because it's built for developers by developers. It makes it easy to get set up. Seriously, you can do it in less than four minutes. So that's awesome. And the best part is the pricing is straightforward. You only pay for the data that you use with no hidden overage fees or per seat pricing. And I just learned this, Brian, they also have it.
They provide the pro version for free to all open source projects. So if you're an open source maintainer and you want to have Scout APM for that project, just shoot them a message or something on their pricing page about that.
So you can start your free trial and get instant insights today. Visit PythonBytes.fm slash scout. The link is in your podcast player show notes as well. And please use that link. Don't just search for them because otherwise they don't think you came from us. And then they'd stop supporting the show. So please use our link PythonBytes.fm slash scout. Check them out. It really supports the show. So remember I talked about
Trying to be more efficient on PyPI.org and not just, especially under Docker and containers, not just blasting it every time like, hey, my requirements are my PyProjects.toml or whatever results in 200 dependencies downloaded. And let's start fresh every time I do a build or run a PR test or something along those lines, right? And I wrote that article recently.
on my website that talked about several different things. How do you install Python using UV? How do you make, how can you set up caching both for pip and for UV to make that better? And we both said, well, GitHub is probably the most, probably the worst
of all of these things. Like, and I think you even mentioned that wouldn't it be awesome if GitHub would actually just realize, oh, you're getting something from PyPI out of CI. Let's just give you the one we got like the other half a million times today or whatever, right? So all of those statements remain true and valid and I definitely encourage people to check that out because it's,
I feel like we could just do a lot better and not just destroy PyPI in terms of traffic and financial bandwidth. But what I wanted to bring up was someone in the audience, I think it was Henry Schreiner, but I'm not 100% sure, pointed out that there's this thing called setup-uv. I'd
I'd never heard of it. Mostly I don't do much with, uh, with, um, CI, GitHub CI, that kind of things. Personally, it's just, I don't know. It just doesn't fit into my life. It's not a requirement that I got to do a lot. So I just don't play with GitHub actions that much, but this is a GitHub action. If you go to the thing, I'm the repo I'm linking to, it says, use this GitHub action with your project. Click here. But the idea is it will set up a GitHub action workflow for both installing a specific version,
version of UV, managing the UV version and managing the caching of all the things it downloads. Isn't that cool? Oh, that's very cool. Yeah, exactly. So it says it will install a version of UV and add it to your path. Thank you. That's handy. Cache the installed version of UV to speed up consecutive runs on self-hosted runners. That's kind of nice. Okay.
it'll potentially, optionally, persist the UV cache in the GitHub Actions cache. That's what I'm talking about, where you can get it to say the second time your CI runs, if it's still the same requirements. Both, this is good on PyPI, I mean, gentle and kind to PyPI, but it also means that it's faster. You don't have, if there's some kind of
source distribution that has to do an install or something like that. You know, some of these dependencies are slow to install if they got to compile, but once they're cached, they're super fast. So this will make your PRs and all of your CI just run faster. So I think that's great. And then there's some other things
checks, but you can come down and basically specify a particular version. You can pin it to a, what is that? A minor version, like a 0.3, whatever latest you can have check sums, and you can even set up a caching with your GitHub actions. So that's about all I know about this, but I know people who do a lot with GitHub actions. I'll probably be able to take this and run with it. And I am, I'm with a Rhett, Rhett Turnbull says, I haven't tried UV yet primarily because
because I didn't want to mess with uploading GitHub actions, this will be very handy. I have been using UV, but I haven't added it to any of my GitHub action other projects. So yeah, I'm definitely going to check this out. Hey, Rhett, glad to hear you like it. Okay. The last topic I've got is I was thinking again on the people kind of starting things new, maybe possibly students.
is learning some html and um especially uh i was this is nice i wanted to highlight html for people.com and it's nice just sort of an online book and i just noticed that the the phone on the uh there's there's a great image on the front the phone on the on the desk is at the time is 404 nice i
I think that's funny. Although they should have made it two o'clock for 200. Okay. I mean, you want to start out on a positive note, but that's really clever. I like it. But it's a, it's just a really well-written website and I, and it's really clean looking, but I was looking through the introduction and really kind of reminded me how I learned HTML. So I learned HTML way like back, back in the old days in the nineties. And I,
We didn't have a lot. There were some HTML generators, but I, we just wanted to, I wrote most of my HTML by hand, just in a BI or something and probably Emacs at the time. But anyway, uh,
so this walks through actually building in a website, like, uh, it walks through doing a website, adding content. Um, uh, it does talk about maybe using a better text editor. If you're just using, uh, a, uh, just a basic text editor, there are better ones. Um, talking about style, adding an about page, a blog, a resume, some great stuff for especially college students to, to kind of do something, uh, nice in rise. HTML is a website.
There's even some bonus chapters on it had some simple CSS that it was including, but basically customizing the CSS that was included in the course. And then also covering some CSS basics, because that isn't new since when I was back in the 90s, right?
write in HTML, no CSS there. But now it's almost, it's essential that you learn at least a little bit of CSS along with your HTML. And maybe you're not going to write a pure HTML website, but especially with things like static generators or templates, there's a lot of HTML we still write, even if you're not writing raw HTML webpages. Um,
So going through a tutorial that just talks about the basics of HTML, I think it's a great way to get started. Yeah. I love it. And that's great. It's got a little bit of a hat tip to Kenneth Wright. Although I don't know if there's any connection, but you know, for human sort of thing. I noticed that if you go to the bottom, you have GitHub stuff for finding, for getting the source code. And if you need it offline and stuff like that. Yeah. Oh, cool. Yeah.
That's neat. And it's got a Creative Commons license. Oh, interesting. Yeah. Non-commercial. Attribution non-commercial share like 4.0 international license. It's one of the longer Creative Commons license I've seen, but very nice. Yeah. Cool. CC by NCSA 4.0. I'll have to look at that one. I don't exactly know what all that is. Yeah. Yeah.
Anyway. I love it. That's a good one. Extras? Extras? I don't have any extras. Do you have any extras? Just a couple real quick things. So last time, I think it was last time recently we spoke about something we must replace micro-Whiskey with something else and I just wrote down some thoughts and some links and some alternatives on my blog about that. So people can check that out if
if they're interested. That's a brilliant idea. Some of the stuff that we talk about on this episode or this podcast, we could write blog posts about. Yeah, sometimes I just want to shine a light on something and we did that to put on the podcast, but you know, the entire world doesn't necessarily listen. They should, but they don't. Really? So they can find it. I know, it's so odd, Brian. I did meet somebody once who didn't listen to the show.
Okay. Well, I know you got something else, but I wanted to say if you could be a good friend to all of the rest of your friends, if you share this podcast with them. Yes, absolutely. Absolutely. All right. So people would check that out if they want to follow up on that. Also want to give a shout out to Carlton Gibson.
He's one of the co-hosts for Django Chat, but that's not why I'm shouting him out. I am because he created an extension for Django, Django Unique User Email. So by default, the Django user model, I believe, requires you to have a username in addition to your email. And it's the username that's unique, not the email that's unique, which is kind of weird. Anyway...
Carlton fixed it. So there, I fixed it. And he created this login by email with your default user model for Django by making auth.user.email, the database, still unique with a key constraint. So anyway, not a whole lot to add to that, but it's got steps on how to install it as a Django app and make it go. But I think this kind of feels like it should have been there all the time. So well done. Same as required, but certainly. Certainly does. You know what else is required? What?
A joke. Yes. Let's do it. Now, this one is kind of a choose-your-own-joke. I didn't pick ahead, but what I found is a source of many jokes that I can foresee coming at some point here, Brian. Okay. I found the practical dev on GitHub has created an oh-really full-res...
for a whole bunch of O'Reillys. You know what these are, right? Yeah, they're like mock, like fake O'Reilly books. Exactly. Exactly. So let's check out the Ignoring Deprecation Warnings one. See what that one's like. So...
Maybe they'll just go away on their own. It's a sleeping cat that says, ignore deprecation warnings. Nice. What do you think? That was pretty good, right? I like it. Yeah. Plus I like cats. I do. Cats are nice. I'll see if I can find, what about this one? This one says, is that a camel, I think? Does it run? Just leave it alone.
Writing code that nobody else can read. The definitive guide. Oh, really? Oh, funny. And the definitive Pearl book had a camel on the front. Right. Let's see. I'll find. Oh, how about the big regex by trial and error one? If I click this button, does it give me the full view? Nope. Okay. So this one is combining slashes and dots until a thing happens. Okay.
expert regex by trial and error with a very curious giraffe peeking around the corner adding slashes and dots yeah until something happens all right well that's what i got for you you all could poke around in there maybe we'll come back some other time in the future and grab a few more good ones buzzwords like buzz buzzword first i mean that's but buzzword first development fashion forward development buzzwords first design i love it that reminds me of uh um uh
Design by, or is it resume driven design? Yeah, that's it. There you go. That's right. So nice. Well, good jokes and good talking with you. And yes, as always talk to you later. Yeah. See you later. Bye everyone.