Brought to you by Michael and Brian - take a Talk Python course or get Brian's pytest book


Transcript #405: Oh Really?

Return to episode page view on github
Recorded on Monday, Oct 14, 2024.

00:00 Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.

00:05 This is episode 405, recorded October 14th, 2024.

00:09 And I'm Brian Okken.

00:11 And I'm Michael Kennedy.

00:12 And this episode is sponsored by Scout APM.

00:15 Please listen to them, their segment later in the show.

00:18 And if you'd like to connect with us and ask us a question or submit an article,

00:22 you can find us on Mastodon, on fosstodon.org.

00:27 We are at mkennedy, at Brian Okken, and at Python Bytes.

00:30 And if you cc all three of us, it actually gets to us really a lot better.

00:34 Or you can email it to us.

00:36 There's a contact form on our website, pythonbytes.fm.

00:40 If you'd like to watch live, you can join us on YouTube and go to pythonbytes.fm/live.

00:46 Be part of the audience or watch old episodes.

00:49 It's a lot of fun.

00:50 We love getting questions in the chat.

00:52 And also, finally, if you'd like to get all the links, just listen and enjoy the show while you're listening.

00:59 And then read the links later.

01:01 You don't have to write anything down.

01:03 Just join.

01:04 Go to pythonbytes.fm and get on our mailing list.

01:08 Go to Friends of the Show or just say sign up for Newsletter.

01:11 And we'll send you a weekly email with all the links and all the topics from the show.

01:16 So, to get started, Michael, that was a long intro.

01:21 Maybe it could be a little more brief with you.

01:23 I'm going to try.

01:24 I'm going to keep this one brief, okay?

01:25 Okay.

01:25 Briefer.

01:26 Let's talk about Briefer from Briefer Cloud.

01:28 So, this is new to me.

01:31 Obviously, 98.4%, according to the last survey, of our listeners know about Jupyter and Jupyter Notebooks.

01:38 Okay.

01:39 Right?

01:39 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.

01:47 And by far, Jupyter Notebooks are the most popular way to do notebook-type programming, but not the only way.

01:53 Right?

01:54 We've talked previously about Shiny for Python, which is a really cool option.

01:58 But today, I want to tell you about Briefer.

02:00 And my theory is the name comes from the thing that delivers a briefing because it's about not just exploratory data notebooks,

02:09 but it seems to be even a little more focused on delivering a dashboard experience that non-developers,

02:15 or at least not the person creating the thing, comes to look at.

02:18 They can just sort of explore it as an interactive webpage.

02:21 Okay?

02:21 Okay.

02:22 So, it is, I'll give you their little spiel.

02:26 It's dashboards and notebooks in a single place.

02:28 Create powerful and flexible dashboards using code, beautiful notion-like notebooks, and share them with your team.

02:34 And yeah, that pretty much sums it up.

02:36 So, I believe this used to be a commercial product.

02:40 Still is a commercial product, don't get me wrong.

02:41 It used to be exclusively a commercial project because they have a big banner at the top.

02:45 Briefer is now open source.

02:47 Go stars on GitHub.

02:48 And let's see how many people have.

02:49 3.3 thousand.

02:51 That's a respectable amount of traffic, right?

02:53 That's pretty good.

02:53 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?

02:59 Okay.

03:00 So, multiplayer, as in multiple people can work on it.

03:03 And I think one of the things that's unique about this compared to, say, a Jupyter notebook.

03:07 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.

03:17 Well, you've got to connect to Postgres in your notebook.

03:19 And you've got to put your password and your connection string in your notebook.

03:23 That's not, that's really ideal.

03:25 You might be able to pull in, I'm sure there's a way to pull in environment variables or something like that.

03:29 But it's not super easy, right?

03:31 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.

03:41 And then you use this tool to create visualizations and dashboards and reports, data apps and so on out of it.

03:48 So, it's like you configure the system to know about your data connection.

03:53 And then just any notebook can talk to the database, something along those lines.

03:56 Obviously, that's not a totally universal use case, but that's the idea, okay?

04:01 And it also came out of Y Combinator.

04:04 Like I said, I think it was primarily just commercial at first and then expanded.

04:08 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.

04:18 So, they've got some cool examples in here.

04:21 They have AI because Y Combinator and it has to, apparently.

04:25 But these are good looking things.

04:26 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.

04:32 And then they're just web pages that people can check out.

04:35 This is pretty cool.

04:36 Pretty neat, right?

04:37 I like it.

04:37 Yeah, I mean, then you publish it to the web.

04:39 So, the thing to know is if you look at pricing, there's two options.

