Python Bytes - #244 vendorizing your Python podcast

Episode Date: July 30, 2021

Topics covered in this episode: pip Environmental Variables * Extra, Extra, 6x Extra, hear all about it* Building and testing Python with GitHub Actions python-vendorize Extras Joke See the full... show notes for this episode on the website at pythonbytes.fm/244

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 244, recorded July 30th, 2021. I'm Michael Kennedy. And I'm Brian Ocken. And I'm Brandon Brainerd. Hey, Brandon. Welcome to the podcast. Thanks for being here. Thank you for having me. It's really good to have you here. You're one of the first volunteers, I'll put it as, when I said, hey, we're looking for some folks to come be with Brian and me on the show and throw your name in the hat. And here you are. Happy to have
Starting point is 00:00:29 you. It's very exciting. Very, very exciting. Yeah, absolutely. So before we jump into the topics, just tell us a quick bit about yourself. Yeah. So I've been in software development for 10 years. Half of it in management, half of it as a individual contributor about seven years of it with python um you know it's funny when i first started programming i lived in a raspberry pi i thought python is so confusing with not having brackets and all these spaces and so i don't understand it and no i can't go back it's so much easier yeah yeah i had a similar experience coming from um c sharp and c plus plus and stuff with all the symbols. And I thought in my mind, I thought those are necessary for programming. Like you have to have the semicolons, you have
Starting point is 00:01:10 to have the curly braces and the extra parentheses because how else will the parser and everything, like that's how you express stuff in programming. And then when I got into Python, I felt a little bit weird with the missing, but then when I went back, I felt even weirder. Like, why are all these symbols here? I just learned that they're not necessary. Why have I been doing this the last 10 years of my life? What is wrong with me? It was, it was a really interesting experience. Yeah. Speaking of interesting, Brian, um, all the stuff on PIP, quite interesting. Yeah. Um, so I, I, I don't know, we're doing this on Friday because, because I wasn't, I wasn't here on Wednesday. I was, uh, in Florida. Um, and so you're a jet wasn't here on Wednesday. I was, uh, in Florida. Um,
Starting point is 00:01:45 and so you're a jet setter, basically you just traveled in like two years, uh, for a business. Was it weird? Yeah. Was it weird? Uh, no, it was like wearing a mask all the way there. I kind of got used to no masks here in Oregon, but then now I guess they're changing all that again and we're bringing them back, but you know, what's old is new again. But one of the things I tried to do is I tried to work on the plane. And in Python, of course, so the problem with snakes on a plane is there's no internet. So I had this issue. I had, and I've already put it up on the screen, the solution. But the, so my issue was I had a bunch of, I had a project I
Starting point is 00:02:26 wanted to work on. It's got talks set up. And when you run talks, talks creates for environment, in virtual environments, and then fills those up with all your dependencies and your code using pip. Pip goes out to PyPI to get that stuff. I mean, you can cache it and that does help. And you do that locally on your machine, but it still looks out at the internet. And this won't work on a plane. So I reached out to the Twitterverse and I thought I found a solution, but I'm not even going to say the wrong solution. Paul Gansel pointed me in the direction of environmental variables in pip. You can just set find links to a local directory and then set with pip find links and then pip no index so that the pip doesn't even look out there.
Starting point is 00:03:13 It looks at a local directory. So what I did is I'm going to, I guess we'll look at, I was surprised. Go back. I got a quick question before we go on. Okay. So it'll look in that local directory for the packages, the wheels and whatnot. Yeah. How do you get them there in the first place? Okay. So I got some pre-work that I did. So I'm like, okay, how do I get those? And normally when I, when I want to put something in a local directory or something, I'll just
Starting point is 00:03:37 use a, uh, there's a pip download. Um, you can do that, but that's a lot of work to try to figure out what you did. So what I did is I just, before I got on the plane, I'm using the airport internet, which everybody can harass me later about how that's not secure. It's fine. But I ran talks. You do it at home then if you want. Run talks with an internet connection.
Starting point is 00:04:01 And what it's going to do is you're going to have a whole bunch of your environments within talks. You're going to have all your, all your, all Python seven, Python eight, whatever you got in there, or not eight, three, eight, three, seven, three, 10, whatever. You're looking at the future. Just go through all of them. Just do a search and grab all of the, uh, what do we got the, uh, site packages, directories, grab everything out of all of those and copy them to, uh, like a local wheels directory or something, something, something outside of your work environment. I just stuck it at the top level, like users are hawking or something. I stuck it up there.
Starting point is 00:04:33 And then I and then you can then that's everything because, you know, you ran it and then go ahead and set up these environmental variables. I actually just stuck the environmental variables in my in my my my, um, my, uh, just in a little script to set them while I'm, while I'm developing. Yeah. You know what I learned that was pretty interesting that the activate script for a virtual environment, you can put environment variables in there. So you could have like a offline virtual environment and an online virtual environment, and those could toggle different environment and just which, when you activate, will just make this happen.
Starting point is 00:05:05 That'd be awesome. Yeah, yeah, so that's one of those, like, it's all virtual environments all the way down. And the environments are the virtual, these environmental variables have to be set in the environment that you're running it in. So they can be set in the virtual environment that you were using to run talks,
Starting point is 00:05:22 even though talks will generate others. It just, it works right. I don't know how it works, but it works. Anyway, this super helped me out. And then when I went to, yeah, so then grab all those, throw them in there and then use the find links and no index and it'll, it'll just work great. The, the thing that, the reason why I think I didn't find it at first is that that the note within the pip documentation just says everything that's a flag within pip is also an environmental variable. It just, so if you searched for it, you probably won't find it.
Starting point is 00:05:54 It just has this comment that says, all command line options can be set as environmental variables using all uppercase and then underscores instead of dashes. So that's a cool tip. Yeah. Yeah. Brandon, what do you think?
Starting point is 00:06:09 Yeah. At first I was confused a little bit about why you wouldn't just pip install before you got on the plane, but I've never actually used Tox to do any testing. So it sounds like that installs in a different directory. So when you do your Tox runs that it needs to reinstall them. Yeah. It creates a new virtual environment you
Starting point is 00:06:25 can tell it you can run it ahead of time and you can tell it to not uh install those but i was messing with my talks my environments so i really wanted to make sure i could clean them out so you can um i think this is i mean yeah there's probably other cool solutions but that's what i used oh it's interesting though it creates all the virtual environments um so each each different like three seven three eight three nine three ten they It creates all the virtual environments. So each, each different, like three, seven, three, eight, three, nine, three, 10, they'll all be different virtual environments that it runs your tests. That's a, it's always one of those things that we depend so much on the internet to do our job that when you don't have it, like, what do I do?
Starting point is 00:06:55 So that's, that's interesting. Yeah. And that's like, you know, 20 hours of work I would have lost if I, so anyway. Yeah, this is, this is very cool. Nice, nice tip, especially the environment variables just for pip. Like you can change the verbosity or the mirrors or all sorts of stuff, right? Yeah. All right.
Starting point is 00:07:13 So this time I have an extra, extra, how many extras? Let's see. I have eight extras. Extra, extra, six times extra. I hear all about it. They'll all be kind of quick, but they're all kind of interesting. I just want to give a quick shout out to V Brown Bag. I did a talk over there on Pydantic. So a 45 minute presentation on Pydantic and how you can do all sorts of cool stuff with that. We've already
Starting point is 00:07:34 talked about why Pydantic is excellent. So very, very neat. Check that out. And also want to give a shout out to an episode that I did, I think is on TalkPython that I think is going to be really useful for people. It's about building little automation tools like instead of trying to build big apps like maybe a little app with rumps that runs up in your menu or a little app that you can do a bunch of stuff and it'll generate like a query for some other platform that's not like SQL but you know think SQL like type of things and so on so I had a bunch of cool guests I had Rusty Gregory, Kim Van Wyk kj miller and actually rivers cuomo from weezer on the show he's doing amazing stuff so people should check that out if that sounds interesting and inspiring that sounds
Starting point is 00:08:14 so cool i can't wait to watch this yeah this is this is going to be one of my favorite talk by then episodes in the near term i'm pretty sure okay enough of my stuff on to other the six other things that uh we haven't done remember we had sherry eskenes on the show a while back yeah that was that was really fun she talked about a bunch of great things but she also did a day in the code i thought like storybook for kids so her storybook for kids which i know you and i both got a copy right brain yeah and i'm it's actually pretty cool yeah i like it yeah it's cool so think like a big large picture book that tells a story but about programming for kids rather than i don't know
Starting point is 00:08:49 like a day in the park or whatever so that book's actually out i just want to that'll be a link in the show notes if you've heard that episode you want to check it out you know could actually get the book now we talked about github copilot and some other things like that i want to give a shout out to another tool that's kind of like this, but way more tamed down. And it plugs into all sorts of different IDEs called Tab9. Have we talked about Tab9? I don't think I have either.
Starting point is 00:09:15 But it's actually really well developed. It's got a ton of different platforms. For example, if you go over here and check it out, it's like, well, what do you want? VS Code, you want PyCharm, you want WebStorm, You want Atom? You want Emacs? You want RubyMind? You want Jupyter? Straight Vim. Yeah. And so this is a tool that you plug into your editor. Well, Python, that's offensive to have JavaScript. So you can come down here and it will help basically look at your code, look at the keyword arguments.
Starting point is 00:09:47 And instead of just giving you autocomplete for the symbols, like functions and fields and stuff, it tries to kind of bring it together. It's not GitHub Copilot in the sense that it's trying to pull other people's code and inject a lot. It's not like Stack Overflow copy and paste with a tab type of thing. It's looking at what's on your screen and trying to pull it together to like complete a little bit more. So if you have like a username equals quote Brian, and then you call a function that takes a username, it'll suggest you pass in that variable value.
Starting point is 00:10:14 What do you think? Actually, I definitely want to try this. I think this, having a smarter code complete, that sounds just like about the right level that I want to try first. Yeah. Brandon? Yeah. I actually had this and GitHub CodePilot on at the same time. Oh my gosh, what happened?
Starting point is 00:10:31 It's a disaster. But yeah, I like this because as much as I like VS Code, I'm a huge JetBrains fan. And the fact that you can't use it in PyCharm or anything else like that is very disappointing. Yeah, I agree with that. I think I want to get like five AI coding systems together can't use it in, you know, PyCharm or anything else like that. It's very disappointing. So. Yeah, I agree with that. Yeah. Well, I think I want to get like five AI coding systems together and they can just mob program by themselves.
Starting point is 00:10:53 Exactly. So when I look at this stuff, one of the first things I think, okay, it's using AI, it's taking, it's like I said, it's taking the stuff out of my code and then applying the AI to that. Does that mean my code is being passed to somewhere that the stuff out of my code and then applying the AI to that. Does that mean my code is being passed to somewhere that I don't want my code to be? It's so somewhere. Yeah, here you go. It says your code is yours and yours alone. It runs locally without sending any source code anywhere. You didn't work on a plane, Brian.
Starting point is 00:11:18 Anyway, I ran across this. I was talking to the folks from there and I thought this is pretty cool. I'll give a quick shout out to that because it because the AI coding assistants are all the rage right now. Is this a paid thing or a free thing? Yeah, it costs money, but there is a free version. So you get like what they call basic completion. Bad suggestions for free. Yeah, exactly. Like every 10th is a bug, but the other nine are really good. No,
Starting point is 00:11:40 I'm just joking about that. I don't know. But yeah, there's a free one and then you can pay for more. Brandon, did you do the paid one? Do you know the difference? I just use the free one. I assume that there's probably, like I said, better models. And I think there's like a limit to the amount you can do with the free one. So it just stops working. You actually have to do the work yourself. Yeah. To be fair, it doesn't look expensive. So no, no, it's reasonably priced. Yeah. Yeah. It's 12 bucks a month for the paid version. I always feel like when people are like, oh, well, I'm not going to pay, you know, $10 for this thing. It's like, this is your job all day. How much do you actually make from this job? Like if this could, you know, save you an hour, surely. Anyway, that's a different discussion.
Starting point is 00:12:19 Speaking of discussions, following up on one of our episodes with Simon Wilson, who talked about Apple Photos and SQLite and using Dogsheep and Dataset to analyze it. Rhett Turnbull pointed out a project that he created that will, it says, Mac OS Photo Package, oh, the OSX Photos Python Package exposes all of your data to your Python apps. And the next release will provide the OCR stuff out of Apple's vision framework. So people have been tracking that. There's some really exciting stuff coming to the Apple photo, you know, iOS, et cetera, where if you take a picture of something, then it'll automatically do OCR and you can actually select and copy the text out of, say, a sign in a picture and paste that somewhere. So that'll be stored in the database. And apparently this thing will give you access to that text. Oh, that'd be cool.
Starting point is 00:13:08 Can I get that in my car so that I can just have somebody else reading signs for me? That'd be sweet. Someday, perhaps. All right. So, Rhett, thank you for that. Okay. Last three things. Really quickly, I released three packages to PyPI last week.
Starting point is 00:13:23 Two of them are related. They're around taking HTML and templates, either Jinja or Chameleon, one package for each language, and trying to reuse them in like really clean, simple ways. So if you've got like some fragment, say like the example I have on the site is a video app, and it's got like a thumbnail of a YouTube video, then the title of the author, and then the number of views. And if you want to show that all over the place, you could either copy that code and replicate it. Or with this inside your template, you just say render template or render partial, and you point at some HTML fragment bit, and it'll apply your model to that sub thing. It allows you to basically create
Starting point is 00:13:57 functions that return HTML inside of your templates. Yeah. So it's super, super simple. So like for the videos, you have like literally this little render partial, you know, quote shared video square and you pass the video over. Really, really nice. So there's a Jinja partials for Flask people and there's a Chameleon partials that does exactly the same thing for Pyramid.
Starting point is 00:14:18 And then last thing, adding the Chameleon template language to FastAPI so you can build proper web apps. I published that. It's been around for a little while, but I finally published it to PyPI pi so you just put a little decorator onto a fast api function and becomes a html endpoint rather than a api endpoint have you just have you been using chameleon longer is that why you're more comfortable with it i know i probably have
Starting point is 00:14:40 been doing more chameleon than genja um but I do a lot. But the thing that I really, really like about chameleon, let's see if I can find an example. It'll probably be good enough. So what I really like about chameleon is that it is valid HTML as it is. Whereas with Jinja and the Django framework and a bunch of other frameworks, Mako, and you go into other areas like Razor and ASP.NET, all of these are nice, but they all have HTML, HTML, blocks of code, blocks of code, HTML, block of code, HTML, right? This is all driven through attributes, it's like view. So like here, if I want something that's a loop, I can just say talc, colon, repeat as an attribute. Or if I want, yeah, things like that, right? Or you do condition, you say talc, colon, conditional, and you put it in there. So this is actually 100% still validates TML
Starting point is 00:15:25 with just attributes that don't make sense. So to me, it just feels cleaner. That's why I like it better. Yeah, okay. Yeah. I kind of tore through all those without giving you a lot of chance to talk about it. But anyway, that's my extra A-time.
Starting point is 00:15:37 Yeah, I like it. Thanks. Cool. All right, Brandon, you're up next. Yeah, so this is something I came across on Twitter and I signed up to do it. So it's Kaggle's 30 Days of Machine Learning. Basically what it is, I guess if you don't know what Kaggle is, it's a place for data scientists to find and publish data sets.
Starting point is 00:15:55 They have online Jupyter notebooks that allow you access to free GPUs and things like that to run your machine learning models on. You can collaborate with other data scientists and things like that. And, you know, machine learning is one of those things I've always kind of wanted to get into but i've always been a little scared i'm not sure 100 of the resources to go to so i saw this uh 30 days machine learning and what's nice is they give you a you know an introduction into python the things you need to learn from python to know how to do you know machine learning um they show you how to you know build models you and their jupiter notebooks and yeah so we go through that you learn some basic and intermediate machine learning concepts you get some certificates so if you want to post those like you knew with your resume or something like that you can say
Starting point is 00:16:35 hey i did did some learning with kaggle and the cool i haven't done any of this but i suspect that if you ranked pretty highly on kaggle and then you put that on your linkedin profile yeah you're trying to get a job that i I mean, that speaks pretty well. Yeah. Yeah. I would think so. And I think the cool thing is like at the end of it, there's a competition that they have with a, it's like teams up to three and it's like only people that ran through the course. So you're not competing against people who've been doing machine learning for years and kind of give you a little bit of that taste into what, you know, machine learning competitions are like. So I think it'll be interesting.
Starting point is 00:17:05 It'd be fun. Are you going to do it? Yeah. Yeah. Nice. What I think is valuable here is the constraints, right? You know,
Starting point is 00:17:13 you have, here's your data that you're going to be working from. Here's the type of problem you're solving. And so often when you're in a beginner, whether it's machine learning or web development or whatever, it's really hard to know what is the right size problem to attack. Yeah. It's so easy to go, well, that's too small. That's not's not interesting or i'll wait all of a sudden i tried to build instagram and i got stuck or whatever you know yeah and i think it's nice you know if they give you the data like yeah i think a lot of times the bigger
Starting point is 00:17:35 you know the biggest part of machine learning and your data science is cleaning the data and making sure you have the right data and the right attributes to look at hopefully they walk you through how to you know they should walk you through how to do that and kind of give you a taste of how to do that. So it'll be a good learning experience. I suspect this is free. Is that true? Yeah, yeah, yeah, that's true.
Starting point is 00:17:51 It's free. Yep. All you need is a Kaggle account. Yeah, and it starts August 2nd, which like four days away. So yeah, don't hesitate. Get in there if you're going to be part of this. This sounds neat.
Starting point is 00:18:00 And actually there's this, but even if somebody doesn't want to do this, Kaggle has a lot of learning opportunities for people that want to sort of learn the tools. It's an interesting resource for learning how to do this. Yeah, absolutely. Cool. Well, that's a great pick. Brian, you're next, right? All right. Yeah. So been testing a lot. More testing. more testing so uh i one one of the things i had a project that was um that was set up to to use talks but i also um early on when github actions came about i uh i put it up on github
Starting point is 00:18:34 actions too but i was um i was trying to you know trying to understand the workflow a little more at first there were a lot of resources and then i I came across this recently, just this weekend, this week, last week, building and testing Python. It's a part of the GitHub actions guides. And it's actually pretty great. And it goes through a whole bunch of stuff. I mean, it's around a set of docs that talks about, you know, Python, Ruby, Java,
Starting point is 00:19:01 a whole bunch of other things. But within the Python space, it really is a full setup of how to run this yourself. The reason why I brought this up is I wanted to, hopefully people are using Tox. I love Tox. One of the reasons why I like it is because you can, it's kind of like a CI system,
Starting point is 00:19:22 but locally you can sort of run through making sure your installs work your builds work um and all your extra tools that you've got hooked up right you just got your python whatever version three nine three whatever installed you run your test runs on that but you want to kind of exhaustively go i want to test on all the versions that i in theory support every time or you might have an error in your pyproject.toml file or your setup.py, and you're not seeing that because you're not completely, you're not rebuilding it.
Starting point is 00:19:52 But Tox will do that. But so will CI systems, but it's kind of nice to have it set up both. And the directions here, it starts with directions on how to run, you know, pytest and to install dependencies and build and lint and run PyTest on your project. But if you already have talks set up, this is sort of a duplicate effort. But if you I think you want to jump down to the talk section of this document because it shows you just how to run talks directly. And it's a it's a smaller setup and essentially what get up actions is doing is setting up a python or a python environment and then installing talks and running your talks
Starting point is 00:20:32 environments and so you're you're getting you're having that same code from your talks any file uh running uh within get up actions and it's really nice because uh it's gonna try to do the same thing locally as it will in CI. Yeah. The one change I want to mention to flag out, and we'll have this in the show notes, is I've modified this example because hopefully it didn't make sense to me at first. The example they show is on push. So when you push to a branch, it'll run these actions.
Starting point is 00:21:05 But you also want to set up um a pull on pull requests so just add uh pull underscore request right next to push and then so when people do pull requests to your project you'll it'll run your talks also and then also if you want to try to run 310 and hopefully you are right now because um because 310 is just around the corner uh add 3.10-dev into the Python list. Oh, dash dev. Interesting. That'll run the RC, huh? Yeah.
Starting point is 00:21:31 Well, I don't know if it's the RC. I think you can do RCs also, but dev is, I think, close enough and you don't have to muck with it all the time. Is that like the latest build, 3.10 or something? I think so. I think it's just the latest 3.10 build. And then at the bottom,
Starting point is 00:21:45 there's like this thing that talks E-Pi. And that dash E usually means run the environment, run a specific one. But I didn't set up a, I don't set up the one that just says Pi. I usually say Pi 3.7 or Pi 3.8. But I got some help also on Twitter to understand this. What that does is it just will pick the one that's valid.
Starting point is 00:22:08 And I tried it out and it works. If you do this code, it'll run the correct one. Very nice. Very nice. Out in the live stream, we have Felix. Hey, Felix says, I love talks to using it for my strong typing package. And it's awesome. And welcome, Felix.
Starting point is 00:22:22 Yeah, we covered your strong typing package a few weeks ago. That's really good yeah oh and then uh ollie uh says uh the machine machine language course sounds good so thanks yeah absolutely yeah absolutely yeah all right well brian you spoke about the stuff on the plane and i've got an alternative solution for you okay this is really interesting um this one comes from Patrick Park, this recommendation, and it's called Python dash vendorize. So vendoring a dependency in Python means instead of linking to the package you get from pip, you just go, I'm going to find that code and just jam it into my project and just copy it over. Right. Which it's a bit of a hassle
Starting point is 00:23:02 because then you've got to like keep syncing it and stuff. But for small things like, you know, six, unsync, you know, like things that are one file or they're just pure Python and they don't have many dependencies, you know, what's, it might just make sense if there were an easy way to just make that like a subdirectory submodule of your package. Then when somebody runs your code, they don't have to pip install anything, no virtual environments, nothing, right? And so with this Python vendorize, that's what you can do for pure Python packages. So the idea is if you've got some code that has lightweight dependencies, you know, I don't know if I do this with something like flask that depends on VIXOIG that depends on who knows what right click and so on. Like you don't, I wouldn't necessarily
Starting point is 00:23:43 go too deep, but for things that are smallish, what you can do is you can set up a vendorize.toml file and then in here, just list the packages and you give it a location. You say, I wanted to go for my project into underscore vendor in this example, but that could be whatever. And then you just run vendorize,
Starting point is 00:23:59 Python dash vendorize in the working directory where that toml file is. And what it'll do is it'll actually copy the package details over for that project. And then in your code, you just say from underscore vendor import package name, six requests, whatever. That's interesting, right?
Starting point is 00:24:18 Yeah. Yeah. So then you've got a program or a package really that has effectively zero dependencies, even though you're still using some of these third party libraries. Do you know if it'll redownload if you run this again? Will it redownload them? I would. I don't know for sure.
Starting point is 00:24:35 And I looked. I didn't see anything in the documentation one way or the other. It is honestly a little sparse on documentation. This is an interesting idea. And actually, and it often like this does happen, whether people like it or not. And it's a completely legitimate, according to a lot of the I mean, the the licensing. Right. And for but for commercial projects, this is very common that I don't want to go out and pull things from all all the time i want to just have things local so that they're they're just built up locally right and it might not be for um just to avoid the the pip install it might be that you want extreme control over what's shipped and you don't want some thing that might happen to that package coming down through pip and breaking your code even if you
Starting point is 00:25:20 pin it you know you might want to just have more control over it. Right, or a decision that somebody takes the project in a completely different direction that you don't want. It's like, this is a very hard fork sometimes. Yeah, I suspect rerunning Python-Vendorize will redownload it, but I don't know for sure. Brandon, go ahead. Can you pin versions in this? Well, it looks like the packages in the Vendorize.toml,
Starting point is 00:25:43 it doesn't say that you can do versions but i would be guessing i was guessing here i'm thinking that you could probably pin them but yeah i'm just guessing that it passes whatever that string is over to pip and yeah yeah so yeah that's what i was thinking as well so probably you can we'll have to try it out somebody can tell us if we're wrong felix is right there with you brandon asking do you know wingspice fiber i don't know. Like I said, it doesn't say in the docs about it. But yeah, it's a small project, but I think it's an interesting idea.
Starting point is 00:26:14 And it could be, you know, if you just have these real simple dependencies and you're like, ah, we're going to have to create environments and have all these complicated instructions because of, you know, a few little files. Like just here's a nice way to do that. Obviously, you can do it yourself, right? But here's a more repeatable type of way. Yeah. right brandon take us out what's your last yeah uh so there's a newer project out there called super base um i feel really weird saying the name super base you gotta get you gotta say with an attitude it sounds like a car audio product i'm gonna go put a super base in my car but But basically what it is... Sorry.
Starting point is 00:26:48 When you're doing a query, it's like... But yeah, so they tout themselves as an open source Firebase alternative. So if you've ever done a lot of JavaScript or been friends with JavaScript developers, a lot of people use Firebase because it provides authentication. I believe they're more of a NoSQL database. Yeah.
Starting point is 00:27:06 Real-time updates. So if you subscribe to database changes, your app will change based on if something changes. So what Superbase is doing is something kind of similar, but they are running basically a Postgres database for you. And then they've got different open source projects that are wrapping it. So they have the authentication part of,
Starting point is 00:27:28 which they have to have a wrap around the GoTrue library from Netlify for handling authentication. So if you want to have authentication for your app, you can easily do first name or email password, just email that sends like an authentication link to the email. They have an extensive list of OAuth 2 providers.
Starting point is 00:27:44 So if you want to add off to a, they handle all that for you. that sends like an authentication link to the email. They have an extensive list of OAuth 2 providers. So if you want to add OAuth 2, they handle all that for you. Yeah, so the main idea of this database is kind of like, I want to have a front-end JavaScript framework maybe hosted on the backend by Python. But then I just wanted to have like a database access over an API, just like the entire CRUD story, right?
Starting point is 00:28:05 And all of a sudden, you run into all these challenges of offline, of authentication and stuff. And that's what this is mostly focused on, right? Yeah, so they have a package where you can use it called Postgres. Oh, I can't say it. It's a wraparound Postgres
Starting point is 00:28:22 that basically gives you an API to your Postgres database that you don't have to write. And they implement that in a way that you can just, like you said, make those HTTP calls to write, read, to basically do your card operations to your database. And what's nice is whenever you update your database, they automatically generate the API documentation for you. So you're not writing any controllers, any services,
Starting point is 00:28:43 or anything to do that. It's just provided by them. And like you said, it looks like definitely a JavaScript thing, but they're actually just released a Python library for it. They shove up right now. Supabase-py. Yeah. So your snake has base.
Starting point is 00:28:59 Anyways, so it's currently, I believe, in alpha. So I wouldn't suggest using it in an enterprise application, but it's definitely something to play around in alpha. So I wouldn't suggest using it in an enterprise application, but it's definitely something to play around with if you want a simple way to do authentication, access to a Postgres database. It's nice to use, you know,
Starting point is 00:29:13 if they give you the Postgres database, but you don't actually have to access it through their terminal where their UI, you can connect to it through, you know, whatever you use for your database. And yeah, going along the no internet development, they also have a SUFA-based local that you can run locally, so you don't need internet to do your database. And yeah, going along the no internet development, they also have a Sufa-based local that you can run locally so you don't need internet to do your development.
Starting point is 00:29:29 So if you lose power or you want to get on a plane or something, you can still do your work. Yeah, this is super cool. And one of the things that's interesting here is the subscribing to the real-time changes, right? That's pretty unique, especially over a remote API. So if you've got some front end and you want everyone to see those changes possibly guess you could even do this in like a cute or
Starting point is 00:29:51 wx python app or even a terminal app but you might even want to just say i've got a fast api app and i'm gonna fire up a web socket there so all the clients just get that the changes stream down so you have the changes stream to you and then they kind of like multiplex on out to all the people watching that'd be neat yeah i was thinking something like i was curious if you set up like an aws lambda so where someone changes and you need to set up a notification email or something to get hooked up to that it would just kick that off for you oh yeah so things like that yeah that's a good find i had not heard about super base but it does look super yeah it looks really useful. Do you know what the story is? So when I'm looking at over here, they talk about,
Starting point is 00:30:28 okay, so here's how you specify your API endpoint at app.supabase.io. Is there, and it's in this open source thing, but there's probably some database as a service or something equivalent that I maybe sign up for or I pay for. Do you know what the story is around that? I don't know. I mean, surely they are not running the database for the world for for. Do you know what the story is around that? I don't know.
Starting point is 00:30:45 I mean, surely they are not running the database for the world for free. They got to charge at least bandwidth. Yeah, so that's the interesting thing. So there's a, their pricing model is a little confusing. I know that, I feel like they've gotten some funding and I don't know how they're going to plan to make money with it
Starting point is 00:30:59 because the pricing that they have is like $25 a project a month. And that gives you unlimited API calls, real-time functionality, eight gigabytes of database space. I mean, I don't know who they're using for their database provider. I can't imagine they have a data center
Starting point is 00:31:12 somewhere where they're running it, but. Yeah, it's probably on top of some cloud somewhere. Yeah. They do have a zero of a $0 per month version. Yeah. Yeah. It's nice to get your project up and going, so. Yeah, very nice.
Starting point is 00:31:24 That's an excellent one. All right. Well, I think that's it for our six items. Brian, you got to think, actually, you want to throw extra you want to throw out there for everyone? Yeah. I mean, we had Simon Wilson on recently and he just released a post about the baked data architecture pattern.
Starting point is 00:31:40 And that's if you know what he's up to, this isn't surprising, but it's a nice write-up. Bakedata is bundling a read-only copy of your data alongside the code for your application as part of the same deployment. And it's just an interesting and neat write-up and it's good to go have a read.
Starting point is 00:31:57 Yeah, it says most Dynamics sites keep their code and data separate. Code runs on the server and it's stored in like Postgres or Mongo. With Baked data, the data is deployed as part of the application bundle. Interesting. And then also on the live stream, Tim Pogue is doing
Starting point is 00:32:12 real-time research for us. Thank you. It looks like you were able to do a pin similar to as you would with PIP with the Python vendorize. So yeah, awesome. Thanks. Appreciate that. Brandon, anything else you want to throw out for people while we're here? No, not really.
Starting point is 00:32:28 I guess maybe do a little bit of self-promotion if I could. I'm currently working on a side project called Released. It's at released.sh. Basically what it is, it's working on a tool to automate release notes for companies. I've noticed a lot of places, when they have releases, they need to go out and curate all these release notes
Starting point is 00:32:44 and have somebody manually do this work that takes hours upon hours every release. So I'm going to try to automate that and make it easier for people. That looks like a great project and nice web design. Well done. Thank you. Thank you. Tailwind CSS, if you haven't tried it, give it a shot. Hearing good things about Tailwind.
Starting point is 00:33:02 I'm hearing so many good things. Must learn. All right hearing so many good things. Must learn. All right. Speaking of must learn, one must be cautious when learning, it turns out. Because if we study the circle of AI life, there's this great cartoon here on devhumor.com. So there's the circle of AI life. And it's got these little pictures of how humanity progresses. So there's some two humans sitting here analyzing neural networks.
Starting point is 00:33:26 It says human researches AI. And then they're like celebrating near a quantum computer. Humanity perfects AI. Then AI perfects itself. Lots of lightning. AI enslaves humanity. There's pyramids. A solar flare disables the AI.
Starting point is 00:33:40 And then there's humans worshiping a sun god. Humanity worships the sun god. We start over. There's our joke for the sun God. Let me start over. There's our joke for the week. It's good. Thanks. Yeah. Awesome.
Starting point is 00:33:50 Yeah. Yeah. It's, it's a, it's a warning. It's, it's humorous and, um, ominous.
Starting point is 00:33:54 The singularity is coming. Anyway. Awesome. Yeah. Thanks Brandon for coming on the show. It was fun. Yes. Thanks for having me.
Starting point is 00:34:02 Yeah. It was great to have you here, Brandon, Brian. Good to chat with you all. And thank you everyone. Bye. Right. Thanks for listening to the show. It was fun. Yes, thanks for having me. Yeah, it was great to have you here, Brandon and Brian. Good to chat with you all. And thank you, everyone. Bye. Bye.
Starting point is 00:34:06 Thanks for listening to Python Bytes. Follow the show on Twitter via at Python Bytes. That's Python Bytes as in B-Y-T-E-S. Get the full show notes over at PythonBytes.fm. If you have a news item we should cover, just visit PythonBytes.fm and click Submit in the nav bar. We're always on the lookout for sharing something cool. If you want to join us for the live recording, just visit the website and click live stream to
Starting point is 00:34:28 get notified of when our next episode goes live. That's usually happening at noon Pacific on Wednesdays over at YouTube. On behalf of myself and Brian Ocken, this is Michael Kennedy. Thank you for listening and sharing this podcast with your friends and colleagues.

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