Python Bytes - #403 A machine learning algorithm walks into a bar…

Episode Date: September 30, 2024

Topics covered in this episode: uv under discussion on Mastodon erdantic: Entity Relationship Diagrams Extra, Extra, Extra Django Extra, Extra, Extra Extras Joke See the full show notes for this... episode on the website at pythonbytes.fm/403

Transcript
Discussion (0)
Starting point is 00:00:00 Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds. This is episode 403, recorded September 30th, last day in September. And this is Brian Ocken. And I'm Michael Kennedy. And if you'd like to connect with us to suggest something or whatever, you can send us a link, a contact form at pythonbytes.fm. You can watch the show live, pythonbytes.fm you can watch the show live pythonbytes.fm live for more information about that um you can always uh usually mondays at 10 but um uh you can check
Starting point is 00:00:33 those out on youtube later also um and uh this episode is sponsored by us so check out our our offerings courses on talk python training and also also also at python test.com. Um, also a shout out thanks to the Patreon supporters that we still have. So, and if you'd like to connect with us, um, uh, you can find us,
Starting point is 00:00:52 find the links in the show notes for our, uh, fostered on links. So we're on mastodon. Also, Michael still hangs out on X sometimes, so you can get in there sometimes. And when people talk to me over there,
Starting point is 00:01:04 I'll, I'll go talk to him for sure. All right, well, let's kick this off with a discussion very much from Mastodon. This is a blog post from Simon Willison and the title, opening sentence, I don't know. Whatever it is, it's UV is under discussion on Mastodon and Jacob Kaplan Moss kicked off a fascinating conversation about UV on Mastodon.
Starting point is 00:01:29 And it's worth reading the whole thing. I think it's pretty interesting. You know, we've got this really powerful and transformative tool that's kind of improving Python packaging. That's been a little bit rough on various edges. And yet it's definitely not the first one of these to come along, right? We've got many of them that have been successful. We have Hatch, Poetry, PDM, even Pip, ENV, and all these different things that have tried to do this. And
Starting point is 00:01:57 I don't feel like there was much controversy about them. And it's this interesting mix of why are people worried if someone else goes and makes another attempt to work? You know, on the other hand, I think part of the reason people are really invested in this and debating should use UV, should you not as a good, is it good for Python is it's so effective and it's taking over so much that people are like, wait, this is the new way. This is the way things are going. And I just think it's so effective and it's taking over so much that people are like, wait, this is the new way. This is the way things are going. And I just think it's really fascinating that people are, I don't know, considering this. So there's a bunch of different comments that people made.
Starting point is 00:02:36 And I'll just kind of give a flavor of it and you can go check this out. But I think it's just interesting. Before I jump in, I, for one, am a fan of UV. I think they're making really meaningful change. And so in that sense, I'm kind of in the Hennick camp of this conversation. So Russell Keith McGee says, as enthusiastic as I am about the direction UV is going, I haven't adopted them yet because I want to very much understand Astral's business model more in that in a minute. So that's very interesting. Henrik says, as much as I hate VC,
Starting point is 00:03:09 FOSS projects, you know, there's a worry that because it's VC funded, it'll flame out. FOSS projects flame out all the time too. If Frost lost interest in PDM, there's no PDM anymore. Same for OFAC and Hatch and so on. So like, look, this could fix packaging and we'd have open source code to run with afterwards.
Starting point is 00:03:29 One of the concerns I think that Glyph also is the one to bring up here is that because it's written in Rust, it's more difficult for Python people to maintain. And while I think that's fair, I think that's also, there's a lot of Python that's written in C. I mean, it's C Python.
Starting point is 00:03:45 And so to say that it's not Python is not necessarily fair, you know, because there's a lot of things that we do in Python that are C based. I think the difference might be there's more people currently working in Python who also know C versus people currently working in Python who also know Rust. You know, I think that's kind of the mix there. But to say, oh, it's in a different language, like, well, Python itself is a different language, so there's that. Maybe two more things, and then I'll wrap it up here. Henning also says about Rust,
Starting point is 00:04:12 I don't think you all quite grok what UV makes so special due to your seniority. The speed is really cool, but the reason Rust is elemental is that it's a single compiled blob that you can put onto your machine as a binary, and it will bootstrap Python, it will bootstrap Python packages, Python projects, and just the deployment thing. And I really agree with that. I think that's been the missing piece and an ongoing challenge of Python's to just be like, here, have this thing you run like, well,
Starting point is 00:04:40 let's have a conversation about a few things before you can run that code, right? Just working on that this morning with another project like this doesn't run as smooth as it should. Christopher Neugebauer says, just drop in here to say that corporate capture of the Python ecosystem is the number one thing that keeps me up at night subject in my community work. So I watch Astral with interest, even though I'm not worried. Speaking of, let's go and see an authoritative response from Charlie Marsh, founder of Astral with interest, even though I'm not worried. Speaking of, let's go and see an authoritative response from Charlie Marsh, founder of Astral. Y'all are worried about the business model.
Starting point is 00:05:11 So here's the deal. I don't want to charge people money to use our tools. I don't want to create an incentive structure whereby our open source offerings are competing with any commercial offerings, which is what you see with a lot of hosted open source SaaS business models. That's true. What I want to do is to build software that vertically integrates with our open source tools and let's sell that software to companies that are already using Ruff, UV, and et cetera,
Starting point is 00:05:36 alternative to things that companies pay for today. And that's some examples and so on. You can all go read this, but this is quite interesting to keep your thumb on the zeitgeist of UV and packaging and all these things. I'm going to, I guess, put my spin on it on both sides. I liked Armin Roeniker's comment of what UV is doing, even in the worst possible future outcome, it's very forkable and maintainable thing. So even if like something happened with Astral and Astral suddenly became evil, there's an escape hatch. The other side of that is also I actually I like Charlie.
Starting point is 00:06:19 I don't think Charlie Marsh has any nefarfarious ideas but there's nothing stopping him from selling the company and the new owners taking it into a different direction um and so that that's the side that like you know charlie might have the greatest intent but the next owner might not um and that's where an escape hatch is okay um but also i'm totally a UV fan boy and I'm not worried right now. Yeah, I think it's fair about the selling. And I also think Charlie is a good guy. I think it's fair about the selling, but that could also be,
Starting point is 00:06:54 I'm not doing this open source project anymore. I'm giving it to someone else. Although the incentives are much stronger when there's money involved, for sure. And I think from Armin's perspective, his article, which i think i covered a while ago called ryan uv august is harvest season for python and packaging is an excellent take and much much more thorough than just yeah a mastodon thread all right anyway i thought that
Starting point is 00:07:18 would be you know i'm glad simon wrote that up and i thought it was worth highlighting so all right um well let's hop over to something a little smaller, maybe not smaller, but anyway, Erdantic. I just wanted to, I can't remember where I saw this, but anyway, it's a fairly new thing. It looks like it's been out, oh, a few years, but it's active development right now. What is it? Erdantic is entity relationship diagrams that are based on Pydantic models. So it's a simple tool for drawing entity relationship diagrams for data model classes. And it supports modeling frameworks such as Pydantic, adders, and data classes. And so this is one of those things of maybe sort of inside baseball, but basically if you're dealing with data structures,
Starting point is 00:08:15 especially if they're mapping around your system and mapping around your databases and whatnot. And database tools often have these diagram things that you can look at, but the stuff going into your application, the data using, the data sets that are being used in your application, you might not have these tools around. So this is kind of neat. And it allows you to basically draw these relationship diagrams for your data in your system. It's pretty straightforward. I like these. You know, one thing that's really cool about these pictures, Brian,
Starting point is 00:08:45 when you're working on a project, it's one you've created, you've been working on a long time, you have probably a really strong mental model of what are the conceptual pieces and how they fit together and what the data looks like. But if somebody is new to a team or new to an open source project or they get dropped in as a consultant, you're like, what do we got going on here?
Starting point is 00:09:04 What is all of this? Tools like Erdantic let you just go, bam, show me a visual representation of this. And I think that's a huge jumpstart if you need a help there. Yeah, so you can do it after the fact. Like if you're jumping into a system, you can use it to draw the diagrams. Or if these are part of your documentation or even internal documentation to help somebody come up to speed. But you also might like for yourself, throw these in the docs so that like, you know, six months from now you come back and you're like, Oh, how, how is this? Also,
Starting point is 00:09:35 or even documentation and just read the doc style, right? Yeah. And also to make sure things don't go haywire. So often you have a mental model that your system makes sense, but then when you draw it out, you find all sorts of like crazy, it's like a crazy tree in a forest. You're like, oh man, I didn't think it was that complicated. I need to simplify things. So visual tools are great for that. The one, I guess one beef with it is that it's based on GraphViz, which,
Starting point is 00:10:06 which is a very widely available, but it is, it's probably easiest on Linux and Mac, but it, you can do it on Windows too, but it might be a little bit more difficult to get GraphViz going on Windows. Maybe, maybe not, but I've, I've had issues in the past trying to get running. So, but anyway, that's it. Just a little graphing tool. I love it. Well, let's switch back to what I got to cover because I have a bunch of things and I'm making this an extra, extra, extra main section
Starting point is 00:10:34 because otherwise this will be an hour and a half long show. We don't want that. It's not bites. It would be more than a bite. So I want to talk about a couple of things. First of all, this is news to you. You're learning about this unless you've been spying on the website, which I find unlikely because you're familiar with it already. But if you, just Friday, I was messing around with some custom search engine
Starting point is 00:10:56 in my browser. And I'm like, I think, I don't know, I just searched for something on Python Bytes. And I'm like, wouldn't it be cool if we could just integrate python bytes search right into your browser and our search url you were able to it was a get style search you could do a get style search on it so you could actually plug it in as a custom extension but i went farther so that if you're over on pythonbytes.fm and you pull up the source there is now an open search description specification in this bad boy here that, don't really want that, but that actually describes how search works. And so if you go over here and you type pb space, see how it says search Python bytes?
Starting point is 00:11:38 Oh, wow. But watch this, uv space, D-O-C-E, Docker, UVX, all these things. Isn't that cool? It has autocomplete and everything off of our actual transcripts and our show notes and all of that. So then you just go over here, hit Docker UV, boom, and then there's the shows that we talked about, those various things.
Starting point is 00:11:58 So anyway, if you go to Python Bytes and you click the little search icon, it says right below, add our search engine directly to your browser learn how here and so you click it it actually shows you the couple of steps it's super easy i did a similar thing for talk python as well because once you do one you're like oh i see how i do for the other they weren't identical but they were similar what do you think i think i'm gonna be using this all the time we've covered a lot of topics and occasionally I'm like, when did we talk about that thing? I like it. Yeah, yeah. Me too as well. So I think that's, that is pretty excellent. So yeah, I'm really excited about it. All right. Next of the extra, extra extras is I wrote, we talked about passkeys I think a little while ago. So I actually wrote up a little article on
Starting point is 00:12:42 passkeys, password managers, whether you should use them. And then there was some debate with people. I said, hey, I put out a post about this and someone replied and said, people do not use password managers to store pass keys. I'm like, do they or do they not? I have no idea. Who are using it? So I put out some Twitter and Mastodon polls on, which one is this? This is Twitter.
Starting point is 00:13:04 44% of the people are using password managers for their passkeys. And 20% are just letting their OS go, do you want to save a passkey? So yes, and 30%, 35% not. That's really high adoption, actually. And on Mastodon, I think four or five times as many people are using password managers
Starting point is 00:13:20 and half of them are not. So pretty interesting, right? Yeah. Anyway, people can check out this article. A little bit of follow-up So pretty interesting, right? Yeah. Anyway, people can check out this article, a little bit of follow up there. Well, that's next. I think you should have added one extra like survey thing of what's a passkey. That's true. People did say, Hey, I'm storing them in hardware, things like Yiba keys. Yeah, I didn't, I didn't quite have that there. I think that fell under the password manager thing. Related to that, because remember, I was worried about lock-in, right?
Starting point is 00:13:48 You're like, passkeys are cool, except for this is the way for Apple and Microsoft and Google to say, just stay more in our platform. Please don't leave us. We want to make it nicer for you by helping you stay here. So Pablo sent over this recommendation of Vault Warden, which is an unofficial Bitwarden-compatible server written in Rust, formerly known as Bitwarden RS, that you can basically self-host your own Bitwarden sync and servers.
Starting point is 00:14:15 And so when you run Bitwarden, you can tell it, here's my server, not the commercial one, the SaaS one. All right, you notice anything weird about my display? I mean, people don't really need to see the display here or anything but look at this brian see the bottom where my tabs are so i'm trying to live the the tabs on bottom lifestyle i've been watching a lot of people use arc and then there's zen browser which is a firefox type thing but i still think vivaldi and especially after the search stuff that we were doing i still think vivaldi is the best the best browser hands down for example firefox you can't do this cool
Starting point is 00:14:49 search thing i told you about they give you a list of six search engines i hope you like one of them good with that you don't get a pic anymore you don't get to add anymore same with zen browser chrome will let you add it but it won't do the auto complete it will just do the search safari auto discovers it through the open search thing but i don't know how to actually search it i don't know that it uses it may or may not use the search things i can't make it work but bivaldi has it like here's the auto suggest here's the here's the search here's all the things right anyway a lot of those newer shinier browsers are all about like put your tabs in kind of this hidden mode or whatever. So I'm trying to go for like a little less distraction.
Starting point is 00:15:26 It is surprisingly hard to put the tabs on the bottom from a mental model perspective. But give it a week and you'll be good with it probably. We'll see how long I last. It's never bothered me that they're at the top, but yeah. Well, so here's the thing. It doesn't bother me either. It didn't bother me either.
Starting point is 00:15:41 But if you look at it the way it is when the tabs are not at the top, you're just focused on the thing that is up. You don't mentally realize, oh, there's all these other things up there. It takes actual conscious thought to go, oh, look at the bottom and see what else is open. Almost to the point of it being a flaw. But it's kind of just like, this is the thing you should be focusing on now. Don't worry about the other stuff.
Starting point is 00:16:03 Anyway, that's the thinking for me anyway. All right. And PyCon 2025. I, that's the thinking for me anyway. All right. And PyCon 2025. I don't know if we've covered this. I know that we talked about where the new upcoming PyCons are going to be, right? The 2026 one is I think Long Beach, right? This one is back in Pittsburgh.
Starting point is 00:16:22 However, the dates are listed on python.org. Have we mentioned this before? I don't think so, right? I don't remember. We should search for it. Well, we should totally search on python.org. Have we mentioned this before? I don't think so, right? I don't remember. We should search for it. Well, we should totally search for it. Yes, if we only could. So May 14th to May 22, 2025 is PyCon 2025.
Starting point is 00:16:38 So the US PyCon. That's pretty awesome. People can check that out, right? Yeah. Because, you know, my brother's like, hey, I want to come visit you. I'm thinking of coming in May or maybe April. Is that all right i'm like uh i don't know there's not many things that i gotta do that are going to make me not be able to be around but pycon might be one of them it would be nice to know when it is well here's when it is it's in may i may go don't know yep all right well that's all the extras that i got okay well i've got a bunch of um uh i
Starting point is 00:17:07 liked all your extras i'm going to do a whole bunch of extras also but django related so this is a django themed extras so we've got um from the pycharm blog uh django project ideas and i actually kind of love this because i'm i'm working on some django projects myself and sometimes you just want to play around with Django or any other web framework to figure out, like, I want to try to learn, like, do a project. But there's to-do list, and then there's, like, what else could you do? And that's where I love this jump off.
Starting point is 00:17:38 So there's some tutorials that are well-known. The Django, normal Django tutorial for beginners, useful. PyCharm has a air temperature, or JetBrains and PyCharm has an air temperature app tutorial with a step-by-step tutorial you can walk through. But after you've gone through the tutorials, what do you like, you know, what should you do? So there's some great ideas, and I like how it's listed. So like for instance, you could do a blog, and what should you do um so there's a there's some some great ideas and i like how
Starting point is 00:18:06 it's listed so like for instance you could do a blog and what would you learn there well you could learn you'd learn about the django admin uh django templates um and then uh doing an editor because if it's a blog you're probably going to do an in in in application editor so maybe you could try that um so the this is all set up with what tech stack you would run into or the different pieces of Django or extra plugins that you would learn. And then, and then a little blurb about it. They also, about the blog, they recommended the Django tutorials, Django girls tutorial, because it talks about a blog, which is great. There's the to-do app that you would learn single page applications and Django templates. A recipe organizer.
Starting point is 00:18:48 I love this idea. I don't know why I didn't think of that. But you'd learn about databases and the ORM and templates and JavaScript is optional for additional security. I don't know how that works out. But just a whole bunch of cool ideas around maybe a URL shortener, expense tracker. That's kind of a neat idea. A social network. And then personal portfolio.
Starting point is 00:19:10 That's pretty neat. And then a lot of these, one of the things that I like about these, these are things that would be useful to you, even if nobody else uses it. So it's just, even if you just put this up for your own use, it'd help you learn Django and you'd get some useful tool. And then there's some advanced projects, which I like. The idea of multi-user sites, classified site or something, maybe for your neighborhood or for even work. A classified site for your own job, like where you work, it'd be kind of neat. People could sell their stuff to friends and colleagues. Anyway, I love this idea.
Starting point is 00:19:42 There's a lot of examples there. Yeah. It's a lot of examples there. It's a pretty fun list. So that's my first extra on Django. These Django project ideas from JetBrains. Really good list. Looks like fun. This came from Jeff Triplett.
Starting point is 00:20:02 He just put this together recently, I think, or at least posted it recently. DjangoTV.com. It is a list of talks and tutorials from Django conferences around the world. It's kind of a neat resource. I love that idea. That's super cool. Yeah, it's kind of new, but I'm sure it'll grow. So a bunch of great stuff will show up.
Starting point is 00:20:20 Django Commons, also a new thing. I learned about this from Lacey Hinchel. And Django Commons is an organization dedicated to supporting the community's efforts to maintain packages that are Django-related packages. So there's some great information about how to join this group, how to transfer a project into the group, how to transfer a project out of the group, and some code of conduct and FAQ. Again, this is just sort of getting started, but it's a cool idea, Django Commons. A couple more things around Django. I did see, so in Django 5, we did get some simplified templates for form field rendering. But if that's not enough for you, you might want to try IOMI forms. So IOMI forms are a different take on Django forms. And they wrote a post why we wrote a new form library for Django. So just a little different take if you've struggled with Django forms,
Starting point is 00:21:19 maybe try Django 5, but also maybe try this. Yalmi forms might be a good thing. And the last Django extra I have got, this comes from Adam Johnson. He introduced a template formatter called Jade, D-J-A-D-E. But we'll have a link to this article in the show notes, of course. So what this is, is you've got all these, we're used to black for using black as formatters or probably uv now um or rough um but uh what about like for forms the template forms um so that's what this there's that's where this comes in uh jade is a a something like black
Starting point is 00:22:02 but for um for forms so there's some examples of um like for instance uh the old form django 2 of load static files you're supposed to just say load static now so having it automatically just change that for you it's good so yeah yeah not just format it but fix it yeah um things like making like if you have weird space weird spacing things just to make it easier to read. I like it. So yeah, that's awesome. I love it.
Starting point is 00:22:28 Those are my, I like that idea a lot. Let's get some for the other formatters as well, or the other templates as well. Rather. Oh, that's a good idea. Right. Ginger or whatever. Maybe it exists. People should let us know if it exists.
Starting point is 00:22:39 Yeah. All right. All right. How about some jokes? Ah, jokes would be great. Oh, wait, I have one more extra if we're already to jokes. Yeah, yeah, yeah. The one extra I got, this came in from, who sent this in?
Starting point is 00:22:54 So we've got, I want to give credit where credit is due. So this came from Raphael Weingardner, and he suggested we take a look at this. And I thought it was a serious thing at first. The open source project maintainers guide. Have you looked at this yet? No, I've not. Okay. Is it kind of like your blog?
Starting point is 00:23:15 Monetization? It's just, it's like how to have an open source project and have people not help you maintain. Got it. So first off, use a source control mechanism other than get. So maybe try Subversion or Mercurial or Bazaar. Or even just like SQLite. What is SQLite doing?
Starting point is 00:23:39 Where are they busting on them? I don't know. Anyway, so use something other than get um only accept patches on a mailing list um isn't linux core like that or like usenet or something yeah require a contributor license agreement like that's funny if to sign something um don't have community forums or leadership so so no discourse to Zulip and definitely not Slack or Discord. Ignore detailed reports,
Starting point is 00:24:09 systematically close reports, prioritize features over bugs. There's a lot of projects like that, I think. Wait for the big rewrite, merge half-paked patch sets, bike shed all user visible changes. This is my favorite, only use outdated language standards.
Starting point is 00:24:24 So like for instance, current language standard for C++ is C++23. user visible changes. This is my favorite. Only use outdated language standards. So like, for instance, current language standard for C++ is C++ 23. 17 is widely supported. So why not use 03? I would say like, why not just stick with C++ 98? It was fine in my day.
Starting point is 00:24:39 It's fine now. Anyway, it's good enough for your grandparents. It's good enough for you. Yeah. Anyway, these are some amusing lists of things to do for an open source project if you don't want people to help. Yeah, that's pretty funny. Okay.
Starting point is 00:24:54 If you do want people to help, though, you might have a joke like this. A machine learning algorithm walks into a bar. The bartender asks, what do you have? The algorithm says, what's everyone else having? It's because it's trained on everyone's data. It all it knows oh that's funny yeah it took me a while yeah it's not lose your mind funny but it's amusing yeah so thank you chet haas i like it so indeed well another uh another episode python bites in the bag thanks for joining thanks brian thank you bye

There aren't comments yet for this episode. Click on any sentence in the transcript to leave a comment.