04:43 Paid and not paid, right?

04:44 So, open source, self-hosted, free, install it from GitHub, off to the races.

04:49 Then there's Community, which has a free one, a pro and enterprise.

04:52 This is not any sort of ad or anything, right?

04:53 But I do think the fact that it's open source and it has these cool features, sort of executable Python is pretty neat.

04:59 There's some more cool Python stuff about it here.

05:02 I can't remember where I was reading it.

05:05 Oh, yeah.

05:05 You can also put like little sliders and date pickers and stuff that will, as people interact with them, right?

05:11 It'll update what happens.

05:13 But you can also, somewhere along here, is it a schedule?

05:16 Yeah.

05:17 You can schedule your Python blocks to run on a recurring schedule.

05:20 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?

05:28 So, yeah.

05:29 Anyway, that's what I got.

05:31 People can check it out.

05:33 And if you're over here, of course, there is a dockercompose.yml.

05:38 So, if you're going to self-host it, you can just docker compose it to life.

05:41 Nice.

05:41 Well, I know that school started last month for most people.

05:48 It's been going on for a while, but it's still kind of near the beginning.

05:51 And I was thinking about students and thinking there's a lot of people learning some new web stuff.

05:56 And so, I picked a couple topics around learning new things.

06:00 And we're going to start with Python.

06:01 So, I got this from, I forgot his name already, Jose Blanca.

06:08 And I think he's the dude that wrote it.

06:10 That, yeah, it's an introduction to programming with Python, but it's all web-based.

06:16 I kind of, and it's kind of nice, all web-based.

06:20 And it's just a free kind of a basic intro.

06:25 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.

06:34 So, why, there's a few things that I like about it.

06:38 One of them is it's not a complete overview.

06:40 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.

06:47 And I know there's a lot of great training tutorials, especially over maybe at Talk Python training to get started.

06:53 But if all you got is no money and a web connection, I think this is maybe something to check out.

07:03 I want to point out a couple other features.

07:06 It's running, if we scroll to the bottom, it's running Corto, which I think we've covered this, Corto Publishing System.

07:16 I believe that we have.

07:17 Yeah, that comes from the Shiny folks as well.

07:20 Some people who make Shiny for Python that I mentioned before.

07:23 Well, it's based on that with a Corto Live extension that allows Python to run in the browser using Pyodide.

07:30 And at the bottom, we can see a GitHub link.

07:33 So, this whole thing is open source.

07:35 That's the kind of thing that is intriguing to me.

07:38 The whole project's open source.

07:40 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.

07:52 Which is, I kind of love that.

07:54 And I was curious about what it's running.

08:00 So, I went over and I looked at the Hello World.

08:04 So, we go to Hello World.

08:06 There's a...

08:08 It's the first time you get to actually play with the code.

08:10 And there's these, like...

08:12 Because it's Pyodide, there's the...

08:13 You're reading about Python and then there's these little code run blocks.

08:17 And you can just run stuff.

08:19 But...

08:19 And then you can start over and do it again.

08:21 But you can also just blop some new stuff in there.

08:24 So, I just blopped import sys, print sys version to see what Python version it was running.

08:30 And it's running 3.12.1.

08:33 I was...

08:35 I guess I would have been surprised if it was already running 3.13.

08:38 But 3.12.1's a bit...

08:42 I kind of expected something a little newer than that.

08:44 Anyway, it's still pretty...

08:46 It's better than 3.8, everybody.

08:48 But, yeah.

08:49 3.12.1, not bad.

08:51 So, just to be able to just sort of run a few things.

08:55 So, what all has it got in it?

08:56 Let's...

08:57 If we go to the intro, there's a...

08:59 I forget what I was reading.

09:02 Never mind.

09:03 It just...

09:06 Python's used everywhere.

09:07 We love Python.

09:07 And if you're...

09:09 If some of the courses are out of reach for you, or if you'd like to have something to...

09:13 On the go, this might be something to look for.

09:15 Or especially...

09:16 The real thing I was thinking is people, like teachers, trying to customize their own

09:20 introduction or different things that they're trying to teach using Pyodide.

09:24 This is a good example.

09:25 It's all in the...

09:26 If you don't want to start with, let's begin with what a virtual environment is and your

09:29 path and that kind of stuff.

09:30 Yeah.

09:31 Well, that...

09:32 And also, just if you'd like to write your own online tutorial book for a particular topic

09:39 that you're covering.

09:41 I was thinking, seeing if I could do some of this stuff for testing concepts.

09:45 That'd be kind of fun.

09:47 Yeah.

