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 Okken.
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, on fosstodon.org.
We are at mkennedy, at Brian Okken, and at Python Bytes.
And if you cc 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/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, 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, that was a long intro.
Maybe it could be a little more brief with you.
I'm going to try.
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.
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 stars 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 webpage at briefer.cloud, you can see a little bit more of like, what the heck is this thing about?
Okay.
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 in your notebook.
And you've got to put your password and your connection string in your notebook.
That's not, that's really 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.
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 and it 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 like different charts and stuff next to each other.
And then they're just web pages that people can check out.
This is pretty cool.
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 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 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?
So, yeah.
Anyway, that's what I got.
People can check it out.
And if you're over here, of course, there is a dockercompose.yml.
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, I 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.
I kind of, and 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, why, there's a few things that I like about it.
One of them is it's not a complete overview.
It does not try, it says, 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 Talk Python training to get started.
But 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 Quarto, which I think we've covered this, Quarto Publishing System.
I believe that we have.
Yeah, that comes from the Shiny folks as well.
Some people who make Shiny for Python that I mentioned before.
Well, it's based on that with a Quarto 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 wanted to have an internal training for your company or for your own individual teachers, wanted to customize this for your own class, you could fork this and do your own thing.
Which is, I kind of love that.
And I was curious about what it's running.
So, I went over and I looked at the Hello World.
So, we go to Hello World.
There's a...
It's the first time you get to actually play with the code.
And there's these, like...
Because it's Pyodide, there's the...
You're reading about Python and then there's these little code run blocks.
And you can just run stuff.
But...
And then you can start 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 3.13.
But 3.12.1's a bit...
I kind of expected something a little newer than that.
Anyway, it's still pretty...
It's better than 3.8, everybody.
But, yeah.
3.12.1, not bad.
So, just to be able to just sort of run a few things.
So, what all has it got in it?
Let's...
If we go to the intro, there's a...
I forget what I was reading.
Never mind.
It just...
Python's used everywhere.
We love Python.
And if you're...
If some of the courses are out of reach for you, or if you'd like to have something to...
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.
It's all in the...
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 if you'd like to write your own online tutorial book for a particular topic
that you're covering.
I was thinking, seeing if I could do some of this stuff for testing concepts.
That'd be kind of fun.
Yeah.
I'll tell you, I know some folks that do research and work with teachers, like middle school teacher
type folks.
And 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.
By the way, I said, 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 a lot of other new platforms.
And these...
So we'll see more of this stuff coming along, I think.
So it's good.
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, 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 ORM.
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
healing 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 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/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/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 PyProject.tomla or whatever results in 200 dependencies downloaded.
And let's start fresh every time I do a build to run a PR test or something along those lines.
And I wrote that article 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.
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?
Yeah.
So all of those statements remain true and valid.
And I definitely encourage people to check that out because 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 never heard of it.
Mostly I don't do much with CI, GitHub CI, that kind of things.
Personally, it just, I don't know, it just doesn't fit into my life.
It's not a requirement 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 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
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.
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.
If there's some kind of source distribution that has to do an install or something like that,
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 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 checksums.
And you can even set up 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, they'll probably be able to take this and run with it.
And I'm with Rhett.
Rhett Turnbull says, I haven't tried UV yet primarily 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.
Awesome.
Hey, Rhett.
I'm 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 especially, I was, this is nice.
I wanted to highlight HTML4people.com.
And it's nice.
Just sort of an online book.
And I just noticed that the phone on the, there's a great image on the front.
The phone on the desk is at, the time is 404.
Nice.
I think that's funny.
Although they should have made it 2 o'clock for 200 okay.
I mean, you want to start out on a positive note.
Yeah.
But that's really clever.
I like it.
But it's just a really well-written website.
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 in the old days, in the 90s.
And we didn't have a lot.
There were some HTML generators, but 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.
So this walks through actually building a website.
Like it walks through doing a website, adding content.
It does talk about maybe using a better text editor.
If you're just using just a basic text editor, there are better ones.
Talking about style, adding an about page, a blog, a resume.
Some great stuff for especially college students to kind of do something nice.
In raw HTML as 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 writing HTML.
No CSS there.
But now 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 web pages.
So going through a tutorial that just talks about the basics of HTML, I think it's a great way to get started.
Yeah.
So 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 humans 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.
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 licenses 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.
Anyway.
Right.
I love it.
That's a good one.
Extras?
Extras, extras.
I don't have any extras.
Do you have any extras?
Just a couple of real quick things.
So, last time, I think it was last time, recently we spoke about something we must replace.
MicroWizGoo is 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 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 some of them.
Yeah.
Sometimes I just want to shine a light on something.
And we did that depending on the podcast.
But, you know, the entire world doesn't necessarily listen.
They should, but they don't.
Really?
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, 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 can check that out if they want to follow up on that.
Also, I 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, you knew a 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 it created this login by email with your default user model for Django by making auth.user.email,
the database deal unique with a key constraint.
So, anyway, not a whole lot to add to that, but, you know, 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.
Seems required.
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 O'Reilly full res covers for a whole bunch
of O'Reillys.
You know what these are, right?
Yeah.
They're like mock, like fake O'Reilly books.
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 one's 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?
I click this button doesn't give me the full view.
Nope.
Okay.
So, this one is combining slashes and dots until a thing happens.
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 can poke around in there.
Maybe we'll come back some other time in the future and grab a few more good ones.
Buzzword.
Like, buzzword first.
I mean, that's buzzword first development.
Fashion forward development.
Buzzword first design.
I love it.
That reminds me of 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.
Yes, as always.
Talk to you later.
Yeah.
See you later.