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 Okken.
And I'm Brandon Brainer.
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 you here.
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 an individual contributor.
About seven years of it with Python.
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 now I can't go back. It's so much easier.
Yeah. Yeah. I had a similar experience coming from C# and C++ 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 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 it missing.
But then when I went back, I felt even weirder.
Like, why are all these symbols here?
Yep.
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?
Exactly.
It was a really interesting experience.
Yeah. Speaking of interesting, Brian, all the stuff on Pip, quite interesting.
Yeah. So I don't know. We're doing this on Friday because I wasn't here on Wednesday.
I was in Florida.
And so I had a jet setter.
Basically, you just.
Yeah.
No, the first time I've traveled in like two years for a business.
Was it weird?
Yeah. Was it weird?
No, it's 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.
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 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 wanted to work on.
It's got talks set up.
And when you run talks, talks creates for a fire in virtual environments and then fills those up with all your dependencies in 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 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 and 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.
It looks at a local directory.
So so what I did is I'm going to and I'm going to just look at I was going to go back.
I got a quick question before we go on.
OK, 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?
OK, so I got some pre work that I did.
So I'm like, OK, how do I get those?
And normally when I when I want to put something in a local directory or something, I'll just use a pip download.
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.
I 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.
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 7, Python 8, whatever you got in there.
Or not 8, 3, 8, 3, 7, 3, 10, whatever.
You're living in the future.
Just go through all of them.
Just do a search and grab all of the what do we got?
The site packages directories.
Grab everything out of all of those and copy them to like a local wheels directory or something.
Something something outside of your work environment.
I just stuck it at the top level like users or something.
I stuck it up there.
And then 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 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.
Just which one you activate will just make this happen.
Yeah.
So this and that's one of those like it's all virtual environments all the way down.
It in 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, 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 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.
It just has this comment that says all command line options can be set as environmental variables using all upper scores under uppercase and then underscores instead of dashes.
So that's a cool tip.
Yeah.
Brandon, what do you think?
Yeah.
At first, I can confuse a little bit about why you wouldn't just pip install before you got on the plane.
But I've never actually used talks to do any testing.
So it sounds like that installs in a different directory.
So when you do your talks runs that it needs to reinstall them.
Yeah.
It creates a new virtual environment.
You can tell it you can run it ahead of time and you can tell it to not 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, I think this is, I mean, yeah, there's probably other cool solutions, but this is what I used.
Oh, it's interesting though.
It creates all the virtual environments.
So each different, like 3.7, 3.8, 3.9, 3.10, they'll all be different virtual environments that it runs your tests in.
So 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?
So that's, it'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.
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.
So I'll be kind of quick, but they're all kind of interesting.
Okay.
I just want to give a quick shout out to VBrownBag.
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 talked about why Pydantic is excellent.
So very, very neat.
Check that out.
And I also want to give a shout out to an episode that I did that I think is on Talk Python that I think is going to be really useful for people.
It's about building little automation tools.
Instead of trying to build big apps, 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 a query for some other platform that's not like SQL, but think SQL-like type of things and so on.
So I had a bunch of cool guests.
I had Rusty Gregory, Kim Van Wijk, 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 so cool.
I can't wait to watch this.
Yeah, this is going to be one of my favorite Talk Byland episodes in the near term, I'm pretty sure.
Okay, enough of my stuff.
On to the six other things that we haven't done.
Remember we had Shari Eskenes on the show a while back?
Yeah.
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, Brian?
Yeah, 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, 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 and you want to check it out, you 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.
We talked about Tab9.
I don't think I, I don't think I have either, 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 Vim.
Straight Vim.
Yeah.
Straight Vim.
Yeah.
And so this is a tool that you plug into your editor.
Well, a Python, that's offensive to have JavaScript.
Excuse me.
So you can come down here and it will help basically look at your code, look at the keyword arguments.
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 bar.
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.
Go on.
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.
So yeah.
Brandon.
Yeah.
I actually had this and GitHub Copilot on at the same time.
Oh my gosh.
What happened?
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.
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.
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 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 can even work on a plane, right?
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 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.
Bad suggestions for free.
Yeah, exactly.
Like every 10th is a bug, but the other nine are really good.
No, 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, do 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.
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 can you actually make from this job?
Like if this could, you know, save you an hour, surely.
Anyway, that's a different discussion.
Speaking of discussions, following up on one of our episodes with Simon Wilson, who talked
about Apple Photos and SQLite and using dog sheep and data set to analyze it.
Rhett Turnbull pointed out a project that he created that will, says macOS photo pack.
Oh, the OS X 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 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.
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.
The last, three things really quickly.
I released three, packages to PyPI last week.
Uh, two more related there 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 fragments, say like the example 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 and
allows you to basically create functions that return HTML inside of your templates.
That's neat.
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 a 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.
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.
So you just put a little decorator onto a FastAPI function and it 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 been doing more chameleon than Jinja, 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.
But 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
know, 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, like view.
So like here, if I want something that's a loop, I can just say talcol and repeat as an
attribute.
Or if I want, yeah, things like that, right?
Or you do condition, you say talcol and conditional and you put it in there.
So this is actually 100% still valid HTML 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 them.
But anyway, that's my extra A time.
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 Kegel's 30 Days of Machine Learning.
Basically what it is, I guess if you don't know what Kegel is, it's a place for data
scientists to find and publish data sets.
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 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 the 100% of the resources to go to.
So I saw this 30 Days of Machine Learning.
And what's nice is they give you an introduction into Python, the things you need to learn from
Python to know how to do machine learning.
They show you how to build models in their Jupyter notebooks.
And yeah, so you 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 know, with your resume or something like that, you
can say, hey, I did some learning with Kegel.
And the cool...
I haven't done any of this, but I suspect that if you ranked pretty highly on Kegel and
then you put that on your LinkedIn profile or you're trying to get a job that, I mean,
that speaks pretty well.
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 have been doing machine learning for years and
kind of give you a little bit of that taste into what machine learning competitions are
like.
So I think it'll be interesting.
It'll be fun.
Are you going to do it?
Yeah.
Nice.
What I think is valuable here is the constraints, right?
You know, 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 a beginner, whether it's machine learning or web development or
whatever, it's really hard to know what is the right sized problem to attack.
Yeah.
It's so easy to go, well, that's too small.
That's not interesting.
Or 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 biggest part of machine learning and 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.
It'll be a good learning experience.
I suspect this is free.
Is that true?
Yeah.
That's true.
It's free.
Yep.
All you need is a Kegel account.
Yeah.
And it starts August 2nd, which like four days away.
So don't hesitate.
Get in there if you're going to be part of this.
This sounds neat.
And there's this, but even if somebody doesn't want to do this, Kegel 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.
That's a great pick.
Brian, you're next, right?
All right.
Yeah.
So been testing a lot.
More testing.
So one of the things, I had a project that was set up to use talks, but I also early on
when GitHub Actions came about, I put it up on GitHub Actions too.
But I was trying to understand the workflow a little more.
At first, there were a lot of resources.
And then I came across this recently, just this weekend, this week, last week, building
and testing Python.
It's 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 Python, Ruby, Java, 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 talks.
I love talks.
One of the reasons why I like it is because you can, it's kind of like a CI system, but
locally, you can sort of run through making sure your installs work, your builds work, and
all your extra tools that you've got hooked up.
One of the problems is you just got your Python, whatever, version 3.9, 3.8, whatever installed,
and you run your test, it 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.
Yeah.
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.
But talks will do that.
But so will CI systems, but it's kind of nice to have it set up both.
But if you, and the directions here are how to, 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 GetUp Actions is doing is setting up a Python or a Python environment
and then installing talks and running your talks environments.
And so you're, you're, you're having that same code from your talks any file running within GetUp Actions.
And it's really nice.
I like it because it's going to try to do the same thing locally as it will in CI.
Yeah.
The one change I want to mention to flag out, and I've got, we'll have this in the show notes,
as I've modified this example because hopefully I didn't, it didn't make sense to me at first.
This, the example, the show is on push.
So when you push to a branch, it'll run these actions.
But you also want to set up a pull, on pull requests.
So just add pull underscore request right next to push.
And then, so when people do pull requests to your project, it'll run your talks also.
And then also if you want to try to run 3.10, and hopefully you are right now because 3.10's just around the corner,
add 3.10-dev into the Python list.
Oh, dash dev.
Interesting.
That'll run the RC, huh?
Yeah.
Well, I don't know if it's the RC or the, 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, there's like this thing that talks E dash 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.
And I tried it out and it works.
If you do this code, it'll run the correct one.
Very nice.
Out in the live stream, we have Felix.
Hey, Felix.
Says, I love talks to you using it for my strong typing package.
And it's awesome.
And welcome, Felix.
Yeah, we covered your strong typing package a few weeks ago.
That's really good.
Yeah.
Oh, and then Oli says the machine language course sounds good.
So thanks, Oli.
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.
This one comes from Patrick Park, this recommendation.
And it's called Python-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 pop it over.
Right.
Which is a bit of a hassle 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 sub module 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, you know, lightweight dependencies, you
know, I don't know if I'd 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 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 Python-Vendorize in the working directory where that, that
HOMO 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?
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 re-download, if you run this again, will it re-download them or, you
know?
I would, I don't know for sure.
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?
Yeah.
And for, but for commercial projects, this is very common that I, I don't want to go out
and pull things from pip all the time.
I want to just have things local so that they're, they're just built locally.
Right.
And it might not be for, just to avoid the, the pip install.
It might be that you want extreme control over what's shipped and you don't want something
that might happen to that package coming down through pip and breaking your code.
Even if you 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, it's like, this is a very hard fork sometimes.
Yeah.
I suspect rerunning Python dash 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.
It doesn't say that you can do versions, but I would be guessing, I was guessing here.
I'm thinking that you can probably pin them, but.
Yeah.
I'm just guessing that it passes whatever that string is over to pip and.
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 when you specify a version?
I don't know.
Like I said, it doesn't say in the docs about it, but yeah, it's, it's a small project,
but I think it's an interesting idea.
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.
Cool.
All right.
Brandon, take us out.
What's your last one?
Yeah.
So there's a newer project out there called Supabase.
I feel really weird saying the name Supabase.
You got to get, you got to say it with an attitude.
It sounds like a car audio product.
I'm going to go put a Supabase in my car, but basically what it is.
Sorry.
When you're doing a clear, it's like.
But yeah, so it's, they tout themselves as an open.
Open source Firebase alternative.
So if you've ever like 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 like more of a NoSQL database.
Yeah.
Real time updates.
So if you subscribe to database changes, your app will change based on if it, you know, something changes.
So what Supabase 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 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 know, 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.
So if you want to add off to it, 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 back end by Python.
But then I just wanted to have like a database access over an API, just like the entire CRUD story.
Right.
Yeah.
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 they call it where it gets, if you can use it, called Postgres.
Oh, I can't say it.
It's a wrap around Postgres 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 know, you can just, like you said, make those HTTP calls to write, read, to basically do your CRUD 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 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.
Py.
Yeah.
So your snake has base.
Anyways, so it's currently, I believe, in alpha.
So I wouldn't suggest using it in like, you know, enterprise application, but it's definitely something to try, you know, play around with.
If you want a simple way to do authentication, access to a Postgres database.
And what's nice is, you know, 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 with the no internet development, they also have a Supabase local that you can run locally.
So you don't need internet to do your development.
So if you, you know, lose power, you want to get on a plane or something, you can still do your work.
Yeah, this is, this is super cool.
And I, one of the things that's interesting here is the subscribing to the real-time changes, right?
That's, that's pretty unique, especially over a remote API.
So, you know, if, 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 Qt or a WX Python app or even a terminal app.
But you might even want to just say, I've got a FastAPI app and I'm going to fire up a WebSocket there.
So all the clients just get that, the changes streamed down.
So, you know, the changes streamed 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 could set up like an AWS Lambda.
So where something changes and you need to send out of a notification email or something to get hooked up to that and 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 Supabase, but it does look super.
Yeah, it looks really useful.
Actually, do you know what the story is?
So when I'm looking at over here, they talk about, 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 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, they're going to plan to make money with it 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 somewhere where they're running it, but.
Yeah, it's probably on top of some cloud somewhere.
Yeah.
They do have a zero over, of a zero dollars per month version.
Yeah.
That's cool.
So I see a project I'm going, so.
Yeah, very nice.
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 an 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.
And that's, if you know what he's up to, this isn't surprising, but it's a nice write-up.
Baked data 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.
Yeah.
It says most dynamic 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.
Okay.
Yeah.
And then also on the live stream, Tim Pogue is doing 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.
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 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.
Tailwind CSS, if you haven't tried it, give it a shot.
I'm hearing good things about Tailwind.
I'm 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.
It says, human researches AI.
And then they're like celebrating near a quantum computer.
Humanity perfects AI.
Then AI perfects itself with lots of lightning.
AI enslaves humanity.
There's pyramids.
A solar flare disables the AI.
And then there's humans worshiping a sun god.
Humanity worships the sun god.
And we'll start over.
There's our joke for the week.
It's good.
Thanks.
Awesome.
Yeah, yeah.
It's a warning.
It's humorous and ominous.
The singularity is coming.
Anyway, thanks, Brandon, for coming on 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.
Thank you, everyone.
Bye.
Right.
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
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 Okken, this is Michael Kennedy.
Thank you for listening and sharing this podcast with your friends and colleagues.