09:47 I'll tell you, I know some folks that do research and work with teachers, like middle school teacher

09:53 type folks.

09:55 And they were choosing some kind of programming language to work with with their students.

10:00 And they decided, they're like, oh, we should use R because R will install on Chromebooks more

10:06 easily than Python.

10:07 By the way, I said, no, no, that's actually...

10:09 You can install them both.

10:10 However, if you're using iPads for school or Chromebooks, your web browser works just fine.

10:16 Right?

10:17 Yeah.

10:17 With something like this.

10:18 It's a really good option.

10:18 Yeah, exactly.

10:19 Or a lot of other new platforms.

10:21 And these...

10:22 So we'll see more of this stuff coming along, I think.

10:25 So it's good.

10:27 We absolutely will.

10:28 Very cool.

10:29 Let me tell you real quick about Scout APM.

10:33 They're big supporters of Python Bytes.

10:35 So we appreciate that very much.

10:37 So if you are tired of spending hours trying to find the root cause of issues impacting your

10:42 performance, then you owe it to yourself to check out Scout APM.

10:46 They're a leading Python application performance monitoring tool, APM, that helps you identify

10:52 and solve performance abnormalities faster and easier.

10:55 Scout APM ties bottlenecks such as memory leaks, slow database queries, background jobs, and the

11:00 dreaded N plus one queries that you can end up if you do lazy loading in your ORM.

11:06 And then you say, oh, no.

11:06 Why is it so slow?

11:08 Why are you doing 200 database queries for what should be one?

11:10 So you can find out things like that.

11:12 And it links it back directly to source code so you can spend less time in the debugger and

11:16 healing logs and just finding the problems and moving on.

11:19 And you'll love it because it's built for developers by developers.

11:22 It makes it easy to get set up.

11:23 Seriously, you can do it in less than four minutes.

11:26 So that's awesome.

11:27 And the best part is the pricing is straightforward.

11:30 You only pay for the data that you use with no hidden overage fees or per seat pricing.

11:35 And I just learned this, Brian.

11:38 They also have they provide the pro version for free to all open source projects.

11:43 So if you're an open source maintainer and you want to have Scout APM for that project,

11:47 just shoot them a message or something on their pricing page about that.

11:50 So you can start your free trial and get instant insights today.

11:54 Visit pythonbytes.fm/Scout.

11:57 The link is in your podcast player show notes as well.

11:59 And please use that link.

12:00 Don't just search for them because otherwise they don't think you came from us.

12:04 And then they'd stop supporting the show.

12:06 So please use our link pythonbytes.fm/Scout.

12:08 Check them out.

12:09 It really supports the show.

12:11 So remember I talked about trying to be more efficient on PyPI.org and not just especially

12:19 under Docker and containers, not just blasting it every time like, hey, my requirements are

12:25 my PyProject.tomla or whatever results in 200 dependencies downloaded.

12:30 And let's start fresh every time I do a build to run a PR test or something along those lines.

12:36 And I wrote that article on my website that talked about several different things.

12:41 How do you install Python using UV?

12:43 How do you make, how can you set up caching both for pip and for UV to make that better?

12:48 And we both said, well, GitHub is probably the most, probably the worst of all of these things.

12:55 And I think you even mentioned that.

12:56 Wouldn't it be awesome if GitHub would actually just realize, oh, you're getting something from

13:00 PyPI out of CI.

13:02 Let's just give you the one we got like the other half a million times today.

13:06 Or whatever, right?

13:07 Yeah.

13:07 So all of those statements remain true and valid.

13:11 And I definitely encourage people to check that out because I feel like we could just do

13:15 a lot better and not just destroy PyPI in terms of traffic and financial bandwidth.

13:20 But what I wanted to bring up was someone in the audience.

13:23 I think it was Henry Schreiner, but I'm not 100% sure, pointed out that there's this thing

13:28 called setup-uv.

13:30 I'd never heard of it.

13:31 Mostly I don't do much with CI, GitHub CI, that kind of things.

13:37 Personally, it just, I don't know, it just doesn't fit into my life.

13:39 It's not a requirement I got to do a lot.

13:41 So I just don't play with GitHub Actions that much.

13:43 But this is a GitHub Action.

13:45 If you go to the repo I'm linking to, it says, use this GitHub Action with your project.

13:50 Click here.

13:50 But the idea is it will set up a GitHub Action workflow for both installing a specific version

13:56 of UV, managing the UV version, and managing the caching of all the things it downloads.

14:01 Isn't that cool?

14:02 Oh, that's very cool.

14:03 Yeah, exactly.

14:04 So it says it will install a version of UV and add it to your path.

