Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.
This is episode 289, recorded June 21st, 2022.
I'm Brian Aachen.
Hey, I'm Michael Kennedy.
And I'm Gina Heuske.
Welcome, Gina. I'm so glad that you could join us for the show.
Well, I'm still very, very honored that I'm allowed to be on here because I've been a long-time listener.
And yeah, so being on here is absolutely amazing for me.
That's very cool. So tell us a little bit about yourself before we jump in.
Yeah, well, so I think my claim to fame most likely is that I'm the creator and maintainer of Octoprint,
which is basically a web front end slash print server for 3D printers that I've been now maintaining for almost a decade, actually.
So this December, it will be a decade.
And it's written in Python, which is why I have gotten more and more interested into the language over the course of the past decade.
And also now hang out on conferences when I get the chance.
And there is no pandemic going on right now.
And in general, just kind of fell in love with the language, I got to admit.
I used to be a Java developer.
I'm very glad that I no longer am.
And now I'm a full-time open source maintainer, actually, because I'm in the very lucky position that people apparently love Octoprint enough that donations and such and sponsorships and such generate enough revenue that it can work for me.
Oh, that's awesome.
Very cool.
Pretty awesome.
That is so fantastic.
Yeah.
I still don't know why it works, but hey, I'm taking it.
Well, Michael, you got our first topic today.
I do.
I want to combine some things that we've covered before as a way to introduce something new.
So way back when we talked about something called Mangita.
Have I mentioned that I like MongoDB?
I think this might be something I've been talking about.
Like, I love MongoDB.
I think it's great.
Love working with it from Python.
It works super duper well for me.
Now, one of the things I'm envious of on the relational side is SQLite, which ships with Python, and you don't have to start up a server or anything.
Just say, here's a file.
That's my database.
Let me point database tools like SQLAlchemy and stuff at it, right?
With MongoDB, we haven't really had anything like that.
But then we did talk about this thing called Mangita, which is Mangita is to MongoDB as SQLite is to SQL.
So that's pretty awesome.
You pip install MongoDB, which has a beautiful little character for its icon.
And you pip install this thing, and then you can just create a disk connection or a memory connection or stuff like that.
It's not incredibly fast, but you know what?
Fast enough, right?
Fast enough for simple apps, for demo apps, or if you're teaching a class or something like that.
It's sort of my primary, basically demos, YouTube video demos and class examples and stuff.
I don't want to have people set up a whole database server they maybe have never set up.
Just to play with an example, right?
So here's a cool way, except for it only does like the low-level MongoDB API.
So I'm a big fan of Beanie.
I reached out to Roman Wright and said, hey, do you know of anything that will allow Beanie to work with something like Mangita?
And he said, not really.
So I'll make one.
Where did I put it?
Oh, no.
If I copied.
No, I.
Yeah.
So I had the wrong one selected.
He did Beanie, the ORM.
And I said, I want to use this ORM against the disk database, much like you would SQLAlchemy against SQLite.
He said, no, I don't know of one of those.
But what if I made Beanieta for Mangita?
And so I love the naming here.
That's why I wanted to put them all together.
So Beanieta is a local DB-like database ready to work with Beanie, right?
So basically, all you have to do to work with this is import client from there, create a client, paste that, give it a directory just like you would SQLite, pull a database off of it, and then just call initialize Beanie like you normally would, but pass it this Beanieta database.
So it just works off the file system.
So now you've got a local, mostly compatible MongoDB disk-based in-process thing that you can use for simple MongoDB examples.
It has some things it doesn't support, links, which are like following references across documents, aggregations, which is a whole crazy data analytics aspect of MongoDB, and unions, and other things that Mangita doesn't support.
So I'm pretty sure.
Let's just double check here.
Yeah, so it basically just builds that wrapper on top of Mangita.
And the real challenge that was tricky here was Beanie is only async, and Mangita is only sync.
So you've got to somehow put those together.
Anyway, thank you, Roman Wright, for doing this.
It looks really cool.
And we could come up with a joke for this, but I think that's Benita's.
Oh.
Oh, Brian, that was solid.
That hurts.
Yeah.
Sorry.
Not sorry.
Okay.
So I think that I'd like to talk to people about using good coding practices, especially in research and science.
So I ran across Patrick Minolt.
It's an online book, really.
It's called The Good Research Code Handbook.
And he says it's for grad students, postdocs, and PIs, which I had to look up, was principal investigator, who didn't do a lot of programming as part of their research.
And I think it's also just kind of a good thing for really anybody that's coming into coding from a different field and wants to jumpstart some good practices.
It's actually really kind of great.
He's got a little roadmap, which is neat.
I'll click on that roadmap.
A little small here.
But it goes through.
It's got a journey mapped out there.
I love it.
Yeah, it's nice.
But kind of a visual of where you're going to go with this.
But he talks about setting yourself up for success using Git and virtual environments and projects and even packaging and cookie cutter, which is cool.
Talks about style guides and keeping things clean and removing dead code.
Some coding practices like separating concerns and separating your pure functions from side effect functions, which I thought that some people don't really touch on right off the bat, but it's a good practice.
Even talks about testing, although the focus is really around unit testing and sort of some hand waves around in-to-end testing.
But still, it's nice.
And then even gets into documentation and social aspects like doing pairing and peer reviews and getting involved in open source and community.
It's actually just really kind of a pretty solid look for people.
Sounds great.
Yeah, that's really great.
I think it's, yeah.
Go ahead, Gina.
No, I just wanted to say it sounds great.
Because I sometimes have people joining Octoprint who are pretty much newcomers to the whole coding aspect, but are interested in writing a plugin or something like that.
So that might be a good resource for them to just direct them to.
I had, you know, I'm, go ahead, Brian.
I had somebody contacted me once and try to, I wish I knew about this before because somebody contacted me and said, we don't really need coding training, but we kind of aren't used to working together well.
We're all individual people.
And now we're working as a group and we don't know how to do that.
And I don't know if that's here, but a lot of this around this is sort of good practices for working well with others.
Michael?
Yeah.
What I was going to say is a lot of people, especially in this research field, learn to code in a jit fashion, like just enough learning of coding to get the problem solved.
And then they just, they have to keep moving on and it's easy to find yourself just stumbling into wrong patterns of, well, everything's into one huge file and it doesn't take like command line argument inputs.
It just hardcodes the values in.
So you can't reuse it.
It's not a module you can import or a function you can call.
And it does no error checking.
These are, yes, exactly.
No, no testing.
All of that kind of stuff would be really valuable for people who are coming from that angle.
So definitely a good thing to check out.
And I love it.
Goodresearch.dev.
What a sweet domain name.
There's also one of the neat things about the writing style is he's talking about trying to just free yourself from time.
So not free yourself from time, but as a researcher, you're in a hurry.
There's a lot of stuff to do.
And a lot of the stuff he's trying to get people to do is about offloading information so you don't have to keep it in mind.
So he talks about short-term memory and long-term memory and how, you know, like unit tests and inline code comments are good to, you know, short-term reminders in the moment.
And then project documentation and test suites are about keeping that knowledge long-term.
And that's kind of a, I never really thought about that before of short-term versus long-term information.
But it's kind of a neat angle as well.
So anyway.
Yeah, that is clever.
So where are we going next?
We have something that I brought along.
And given that I come from a 3D printing background now, I thought I would start with something that can be applied to 3D printing.
And that is a Python library for building parametric 3D CAD models.
It is based on, for those of you who have heard of the open source CAD solution called FreeCAD.
It's based on the same CAD kernel, on the same modeling kernel, and allows you to, yeah, programmatically design stuff.
And that is pretty amazing if you want to do it parametric.
So, for example, imagine that you have some kind of case for an electronics project or something.
And you need screws from, screws, screw holes at certain distances, but maybe you want to be able to scale that up or down or whatnot or things like this.
And for stuff like this, something like this is absolutely amazing.
From the ground up, CAD query is only a library, but it also comes with, as it says here, it also comes with a QT-based GUI called CQ Editor.
Nice.
Which I tried out and worked great.
The only problem was it came with an older version of CAD query that did not yet support some stuff that I wanted to play around with.
So what I did instead was I tried the Jupyter extension and just threw that up on my NAS in a Docker container.
And that works absolutely wonderfully.
In the browser, it gives you a 3D model view of the stuff that you're currently modeling, automatically refresh whenever you change something.
And the way things look is, this is the GUI, by the way, you simply create, you define a work plane, then you create a box on this, for example.
Then you say to the top face in Z direction, define that as a work plane, put a hole through that with a diameter.
So the whole API is pretty intuitive as well.
Also well documented on here.
And if you scroll a bit through the examples, you can see that there is way more possible than just planes with holes.
But things like, where was it?
Somewhere there was a...
Right.
A flask or the aforementioned parametric enclosure, a Lego brick.
So for all of that, there is examples, example code there.
And yeah, it really surprised me how quick I got this up and running because I had a very specific use case that I wanted to try to run through that.
And that was inserts for one of these part case thingies where you can put inserts into sort screws and stuff.
And that worked flawlessly with that.
I had this finished in maybe half an hour or something like that.
So really great package, works nice, has everything that you expect from a basic cut solution and also works in a browser.
So if you want to go fully parametric and already know Python, then give this a look as well as free cut.
Very cool.
Yeah, this looks super.
Yeah, I have a friend who is doing a lot of Python and CNC machines.
He has a guitar company and it gets these wood blocks and shaves out guitars and necks and things that I'm not familiar with.
Would this be applicable to something like that as well?
Not just 3D printing, but if you've got to define the polygons of it, basically?
The objects that it can output are STL files, object files.
I think step export is also available.
So all the stuff that you find commonly in the CNC and 3D printing world.
So I could just design something with this, export the STL, throw it in a slicer for my 3D printer,
or alternatively throw a resulting step file or something into whatever workflow preparation I do for my CNC router, I guess.
So I'm not that familiar with CNC.
Yeah, yeah.
I think this huge CNC machine, I think it takes STL files.
I'm pretty sure.
Well, then.
I'll have to check.
But that sounds like it could be really relevant.
A couple of pieces of feedback.
Daniel Kras says it's nice because he hates the GUI workflow of FreeCAD.
Yeah.
The funny thing is CAD query originally started out as a FreeCAD plug-in, actually, as far as I see.
So the CAD query 1 was FreeCAD, still built into FreeCAD.
CAD query 2 is now standalone and just uses the kernel and all that.
So really nice.
For people who used to use OpenSCAD, that one is the next level and really nice.
And then Brandon Branner, hey, Brandon, says, can you import this into a slicer for 3D printing?
Yeah, that was what I meant with you can export the STL and then throw that into the slicer.
Yeah, that's what I thought.
Perfect.
Awesome.
This is a great find.
I love it.
And I also, I love that you come with your experience and your view of Python and what's super interesting,
because I would have never picked this, but it's very cool.
And a lot of people are into it, right?
It's just like, I'm like, oh, FastAPI.
Yeah, it's stuff like that.
Yeah.
Different point of view, I guess.
I want to do some 3D printing.
It'll be fun.
It is, but be careful that you don't start a hobby project that then takes over your life
that sometimes happens, I've heard.
Well, so that's why I put that off, because I know that I don't need another one.
Brian, I heard you have some awesome 3D Star Wars stuff.
And maybe you could like build in, like you could print some additional stuff to go with it.
I could.
Yeah.
Or just buy it.
Yeah, there you go.
Or you could just buy it.
I just actually bought a part.
So I needed a camera mount.
So I had a camera that the one I'm using now, there's other applications where I want to use
that I don't, I didn't have a mount for a tripod mount.
And there was somebody on Etsy that it's obviously a 3D printed thing that you can buy.
So Etsy is full of people making useful things with 3D printers.
I think that's neat.
And $10 to somebody else to do it for me?
What a deal.
I'm happy to report that I'm currently looking into a camera that is sitting on a mount that I designed and printed myself.
That's neat.
Wow.
That's awesome.
Yeah.
So that mounts to a VESA monitor arm and then has a little slide that I can actually slide up and down to adjust the height.
And I also have some of these angle brackets that are with tripod mounts on the up and down side that I can use to adjust the tilt and stuff.
And yeah.
So after I did this, that thing finally set where it is supposed to sit.
So win-win.
Awesome.
That's awesome.
And just for people listening who are not watching, Gina has the best video setup of all three of us.
She looks great.
Yeah.
It's a really good studio setup.
All right.
And then parting thought on this one.
Henry Schreiner.
Hey, Henry.
Says, 3D work from Python has always been tricky.
So this looks great.
Right?
You ready for a fun one?
Yeah.
Let's switch to you.
All right.
I got something cool.
So previously I spoke about TextSniper.
This is a Mac app and it lives in the menu bar, like up by the clock.
And you just run it and you can, on Mac, you can hit Command Shift 4 and select a region and screenshot it.
This one adds Command Shift 2.
And if you select a region, it will capture the text out of whatever is behind it.
So for example, I was on a meeting on Zoom and somebody put something up and like, oh, I want to have notes on that.
And I thought, oh, I could type it.
Wait a minute.
Command Shift 2, swipe on Zoom.
Boom.
I have notes to the whole page instantly.
Right?
This is a cool app.
It's like 11 bucks for the Mac.
This I sort of randomly mentioned that I thought it was cool.
This is not what I'm talking about.
What I want to talk about is Brett, Brett Turnbull said, hey, I heard Michael talk about this TextSniper thing I just described on Python Bytes.
That's neat.
I bet I could build this in Python.
So he did.
Nice.
Isn't that dope?
So if we jump over here to the, I love the name.
I got so many good names today.
I mean, I didn't get them.
I just gathered them up.
So we have TextSniper for that thing that grabs the text.
He created the Textinator.
And it's a simple macOS status bar menu bar app that automatically detects text within screenshots.
So instead of adding a new hotkey that does its own thing, you just do Command Shift 4, copy it, and then it hooks into macOS through PyOBJC, figures out a screenshot was taken, grabs it, real quickly uses the neural engines in macOS and the Apple Silicon and stuff to do the text processing.
And then drops out the answer.
And if you look at the whole app, the entire app end to end is 450 lines of code.
That's brilliant.
Yeah.
Very cool.
And if you look at this, like, let's see, oh, boy, there's a lot in it.
So you can see it's, you know, from Foundation, from Coco, you know, Import, NS Notification Center, and all these different things is what it's basically using to listen for events of screenshots being taken and then feed those off into the various places that it needs to go.
So what do you think?
I think it's awesome.
And Rhett's in the audience.
And he says, oh, yeah.
Hey, Rhett.
Thanks for the shout out.
And then, of course, somebody says, just for Mac, power.
I'm both weasel on that.
I'm afraid.
Gina, what do you run for your OS?
Actually, Windows.
Yeah, to the big surprise of many.
But I'm also a gamer.
So I got tired of constantly dual booting.
So, yeah.
That's definitely a challenge.
So there's actually a video showing you how it works.
And it uses something I've built apps with as well called Rumps, ridiculously uncomplicated macOS menu bar apps or something like that.
And so it's really an interesting way where it's just kind of like clicking together a couple of cool things like the NS query for Spotlight with PyOBGC, the vision VN recognized text request, and like just building on top of macOS and Rumps, which is pretty cool.
You do have to give it special permissions because it has to be able to monitor your system globally.
So there's a few steps you got to follow.
But well done, Rhett.
I love the ambition here, and it looks good.
But this is incredible.
What I love about this is it's just one thing, but it's a small application.
So, I mean, potentially just you could come up with all of these pieces.
You could do other stuff, too, and have just a small example to try to learn off of.
That's pretty neat.
Indeed.
Let me just make a real quick suggestion out there.
Maybe.
I'm not sure.
I don't see it over here, but over on the releases side, on my Rumps app, I did this, and I put over in the releases, you can come over here, and you can just download a .app zipped, but it just unzips as a .app file.
So get that with some Py install.
No, Py2.
Use Py2 app on it and make it one cool further step there.
And maybe automate that with GitHub Actions.
Yes, that's a very good point.
Absolutely.
So you don't have to constantly keep doing it.
Yes, very good point.
Push to a branch, have it do some magic.
Magic.
Or click on release and have it do some magic.
That's always wonderful to watch in the log.
Yeah.
You know what I find is that people that set that stuff up, they release apps like this more frequently.
They're like, oh, it's just one feature, but I don't mind pushing the button, or I can just push to that branch.
And the more that you have to do it manually, make sure you don't mess up stuff, and don't forget to bump the version, and you just do it a lot less frequently.
So there's some really cool knock-on effects of that recommendation.
I went through a lot of pain to automate testing and release tasks in Octoprint, which also involved, by the way, flashing physical hardware.
And so I built a lot of stuff so that all of that is more or less at least semi-automated, because that takes so much work out of every single release.
That's absolutely insane.
So, yeah, automation.
It's great.
Yeah.
I do have to add.
So, yeah, there's a couple.
I don't maintain that much stuff, but I have to admit that I am reluctant to bump versions, because then I'm like, I got to push it out to PyPI then, and I haven't automated that through GitHub Actions yet.
So, yeah, I got to get on that stick.
So, okay.
I'd like to talk about locks, actually not using locks.
So, this is an article called Handling Concurrency Without Locks from Haki Benita.
And it's just sort of a nice, actually, this is intimidated at first by flipping and getting ready to read this article, but it was really well written.
So, the idea is it starts with a Django application, and it's a URL shortener, actually, you were just talking about.
But there's, so there's like an idea that you've just sort of walks through it.
The idea is you have something that creates a unique URL, but that uniqueness is checked because you keep a database of it.
And so, you check to make sure it's unique, and then you create it, make sure it's unique, and then store it in the database.
But that check has to hit the database, and you've got a read-write thing, and there's a concurrency problem.
I know there's lots of ways to get around it, but it's a reasonable use case to just think about.
But there's a lot of places within Django or within web, actually, and within actually all applications where if you're using a database, there's this concurrency thing might be a problem.
And you can get around it with locks or other things, but the discussion kind of goes through basically broadening it up a bit and just talks about collision problems and locking problems in general.
And with some nice diagrams, I can't remember where they are on the page, but nice horse.
But it's kind of a good, slow walk.
Here are some diagrams.
And then, okay, going on, continuing on with the article, the idea is like once you know it's unique, you're storing in the database, the database is already going to, if you set it up right, it's already going to make sure that he is unique.
So instead of making sure you can do it ahead of time and then doing it and making it, then checking for database errors, just assume that it's right and throw it into the database and then watch for any problems.
So basically using the database as the uniqueness indicator.
And then he talks about how to do that and then how to structure code a little bit to deal with those issues and then recover from it gracefully if that happens.
And then the side effect is you're faster because you're not putting the concurrency locks within your application.
You're depending on that uniqueness and that control of the database, which is already fine-tuned to allow multiple access and keep track of that.
Just utilize that.
So it's a neat reminder to everybody to utilize the tools under you, I guess.
Yeah.
Good reminder.
Do you do much database or Django stuff?
Me?
No.
I think I've never so far even touched Django and I try to avoid databases like the plague.
Yeah.
I'm a huge enthusiast for flat files.
And yeah, I don't know.
I can do that stuff.
They are quite valuable, right?
Yeah.
It's just, it takes so much complexity out of the system.
If you can somehow avoid having to run a database server or an SQLite file somewhere or a Benita file.
Yeah.
I've been working on a project, which I'm not really talking about yet, but it's, I've been thinking, well, could this just be a bunch of local JSON files?
You know, I'll talk about that later, but yeah, it's, yeah.
Could it just be?
Maybe.
If it's not, if it's 20 records or something, maybe just a JSON file is all I need.
I mean, sometimes there's no way around it, but.
Yeah.
I've got a project with a very small database and it's in, it fits, it's a very tiny text file as we, as we started out.
But, but the problem always is as long as soon as you get more than one user, you have concurrency problems.
Even if the application isn't multi-threaded or multi-processed and, and we're running into that.
So switching to, it does feel weird to have to switch to a database just for that.
And you, I mean, you can get around it also.
You can put the, you can just say, Hey, if I don't already have a database, I can put the concurrency in, in the server so that, so that that is handled there.
You can do that, but.
Could be sure.
Yeah, for sure.
My example is a client side, like desktop type story.
So there's only going to be one user.
There might be two people hitting the keyboard, but it'll be one in one app.
Cool.
But I also just really like thinking about, well, if you have a database and you have an ORM,
in what ways could you just leverage that?
And then instead of, like you said, well, let's, you know, from threading, import re-entered locks, the R lock, and then take those.
And then you do pay the price for every successful time.
And if it's one in a thousand or more that you're going to hit that problem, you know,
pay that price and that little bit of complexity of catching like the integrity error and then reporting the error instead of reverse.
That's great.
Yeah.
All right.
What do we have next?
Yeah.
Next, we have something that I have not yet had a chance to test out myself, sadly, but which I could have used roughly five or six years ago.
Really hard.
So I thought maybe I should make a mental note now and share it here.
So I will remember the next time that something like Tatsu exists.
And Tatsu is a library with which, sometimes English is hard, you can generate parsers for Python.
So Python-based parsers based on eBNFs.
So I think the E was for extended and BNF is Bakus-Naur form.
So a very structured way to define a grammar of a language of a file format of whatnot.
And textual, I should add, though maybe also binary, but that sounds like a lot of pain.
And that looks like something like, I'm looking for a good example.
Let me quickly...
Yeah.
So, for example, this is a grammar.
And then you turn that into a slightly annotated grammar.
And in the end, you run this through Tatsu.
And then Tatsu spits out something which builds an AST out of your thing that you put into it that is supposed to be parsed.
And apparently, Tatsu cannot only do that.
So it can do, on the one hand, in this kind of way that we know from the RE module, from the regular expression module in Python,
where you can compile a pattern and then reuse it during the duration of your code.
But you can also generate Python code itself out of it so that you can then import it as a module and reuse it and reuse it.
Maybe also adjust it, but I don't know how well that works.
And apparently, it is also compatible to Antler grammars, which is a name I haven't heard since university.
So that is nice, I guess, for people who have grammars lying around that are written in Antler, I think, version 4 or something like that.
And yeah, so this is really one of these things that I wish I had found sooner when I had a desperate need to generate a parser from an EBNF,
because writing an EBNF is sometimes way easier than writing a parser.
And yeah, now I have it.
But now it's too late.
For people who are listening, the EBNF, the grammar file, it looks a little bit like a YAML definition, a tiny bit, a little bit like a little bit of regex.
But you basically specify the rules of the language and then you can take that and run with it, right?
Yeah.
In a way, you basically say you have an expression and that expression consists of this other components.
And then these components are defined further down.
And so you dig deeper and deeper into the syntax and build up the definition from that, basically.
Like if you've ever seen one of these JSON grammar railroad diagrams, it also goes a bit like this, just in textual form.
Yeah.
Once I was teaching a class and it's...
Go ahead, Brian.
No, I just...
I was getting PTSD from my language classes in college.
Yeah.
That's admittedly also where I learned about this stuff.
But for some reason, I...
Yeah.
Back then it was horrible.
Now I kind of like it.
It's weird.
Yeah.
It just makes it so easy to well define something.
Yeah.
And no pressure.
And now I see the advantages because it makes it so much easier to define structured text and stuff that you need to use in machine communication.
So if I had had an EBNF or if I had had that like 10 years ago when I started an Octoprint, I would have written an EBNF for the...
Yeah.
Basically for the G-code stuff that runs between a printer and Octoprint to communicate over the serial interface.
And then it would have been way easier to pass that the way it is now.
I had to do all of this by hand.
And yeah.
But maybe I can rewrite it with this.
We'll see.
Yeah.
It seems useful if you wanted to create a simple, higher level scripting language that controls your app.
Right?
If, say, you were writing code for scientists in a lab and those scientists were not developers, but you could say like, okay, you can enter a couple of simple expressions and it'll like move the robot around or it'll like upload the results or, you know, something like that.
Right?
You could probably build that with this.
And that seems neat.
And then the other thing that's noteworthy here is this is 3.10 or above.
And I'm sure that's because it's the peg parsers match effectively the switch statement that's in Python 3.10.
True, true.
Right?
Also, with regards to data science, I could also imagine this helps maybe with parsing weird data formats that you have in Textual that fall out of some legacy software that is running on some ancient sun cluster or something that is connected to your measuring devices.
So I could imagine that could also help there.
Good idea.
Right.
Is that it for our items?
I think it is.
Do you have anything extra?
All right.
Of course.
Of course, I've got some extras.
Let's see.
Me too.
Let me pull up something real quick.
All right.
I know.
Fantastic.
All right.
I'll throw mine out.
So not here.
In a recent episode, we covered, where was it?
It was the PEP 690.
Oh, okay.
285.
Thank you.
Yes, that's it.
So we talked about PEP 690 and Lazy Imports, and this was recommended by Itamar.
This comes out of the Cinder project and other things.
Since then, I've had Barry Warsaw, Armand Bravo, and Carl Meyer on Talk Python to discuss this, which was fun.
And they've also written this up as a formal blog post.
So people were interested in that, and they wanted to just go dive in.
I just want to point out that that's a pretty intense dependency graph right there.
It's this black cloud of dots all connected and stuff.
So there's some really interesting things from Instagram's use of this and whatnot.
Very neat.
People can check that out.
There was an expedited release of Python 3.11 Beta 3 because of an incompatibility with pytest.
Brian, can you imagine?
Yeah.
It was fun.
I do know about this.
Yeah.
So I do.
I found it amusing.
In one of the announcements, it said, apparently, pytest is well used.
No, can't be.
No way.
I think it was a joke, but it made me laugh.
Yeah.
But the fix was no joke.
So there's a quick fix that rolled out for people if they want to check that out.
And then last thing, I kind of threw out a teaser for this episode saying, I just did something completely silly and weird.
And I think I might like it.
I'm not sure.
So for a long, long time, I've used DuckDuckGo.
Right.
And I really think that DuckDuckGo is fantastic.
And I may just keep using that.
But let me give a little credit here.
Daniel Herthom sent us a message and said, you know, this isn't really Python related, but if I know Michael, I bet he will love this ad-free privacy-respecting search engine called Kagi.com.
Have either of you heard of Kagi?
I had not.
Never.
No.
And so it's pretty interesting.
I went and I listened to or read.
I listened with my eyes.
I listened to this interview.
Watched this interview.
There's an audio version, so I keep stumbling on that.
But Vladimir Perlovak is the founder of Kagi.
It was founded in just March.
So it's really brand new.
Talks a lot about the motivation for creating the search engine.
And basically, he says, I think the ad tech, which I think maybe should be called more like surveillance capitalism or something like a little more serious.
But ad tech, putting all these ads and tracking in front of my kids.
I don't want my kids to grow up thinking that just like being completely tracked and having zero privacy is like the way of the world.
So there's a pretty interesting conversation here on what they built.
But the idea is it's a search engine that is a premium search engine.
So instead of having ads, users have to pay for it.
So I'm going to do an experiment for us, Brian.
I'm going to live with this for a month, and then I'll give you a report on what I think.
I think that'd be great.
Yeah.
So check this out, for example.
Pep690 lazy imports.
What happens if we put that up there?
So comes up with the peps page.
And check that out.
Number three.
And then probably somewhere a little farther down, since it's not in the title, is Python bytes, I would suspect.
But like these results are pretty interesting.
But check this out.
So I can come over here and I can hover over next to one of these.
And it says, oh, this is on this page.
This one doesn't have that much information about it.
Some of them.
Let's see.
Maybe this one should have it.
So before you even visit it, it'll say there's four trackers.
It's this ranked by traffic.
It'll use HTTPS.
It's fast or not.
It lands in this category.
And you can upvote and downvote things.
You can push things up and down.
That is a power feature.
For example, isn't that cool?
You can say W3 schools.
I never, ever want you to show up ever, ever again.
Exactly.
That was my thought.
Yes.
It's so horrible.
They're so good at SEO and they're so bad at writing meaningful, helpful stuff.
So you could just, when I got my first W3C result, schools result, I just did block that.
And so you can, for example, go to like the docs on python.org and say, you know what?
That one's higher for me because if I search for Python stuff, I'd kind of want to get the
official discussion.
Yeah.
The other thing you can do is cool is you can have these lenses.
So you're saying, I'm only interested in programming stuff right now.
So it takes you to like GitHub and stuff like that.
And then you say, you know what?
I'm just actually, what I want is just more results.
Just basically search GitHub for all of this.
And the final thought here that's cool is it deranks.
So, you know, I showed you like different sites.
So here, let's put, let's put something embarrassing for a company that needs to be embarrassed.
CNN.
So if you hover over this, how many block?
There's 43 ad detectors on this thing.
43.
Here's what they do.
They are down ranking and down voting, like lowering the SEO rank of things that have tons
of ad trackers and things like that.
So if you, if you're overwhelmed like this, where it's orange or red, like that's a, that lowers your rank.
So it's like an anti ad tracker result surfacer.
Anyway, what do you all think?
I'm tempted, but I'll let you test it first.
Yeah.
Give me a month.
I didn't think I was going to like it that much.
It's, it's pretty nice.
So I paid 10, it's $10 a month, which seems a little high.
I think they are getting their results by buying API access to Google and Bing and then resurfacing
those results to you.
in, in this privacy respecting way.
Yeah.
Actually, I kind of think it's brilliant.
And I want to try it too, because at first I was like, I don't want to pay for a search,
but I, you know, I know I try to tell my kids, if you're not, if you're not the cuss, if you're
not paying for it, then you're not the customer or the product.
so yes, absolutely.
Absolutely.
And, and even if it wasn't for that, that the customization options are just like amazing.
Like, I don't know.
Yeah.
The fact that you can say, I prefer more of this site, less of that site.
Yeah.
It's, it is pretty neat.
So, I really, I really appreciate that Daniel sent this in and I'm going to live with
it for a month and I will let you know, but the maps doesn't work very well.
They don't work very well, but you know, you can always just go to somewhere else.
A final thought.
The whole reason I switched to Vivaldi over Firefox is I didn't want to bring other things
like ad block and you have ad blocking tracker blocking and stuff there, but then you have
to get extensions.
And then those extensions send their data back.
And then sometimes they'll like, well, these ads paid to be let through our ad blocker.
And there's just like still kind of a tracking level.
So with, with Vivaldi, you know, you get like total blocking without third party things.
So with this, you kind of get a search engine that is like a good, good match to that.
So anyway, I think it's, I think it's cool.
And, anyway, I just wanted to give it a quick shout out here.
Cause it seems fun.
funny thing.
I think that's it for everything.
Okay.
Funny thing.
I, in this, the chat, eco V or Eki, Eki Voo, says I use a, I use a custom Firefox
extension to block W3 schools.
That's interesting.
I didn't know that existed, but.
Yes.
I installed that as well.
And I, Eki Voo, that is an absolutely worthwhile thing to do.
I totally agree.
So I'm with you.
I used to use that as well.
I also use something that like, I'm, it was, it was called, I'm okay with cookies and it
would automatically accept all cookie disclaimers, you know, the cookie warnings.
It would just say, okay.
And there's, I saw almost none of them.
And then I just blocked them on my network.
So it doesn't matter if I accept them or not.
well let's jump to Gina's extra stuff.
It's only some small stuff.
So one thing, can you share my, thank you.
so one thing is something that, I mentioned before that I went through a lot of pain to automate
a bunch of stuff about the testing and Octoprint, which involves some raspberry pi cluster here
that I can flash via, a Python tool and stuff like this.
And I also needed voltage monitoring for this raspberry pi cluster, because I don't know how
familiar you are, you are with raspberry pies, but they can be a bit, let's say,
uh, selective about what power supplies they like.
And, they start browning out, easily and stuff.
So power monitoring is very helpful.
And there are these cheapish 30, 40 bucks, USB, power and voltage monitoring dongles
that you can just plug, between two USB cables, and then it will measure everything.
And they also come with Bluetooth.
And I found a tool that can, lock the data from this Bluetooth interface, via
PI BlueZ.
It's, it's written in Python from these UM24C, UM25C or UM34C dongles in order to, to allow
you to track the voltage and power over a course of, yeah, whatever.
So I have to set up, lock this out, throw that into an influx DB, throw it up on a Grapana
dashboard and get warnings when something underpowers.
And that is great for sleeping, about the test cluster situation.
And the other thing is something that reached me actually just last night in the shape of
a tweet.
And that is that there is now another node JS PI PI distribution that you can just depend
your, Python apps on that will then pull in for you a complete node JS distribution
with npm with node and with NPX.
So if you have like me, for example, if you happen to build a web server that also ships with
a web UI built in, then now you have a way to ensure that, everything that you need
in order to build that web UI is also there and can also maybe make this part of a build
process that you build into your, set up PI or something like this as well.
So that was a really nice thing to discover.
I still considered alpha, but I tried it briefly this morning and, really great.
That's cool.
That's really cool.
That is fantastic.
Yeah.
That's super interesting.
you could pair that with PI script and have it do a little electron thing and then
just run that run Python, write Python for your little web app that runs on the front
end.
Yeah.
Or if you do something like, so for example, I still use Cypress JS for end to end testing
in Octoprint, which means that, I now need a node JS environment and a Python environment
in order to have all developer dependencies together.
This would solve this problem because then I could just make this part.
Maybe I could even fire it up as part of the PI test suite.
I don't know, but, would be interesting.
Certainly to test that out.
Definitely.
Very cool.
Brian, it sounds like a PI test fixture needs to be put in place.
If you want to do the, if you want to do that, that would be great.
I'll put it on my to-do list right after 3d printing.
yeah.
I, I know the problem.
we're kind of, since I'm running, we're running a little long, I'm going to skip
my extras till next week.
so let's, maybe jump to something funny.
Nathan Ashberger.
It's a tweet.
and it's like, you pretend you're getting a call and, and the, and the phone says, Hey,
I'm from somewhere.
we built the first AI driven sales platform.
And I wanted to talk to you about your sales needs.
he says, wait, are you an AI?
no, well, we can both appreciate the irony here, right?
So I don't know if this was real or not, but it just made me laugh.
That was funny.
So I love it.
Yeah.
Shouldn't they be having their AI call you with their AI platform?
It's subtle.
Yeah.
Okay.
So let's go.
Maybe yours is funnier.
Let's go to yours, Michael.
my, well, mine is as a, it's a collection of jokes.
So maybe one of them will be this, this comes to us from Brian's skin, who, as I said, has
been on the show before.
Thank you, Brian.
And these are, you know how, like you've got the Mars Rover badge and you've got the Arctic
vault badges on GitHub.
These are ones that were considered and potentially rejected.
Okay.
So let's see what's over here.
These are, they were considered.
I feel like David Letterman.
With his, his like, ad stuff.
Okay.
So one of them is the vital contributor over 100 issue comments consisting of just plus
ones or thumbs up emoji.
There's the Sith Lord who wiped out someone else's commit by force pushing to the main branch.
You could have that badge.
I have that.
The procrastinator.
Do you heard?
You could be the procrastinator.
Create a repository with a single init commit with just the readme.md and never touch it for
five years.
My personal favorite is the secret Santa accidentally commit a secret API key to a public repository.
That's good.
We have the monkey rich.
Yeah.
The monkey rich is, makes a commit directly to the main branch that breaks the build.
this is fine.
It has a dog in a room that's full of fire.
We've all seen this, main meme in some form or other.
I'm sure this is fine.
Over 1000 open issues on a public repository that you own.
Ouch.
Fine.
Let's wrap it up with the last one.
Works on my machine.
The works on my machine certification suggests user error in at least 10 issue threads without
attempting to reproduce in user runtime environments.
All right.
These are pretty good.
That would be hard to automatically detect though, right?
It would.
Yeah.
Some of these you got to self-assign, I think.
Yeah.
But yeah, I don't know if you saw that the GitHub recently actually rolled out more achievements
that you can now try to hunt.
So it's not anymore just the Arctic stuff, but there's now stuff like Merch Shark and PR Shark,
I think they called it.
And so there are several, they are hidden.
You have to figure out.
Yeah.
They, I think last Thursday or so they rolled it out, which was also when, this, this,
uh, repo, I think popped up or at least popped up.
I also, it also went past me on my Twitter feed and, I immediately shared it around with
people because yeah, it's, it's, it's good.
It's cute.
It's kind of sad that some of them didn't make the cut.
Didn't make the cut.
I think so for sure.
Yeah.
This is fine.
People definitely, definitely need that.
This is fine.
Absolutely.
Yeah.
All right, Brian.
So is that it for us?
I think it is.
It was a fun episode.
Thank you, Michael.
Thank you, Gina.
Absolutely.
Thank you.
Yep.
Bye everyone.
Thanks for being here, Gina.
Thank you for having me.