14:09 Thank you.

14:09 That's handy.

14:10 Cache the installed version of UV to speed up consecutive runs on self-hosted runners.

14:16 That's kind of nice.

14:18 It'll potentially, optionally persist the UV cache in the GitHub Actions cache.

14:24 That's what I'm talking about, where you can get it to say the second time your CI runs,

14:28 if it's still the same requirements.

14:30 Both, this is good on PyPI.

14:32 I mean, gentle and kind to PyPI.

14:34 But it also means that it's faster.

14:37 If there's some kind of source distribution that has to do an install or something like that,

14:42 some of these dependencies are slow to install if they got to compile.

14:45 But once they're cached, they're super fast.

14:47 So this will make your PRs and all of your CI just run faster.

14:51 So I think that's great.

14:52 And then there's some other checks.

14:54 But you can come down and basically specify a particular version.

14:58 You can pin it to a, what is that, a minor version?

15:01 Like a 0.3, whatever latest.

15:03 You can have checksums.

15:05 And you can even set up caching with your GitHub Actions.

15:08 So that's about all I know about this.

15:10 But I know people who do a lot with GitHub Actions, they'll probably be able to take this and run with it.

15:14 And I'm with Rhett.

15:17 Rhett Turnbull says, I haven't tried UV yet primarily because I didn't want to mess with uploading GitHub Actions.

15:23 This will be very handy.

15:24 I have been using UV, but I haven't added it to any of my GitHub Action other projects.

15:31 So, yeah, I'm definitely going to check this out.

15:33 Awesome.

15:33 Hey, Rhett.

15:34 I'm glad to hear you like it.

15:36 Okay.

15:38 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.

15:50 And especially, I was, this is nice.

15:55 I wanted to highlight HTML4people.com.

15:58 And it's nice.

16:00 Just sort of an online book.

16:01 And I just noticed that the phone on the, there's a great image on the front.

16:06 The phone on the desk is at, the time is 404.

16:11 Nice.

16:11 I think that's funny.

16:12 Although they should have made it 2 o'clock for 200 okay.

16:15 I mean, you want to start out on a positive note.

16:17 Yeah.

16:18 But that's really clever.

16:19 I like it.

16:20 But it's just a really well-written website.

16:25 And it's really clean looking.

16:28 But I was looking through the introduction and really kind of reminded me how I learned HTML.

16:34 So I learned HTML way like back in the old days, in the 90s.

16:40 And we didn't have a lot.

16:42 There were some HTML generators, but we just wanted to, I wrote most of my HTML by hand, just in a BI or something.

16:49 And probably Emacs at the time.

16:52 But anyway.

16:53 So this walks through actually building a website.

16:57 Like it walks through doing a website, adding content.

17:01 It does talk about maybe using a better text editor.

17:05 If you're just using just a basic text editor, there are better ones.

17:10 Talking about style, adding an about page, a blog, a resume.

17:14 Some great stuff for especially college students to kind of do something nice.

17:19 In raw HTML as a website.

17:21 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.

17:34 And then also covering some CSS basics.

17:36 Because that isn't new since when I was back in the 90s writing HTML.

17:42 No CSS there.

17:43 But now it's essential that you learn at least a little bit of CSS along with your HTML.

17:49 And maybe you're not going to write a pure HTML website.

17:52 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.

18:01 So going through a tutorial that just talks about the basics of HTML, I think it's a great way to get started.

18:09 Yeah.

18:09 So I love it.

18:11 And that's great.

18:11 It's got a little bit of a hat tip to Kenneth Wright.

18:14 Although I don't know if there's any connection, but you know, for humans sort of thing.

18:17 I noticed that if you go to the bottom, you have GitHub stuff for finding, for getting the source code.

18:25 And if you need it offline and stuff like that.

18:27 Yeah.

18:27 Oh, cool.

18:28 That's neat.

18:28 And it's got a Creative Commons license.

18:31 Oh, interesting.

18:32 Yeah.

18:32 Non-commercial.

18:33 Attribution non-commercial share like 4.0 international license.

18:36 It's one of the longer Creative Commons licenses I've seen, but very nice.

18:39 Yeah.

18:39 Cool.

18:42 CC by NCSA 4.0.

18:44 I'll have to look at that one.

18:45 I don't exactly know what all that is.

18:47 Yeah.

18:48 Yeah.

18:49 Anyway.

18:51 Right.

18:51 I love it.

18:52 That's a good one.

18:53 Extras?

18:53 Extras, extras.

18:54 I don't have any extras.

18:56 Do you have any extras?

18:57 Just a couple of real quick things.

18:59 So, last time, I think it was last time, recently we spoke about something we must replace.

19:03 MicroWizGoo is something else.

19:04 And I just wrote down some thoughts and some links and some alternatives on my blog about that.

19:09 So, people can check that out if they're interested.

19:11 That's a brilliant idea.

19:13 Some of the stuff that we talk about on this episode, or this podcast, we could write blog

19:17 posts about some of them.

19:18 Yeah.

19:18 Sometimes I just want to shine a light on something.

19:21 And we did that depending on the podcast.

19:22 But, you know, the entire world doesn't necessarily listen.

19:26 They should, but they don't.

19:27 Really?

19:27 I know.

19:28 It's so odd, Brian.

19:29 I did meet somebody once who didn't listen to the show.

19:32 Okay.

19:32 Well, I know you got something else, but I wanted to say, you could be a good friend to all of

19:39 the rest of your friends if you share this podcast with them.

19:42 Yes, absolutely.

19:44 Absolutely.

19:44 All right.

19:45 So, people can check that out if they want to follow up on that.

19:48 Also, I want to give a shout out to Carlton Gibson.

19:52 He's one of the co-hosts for Django Chat, but that's not why I'm shouting him out.

19:56 I am because he created an extension for Django.

19:59 Django, you knew a unique user email.

20:02 So, by default, the Django user model, I believe, requires you to have a username in addition

20:08 to your email.

20:09 And it's the username that's unique, not the email that's unique, which is kind of weird.

20:13 Anyway, Carlton fixed it.

20:17 So, there, I fixed it.

20:18 And it created this login by email with your default user model for Django by making auth.user.email,

20:25 the database deal unique with a key constraint.

20:28 So, anyway, not a whole lot to add to that, but, you know, it's got steps on how to install

20:33 it as a Django app and make it go.

20:36 But I think this kind of feels like it should have been there all the time.

20:38 So, well done.

20:39 Seems required.

20:40 Certainly.

20:41 Certainly does.

20:42 You know what else is required?

20:43 What?

20:44 A joke.

20:45 Yes.

20:45 Let's do it.

20:46 Now, this one is kind of a choose your own joke.

20:48 I didn't pick ahead, but what I found is a source of many jokes that I can foresee coming

20:54 at some point here, Brian.

20:55 Okay.

20:56 I found the practical dev on GitHub has created an O'Reilly full res covers for a whole bunch

21:03 of O'Reillys.

21:04 You know what these are, right?

21:05 Yeah.

21:05 They're like mock, like fake O'Reilly books.

21:08 Exactly.

21:09 Exactly.

21:10 So, let's check out the ignoring deprecation warnings one.

21:13 See what that one's like.

21:15 So, maybe they'll just go away on their own.

21:20 It's a sleeping cat that says ignore deprecation warnings.

21:23 Nice.

21:24 What do you think?

21:25 That one's pretty good, right?

21:26 I like it.

21:27 Yeah.

21:27 Plus, I like cats.

21:28 I do.

21:29 Cats are nice.

21:29 I'll see if I can find.

21:30 What about this one?

21:31 This one says, is that a camel, I think?

21:35 Does it run?

21:36 Just leave it alone.

21:37 Writing code that nobody else can read.

21:41 The definitive guide.

21:42 Oh, really?

21:42 Oh, funny.

21:45 And the definitive pearl book had a camel on the front.

21:50 Right.

21:51 Let's see.

21:51 I'll find.

21:52 I'll find.

21:52 Oh, how about the big regex by trial and error?

21:55 I click this button doesn't give me the full view.

21:58 Nope.

21:58 Okay.

21:59 So, this one is combining slashes and dots until a thing happens.

22:03 Expert.

22:05 Regex by trial and error with a very curious giraffe peeking around the corner.

22:09 Adding slashes and dots.

22:11 Yeah.

22:11 Until something happens.

22:13 All right.

22:13 Well, that's what I got for you.

22:14 You all can poke around in there.

22:15 Maybe we'll come back some other time in the future and grab a few more good ones.

22:18 Buzzword.

22:19 Like, buzzword first.

22:21 I mean, that's buzzword first development.

22:23 Fashion forward development.

22:25 Buzzword first design.

22:26 I love it.

22:27 That reminds me of design by, or is it resume driven design?

22:33 Yeah, that's it.

22:33 There you go.

22:34 That's right.

22:35 So, nice.

22:36 Well, good jokes and good talking with you.

22:38 Yes, as always.

22:40 Talk to you later.

22:41 Yeah.

22:41 See you later.

Back to show page