Hey there, thanks for listening. Before we jump into this episode, I just want to remind you
that this episode is brought to you by us over at Talk Python Training and Brian through his pytest
book. So if you want to get hands-on and learn something with Python, be sure to consider our
courses over at Talk Python Training. Visit them via pythonbytes.fm/courses. And if you're
looking to do testing and get better with pytest, check out Brian's book at pythonbytes.fm slash
pytest. Enjoy the episode. Hello and welcome to Python Bytes, where we deliver Python news and
headlines directly to your earbuds. This is episode 268, recorded January 26th, 2022. I'm
Michael Kennedy. And I'm Brian Aiken. And I'm Madison Swain-Bowden. Hey, Madison. Great to have you here.
So fantastic to be here. Yeah, yeah. We talked to you before at PyCascades, where you were on the
hosting side. That's right. Tables are turned a little bit, yeah. They absolutely have. So
why don't you tell folks about yourself before we jump into the news? Thanks. Yeah, I am a senior
data engineer at a company called Automatic. We do WordPress, which is surprisingly, I recently heard
that it backs 40% of the internet. And so that was really surprising. So much of the world is on
WordPress. It's unbelievable. I know, I know. Yeah. And I work with the Openverse team there,
which I'll talk about a little bit later in the show. Yeah. Fantastic. Cool. Yeah. So Brian,
shall you kick us off on the first thing? Yeah, sure. Something about parentheses. I like Python
because it generally doesn't have that many parentheses, but you were going to tell us that
it should have more. Yes. Well, we have them with function calls, right? And tuples. Indeed.
So actually, because there's function calls and tuples, both use parentheses, there's a confusion
that happens. And so I just saw this the other day. A pep679 was added, submitted by Pablo Salgado.
to allow parentheses in the assert statements. So what happens like currently, I don't know if
there's examples in here, but what happens currently is if you, if you call assert, you're not supposed
to use parentheses. You actually, you can't right now. You can, but it's wrong. So if you.
It's one of those princess bride things like that, that doesn't mean what you think it means.
It doesn't mean what you think it means. So what happens is, is you, you give assert asserts a
statement within, within Python, you give it a, an expression to evaluate, and you can also
give it a comment, like a string to add a message if, if, if, if the failure happens. But what happens
is sometimes people think it's like a function and put those within parentheses and it looks like a
function call and it looks visually fine. But what happens is, is it doesn't matter what the,
expression evaluates to, because the, this it's a, it's a two value, tuple. And especially
if you've got a string in there, the strings, not non-zero. so the tuple evaluates to a true
value and your assert never fails. and, and the tuple is never none. And so you're good to go.
Yeah. I feel like we could have some passing tests. Yeah. I feel like this is one of those like
Python gotchas. Like if you have one and if you assign a variable to one comma,
then you get a tuple instead of just the one, right? Yes. and particularly with print being
changed from a statement to a function, I think it like makes a lot of sense for people to assume
that assert is also a function. and it's kind of an, an odd, odd duckling in the language because
it is just a keyword. So this PEP is just, to say, let's allow both. Let's, go ahead.
Because right now there's no real reason to pass in a tuple as a, and as an expression,
as a full expression, it just doesn't, it's, it's always going to be true. It's a no off.
So, let's go ahead and add that to the language and allow people to call it as a function if they
want to. And the AS there's AST around it that, to make it like basically be the same thing.
Um, I think this is a no brainer. I think we should just get it done as soon as possible.
Hopefully we can get it into then, you know, 311 or 312 or something like that.
So I wonder too, if having, it as a function might help with autocomplete and some IDEs.
Cause I think right now when you do the assert, you don't get that like, suggested arguments
or suggested parameters that you do with a function. And so it might help there. Yeah.
Yeah. so if you're trying to put too many things in there, it won't tell you that it's wrong.
All those things. Yeah. Yeah. Hopefully this will go through. So I hope so as well. So let's talk
about local ghost. So local ghost is, a blog by, let me get the name right here by Sophie Koonin.
And she blogged or wrote about everything I Googled in a week as a professional software engineer.
Oh, cool.
So I wanted to highlight this because there's a lot of folks out there who listen to the show
and just are in the industry who feel like they don't, they don't quite add up or they don't belong
or whatever, because they feel like they get stuck and lost and banging off things. You know? And I
can tell you, we were just talking about it last time with a joke, right? Brian, like hate programming,
hate programming, hate programming. It works. I love programming,
but the hate part, there's a lot of searching, a lot of Googling and bouncing around from that.
And so here's just another pro software developer pro in the sense it's her job and she's been doing
it for a while. And it just talks about like, okay, what did I do? So the, what she searches is slightly
different than what we would search because she mostly is a front end and node, mostly JavaScript
type of developer, but it doesn't really matter. You can, you can sort of see there's some basic stuff
NPM react testing library. And what's nice is she put the little comment behind a lot of these,
like, why did she search for this? Not just the words like during a react upgrade, looking at
dependencies to see the latest versions and checking for breaking changes and then react Apollo release
notes, totally normal. And then undo a rebase. Oops.
I think we've all been there.
Yeah, exactly. Or just silence warning, or maybe it's undo commit. No, what did I do? I can't push this.
Just silence warning. Don't judge me. Okay. So there's a bunch of interesting things and it kind of goes along
there. So you, you all can look through it. I don't want to go through all the details.
There's just a lot of stuff. What were you going to point out there, Madison?
No, it's just a lot of, of fun and interesting searches. And I think like, if we were all to do this
sort of analysis for ourselves, it would be kind of an interesting retrospective.
It would be super interesting. Yeah. Like what surprised you most about your search history?
Let's see. There's a few, I think one on Friday down here at the end of the week. That was pretty,
yeah, I put my notes. I'll pull it up down here. So one that I thought was interesting was she searched,
she searched for expecting, expecting a parsed GraphQL document. Perhaps you need to wrap the query in a
string quote GQL tag. And the content of that's not super interesting, but what that is, is exactly an
exception message, right? In some sort of code. And for people who don't do this, you should take the
error messages and put them straight into Google or straight into DuckDuckGo or wherever you put search
things. And it is so good. With quotes.
The problems. With, yeah, exactly. And maybe quotes on the really important bits, right? Like I really want to make
sure it's GraphQL and not some other document or something.
I would say half the time when I do that, it takes me exactly to the GitHub issue that describes the problem
that I'm experiencing. It's surprisingly effective, isn't it?
Absolutely. It's like, why is this work so well? The thing that blew, blew my mind most once is I had a friend,
this is way back. I mean, we're talking like early 2000s. He was using Outlook. Don't judge him. It was a long
time ago. And he was using Outlook and it was just stopped working. It gave him some weird error that had
almost no message, just a number. So I just searched Outlook, that number and boom, here's the exact fix.
It's just like, are you kidding me?
Absolutely.
Yeah, I love it so much.
A couple others. Semantic HTML contact details. Wanted to check if address tag was relevant here.
I highlight that because here's somebody who's a professional HTML developer basically doing front end
stuff. And still they're Googling to see, does this address tag match here? Like, should I use this block,
this HTML tag in this situation? Right? So it's, even if you work in stuff day to day,
there's stuff that you just go like, I'm just going to leave that to the search engine and distributed
cognition and not have to, you know, memorize every detail of what I'm working in.
And then finally, I just thought this was fun. Editing host file. This was the search, not the action.
Desperate times. And it didn't even work.
What was the comment?
Anyway, I think this is fun. And I thought I'd just share it because I think it's, it's interesting for people to compare notes.
One of the things I noticed recently was I, I, I don't, I don't remember the exact way you're supposed to get to
GitHub repos. So I usually just Google GitHub and then my repo name just to get to the repo.
Exactly that. Yeah.
Nice.
Well, and a lot of times I search for like a project and then it brings up like PyPI or some other,
like the read the docs. I was like, no, I want, I want GitHub. Take me to GitHub.
Yeah. I'm always like, all right, fine. I'll click the PyPI so I can click on the source code.
Exactly. Exactly. How many links do I have to go through just to get to the repo?
Exactly. Yeah.
I know I'm two clicks away. That's good enough. Let's do this.
Yeah. I have a couple of thoughts on this.
Yeah. Tell us.
First of all, local ghost.dev is an amazing domain name. I absolutely adore that. And the
second is it's, it's really great seeing articles and posts like this. I see a lot of seniors,
particularly like senior women and others underrepresented minorities talking about this
sort of thing. And I think it really helps to dispel the myth that like, you have to be
an expert who has every command for, you know, every utility memorized in order to be a senior dev.
Like a lot of us are doing these sorts of Googles, right? We're like looking up the, the function
signature for something that's like in the standard library, you know, we're all doing this. And so I
think it's, I think it's really valuable to share something like this, for particularly for people
who are new. Yeah. Some of the best skill acquisition isn't memorizing things. It's
remembering that the feature was there. Exactly. Yes. Yes. Right. Exactly. I need to know just enough
that I can Google it to get, to get to where I want to be. Absolutely. And, Johnny out in the
audience also thinks it's interesting. Yeah. We, we all think this is great. Fantastic. All right.
I did give a quick shout out to PyCascades previously, Madison, you want to tell us about
your first time? Yeah, I wanted to share about it. So PyCascades is coming up in less than two weeks,
which is really exciting. we have another year of just excellent and diverse talks from
an array of different subjects and expertise levels. last year we were online and we're going to be
online, again this year using the same platform that we did last year. And a lot of people really
enjoyed that platform. So we're excited to use it again. We're hoping to do some watch parties,
in Seattle, Portland, and Vancouver. but unfortunately, reality, wanted us not
to do that. So we opted against that. Yeah. But we're, we're so excited to, to be doing this again
this year. and one of the things that I'm like really excited about is that we have the PSFs,
uh, diversity, equity, and inclusion working group, doing a meet and greet as sort of our,
our first event on Saturday. and so they have a form that they are sharing for just trying to
understand the landscape around diversity in the Python community. and so we have that linked
in the show notes, if you would like to fill that out. and we are going to have socials on
Friday and Saturday night. and we had a DJ last year. We're hoping to have a DJ again this year on
Friday night. and then we'll be doing sprints on Sunday. and tickets are still available.
we'll be selling them throughout the event too. So, cause it's a virtual event. There's, it's not
like NFTs. There's no digital scarcity with these. So please feel free to buy a ticket whenever, whenever
you have a chance and we hope to see you there.
Yeah. That's a fun commerce. I've enjoyed going to it when it was in person. So it's cool. It's
still going. I can't wait for it to get back to being actually in person.
I know. I know. We were, we were hoping, we were hoping to dip our toes into it this year, but
just wasn't going to happen. And I should also mention too, we're, we're having talks from,
um, some well-known folks in the, in the Python community, like Thursday Brom and Jay Miller,
who I know you had on, talk Python to me recently.
Yeah. Yeah. Yeah. And we have, some first time speakers as well.
Like Joseph Riddle and, Isaac Na. So we're, there's a lot of really great talks
that, that we're looking forward to. Yeah. Super cool. Cool. All right. Brian,
back to parentheses and stuff. Yeah. Well, maybe not parentheses, but yeah,
stuff that happens between parentheses. so it is interesting article by Seth Larson that I,
uh, ran across that's a strict Python function parameters. And I thought strict, what do we mean
by the strict Python function parameters? and the idea is let's put everything together. So we have,
um, we've got keyword only parameters and that's, it's a little small on screen, but, keyword
only parameters is, is where you, you can put an asterisk in the middle of your key in your parameter
list. And it says that everything after that has to be a keyword. It can't be, you can't,
you can't pass that in as positional. And I'm, yeah, I'm not sure exactly how that works really,
but, it's kind of, it's useful. the, and then you can also put defaults in there,
of course, for things. And it's just that separating of what, where your keyword positional
and keyword arguments go. And that's an, it's a cool thing. that's helped, allow people to,
uh, add parameters before. So this was a nice addition. And then also we've got, those are
keyword only parameters. We also have positional only. So with the slash, you can say everything
before the slash is a positional, only you can't, you can't pass it in, as a keyword
parameter. and it's, it's the, this, the natural progression is, you know, Hey, let's just
do both of them at the same time. And I didn't actually, for some reason, I didn't realize you
could do this. and so what the, so then you're going to have your, positional parameters
first and then a slash and then a star, and then, you'll have, and then all your
keyword parameters after that, what, what happens then is you're both of them are true. So you have
to, you have to have the positionals first and then the keywords after. And, and so what,
what's the benefit? This, this just, it looks like added syntax to confuse people. but there are
a lot of benefits. One of the benefits is really that your documents and your code and your
example code, example code and all examples people look, if they look up some other,
GitHub repo or something using your API, all the examples are going to look kind of the same.
And this is sort of something we're used to in other languages. It's, I was actually surprised
in Python that you could rearrange your, your input, arguments, especially the keyword
ones, you can rearrange them and they work fine, but it's confusing sometimes. And, and I just
actually think this is kind of a neat idea. I think that especially for API or, you know,
library API entry points doing something like this might make complete sense. And it's something I'm
going to look into considering just to make sure, people use a, use something consistently.
the article also goes through, thing about, empowering library authors to have
flexibility to change things. And, and it's a good thing to read up on, but I was curious what you
guys thought about if, if, if I, if I were having had an API or you were looking at API and it had
this slash star in the middle of everything, what would you think?
I, I mean, I really liked this concept and I'm, I'm glad that it's a feature of Python because of
that uniformity that it can create. I've never had an opportunity where I felt like, this was
something that I really should use, but I think that's a large part because all of the stuff that I
work on is, usually internal tools. And so, even if it is open source, there's not like a public
API that I'm building. And so that, right. If you're consuming it versus creating it for others,
it's very different, right? Exactly. Exactly. Yeah. And so I think it's always a good thing to keep in
the back pocket when you like have a particular contract that you really want to enforce with how
functions are used and keywords and whatnot. Yeah. I, I also am glad that it's here. And for the same
reason as medicine, I don't use it very often because to the extent that I do make open source
libraries that are pretty basic and, and, and don't have tons of like tutorials or anything about
them. Maybe I should think more about this, honestly, but I do like the idea that you can say,
no, this is going to be like this specifically, for certain things and say this stuff you cannot
use as a keyword argument. You have to just pass positional this stuff. You must, it has to go
at in this order and so on. Yeah. I like it. I, yeah. One of the things I see is, is,
is people looking at other examples, and, and, and saying like, so if, if you've got a key,
if you just have a normal arguments, they can be, you can, you can pass them in as keywords,
even if most people use positional, and then you can reorder the keywords and put them in a different
order. And then somebody else might look at your code, copy it, and then take off the keywords.
And now they're in the wrong order. and, that'll mess things up. this is a Dean,
uh, added a comment of, so def underscore. Yeah. Star. This is a legit syntax. that's,
that's funny. I can't even read that out loud. It's so confusing.
Looks like code golf is what it looks like. Goodness.
So anyway, I think, I think it's like typing in the sense that, it's, it's a good feature
that's there and it can be helpful for making things more explicit in Python. But part of the
power of Python is that it's very versatile and approachable. and so it's, I think it's nice
too, that it's not like, this is something that you are required to do for every function that you write.
Yeah. Yeah. I do like the flexibility there. All right. Let me tell you about something that seems
a little bit contrary to the Python way, but I think people will find useful. So over on pypi.org,
we have 350,000 plus packages, which is utterly mind blowing. I remember when it was 75,000 and I'm
like, wow, look how many there are. It's insane. So a lot of the superpowers of Python is you,
you know, the ability to use these packages and people will say I'm using Python because it's
really great at working with Excel files. Well, like Python's not actually good at working with
Excel files, but there are many libraries for Python, which that's true. Right. And so you have this sort
of spectrum of like, what do people mean when they, they say like Python is great, but I do think these
packages clearly are super important. So why do I bring this up to start the section off? I want to
talk about a way to not use PyPI, but still do some cool stuff. There's this thing called
new rec as in small requests over here. I got a name. Yes. If it pulls up, sure.
Sure. Shri are Ram. So very cool project here. And the idea is it's request like not a drop in
replacement for requests, but like requests with limited features. But if you're using a limited
subset of what requests could do, you could use this library and have zero external dependencies,
no virtual requirements required, no pip install dash R or friends required and just have like a real
simple thing and not have to fall back to just URL lib, which is pretty cool. So it does standard stuff.
I would recommend maybe even from, you know, import new rec as requests and then request.get.
See what breaks. Yeah.
Yeah, exactly. I mean, and then see if it works or not. So you, it does have some limitations, quite a few,
actually, like it doesn't support connection pooling, for example, but if you do request.get,
neither does that. You have to create a client session and then use the session to do get and so on.
If you want, you know, connection pooling apparently uses a lot less memory, but the main reason besides just
convenience of like, I want to give you a Python file you can run or a set of Python files, you can
run the top level one without any external dependencies. So that's, that's pretty nice.
The other one is to avoid supply chain attack vulnerabilities, right? We, we've talked before
about people putting malicious stuff into PyPI. We talked about the guy, a wreck, I believe it was,
who had like sabotaged his NPM packages and those kinds of things. And you know, the cascading change
of like the super dependencies in the JavaScript world meant that was really, really bad. Right.
So here's a way you could put something that does request like things into your code and it doesn't
have any dependencies. It doesn't have, there's no way someone's going to take over that account and
put something malicious there, or even maybe worse is like the dependency of the dependency of the
dependency is where the problem is. Yeah. So yeah, I think this is pretty interesting.
Yeah. Security is in a lot of people's minds recently with the log4j stuff. And then yeah,
all of these supply chain attacks that are happening, particularly in the JavaScript space.
It seems like a lot more happens in that area more so than like Python, but I feel like the packaging
story is really similar in both. So it's useful to take the lessons learned from the JavaScript ecosystem,
pull them back into Python. And I think something like this is really valuable,
particularly, I know some companies have just very difficult bureaucratic processes to like
get requirements in. And so if you say like, this is just this one file, it has this license,
we just need this makes it a lot easier.
We can review the one file that won't auto update.
Exactly.
It's going to, yeah. So that's the good news. There's a couple of things worth pointing out
one over in the PR section is a lot of the stuff inside is not PEP 8 compliant or other stuff.
So if you drop it into your project, it'll give you a bunch of warnings. So you might want to run
like black on your on it before you put it in your project. I did a PR that's suggesting that
that should just be part of it. There's an ongoing conversation about that. Also, it doesn't support
a couple of the main methods like dot JSON for consuming APIs, and raise for status, which if you
don't get a successful status, it'll raise an exception. So you don't carry on with bad data.
So those two are really good. The raise for status is supposed to be put in soon. The JSON one is up
for debate. With all that said, I have a branch that has all those fixes as PEP 8 compliant.
f-strings has those two functions that you might use. So you can, people can use that as well.
If they want.
Did you put a PR to get those back in?
Oh yeah. Yeah. That's what I was pointing out before though. I absolutely did. Yeah. They're not,
I'm debating with the author whether or not he thinks that those are appropriate to add to it.
Maybe you could rename it medium rec if.
Medium size rec. So anyway, it's not super important. It's not that big of a deal, but I mean,
you know, the, the effect of actually adding those, they're not huge amounts of code that you've got to
add to make this happen. Like the JSON one is literally one line of code. No, you could take it. I mean,
do you count the function definition of a separate line? It's two if you got to count the def, but it's
like super, super small. So if people can grab mine and they can add it or they can grab theirs
and then add it, whatever. So, or that's the good news.
Fork the project and make Mewtwo rec.
Right? So much more Mew.
Yeah, exactly. Now here's the reality of what I found. I have a lot of projects that have
10, 20 dependencies because there are, you know, tens of thousands of lines of code and they do a lot of
stuff. Every single one of those where I thought, Oh, this would be kind of fun just to like cut down
on the dependencies and the dependencies of the dependencies. Cause what I do with requests is
real simple. Usually call an API, get some JSON, get some values out of it. It'd be nice to do
something like this. The reality is so many things depend upon requests. Sentry, for example, depends on
requests. MailChimp API depends on requests and et cetera, et cetera, et cetera. So by the time you get
a project built up with other stuff, it's already got requests required and installed and so on.
So it's like, this is for like a smallish app that doesn't have really many other dependencies that I
think this makes a lot of sense for. Cause if you depend on a lot of things, you're going to end up
with requests as a dependency real quick. Yeah. That's a really solid point.
Yeah. Thanks. Lastly, for people out there listening, wouldn't it be fantastic if a request itself
offered a, an official mini requests and HTTPX offered a single file version and AIO HTTP client
offered a single file version. Like, yeah, it only has 80% of the functions, but if they don't have,
if those functions don't have dependencies, maybe just drop those in and offer. I don't know. It would be
great.
One of the things that I like about actually alternatives, either, either within a project
itself as an alternative or these forked projects that have the same API is they might have benefits.
And so, but you have to, you have to weigh those. So it does encourage actually a nice software design
of a couple of things. One of them is isolate your dependencies to the fuse, few files as possible.
So if, if you only have one of your modules accessing requests, then you only have one
place. You need to change it to this new module import. Yeah, absolutely. The other thing is
testing, testing your behavior. So instead of implementation, so if you test your behavior
and you've got it isolated, you can drop in a thing, run your, run your CI, see if it all works,
throw it to a couple, few beta people and run with it if it works. So yeah, quite cool.
Now, one thing that could be useful and also potentially extremely dangerous is some like
Python level capacity for shimming a module. So like in the situation that you describe,
Michael, where you have a ton of dependencies that all require requests, you could pull in something
like murec and then just say like, this is a request. Python, I want you to think of this as requests.
Yeah. But obviously that has, I mean, it's just an idea. It has some pretty bad security implications
with people being able to usurp that. So yeah, it may cost some unexpected behavior, but yeah,
it's also could be good. All right. Just put your entire application inside of a patch statement.
No, just kidding. What I'm hearing is that we need to make our entire application one file
in every case and that will just solve all of the problems.
Just one function actually. Just one main.
It's perfect.
We don't even need a function in Python, right?
Yeah. Okay. Yeah. No functions.
It just runs once, top to bottom. Let's go.
Now I was streaming of a world where like there's a simple use case that you don't have to have a
bunch of dependencies and dependencies, but it's probably a little extreme and when you take it
very far at all. All right, Brian, what you got for the next one here?
Oh, this is your extra. No, Madison, you're taking us out for a many times.
Yeah.
Yeah. Welcome to Openverse. This is not the metaverse, but everything is, you know, I say call the tech
industry a song because everything's a verse these days. But this is a search engine for openly licensed
media. This is something that the WordPress community is supporting. And so what I mean by
openly licensed media is images and audio. That's what we have currently. But we're hoping down the
line to have things like video, 3D models, text, all assets and media that you can use without having
to pay for them. And just some licenses require attribution. Others don't. A lot of them are free
for remix and reuse. And so this used to be called CC search under the Creative Commons sort of purview,
but they've handed it off to us to help shepherd into the future. And so if you are looking for content
to use on your blog or your podcast or anything that you're creating, any sort of content that you're creating,
your conference presentation, your conference presentation, your courses, whatever, there's a lot of a lot of times I'm like,
I need an image. I need to be able to use it.
Or a snippet of audio to throw someplace. This is awesome.
Yeah. So I'll show an example here in the live stream. I'm going to type Jupyter. And I have to spell it right. I typed
Jupyter last time. And yeah, you just get a bunch of pictures of, you know, Jupyter and then also different sound clips that we have
mixed in if you want all of the results. You can also filter by just certain media types, like seeing just images or seeing just the audio results.
And then when you click on an image, you'll see the attribution for that image right there alongside it.
And so you can just copy that and put it in your website after you link the image.
And we have over 600 million images in Openverse and more audio and more images and more just media in general to come.
Fantastic.
Oh, and if we search, sorry, if we search Jupyter, there's some fun, like, conference-y, you know, screenshots.
So there's, you know, lots to use here.
Cool. Alvaro asks, can you search by license type?
Yeah. So I'm sharing this in the live stream, but on the right, the first filter that we have is by different license types.
And a lot of these are, I believe they're creative commons license, but not all of them are.
We have public domain markered licenses as well.
And then you can search by use too, depending on how you're using that.
So if you're using it commercially, that's going to have different licenses and implications for you versus modifying and adapting.
And then we have, I mean, Openverse serves as like an aggregate for different entities that host some of this openly licensed media.
So things like museums, you know, NASA's photos, that sort of thing.
And so you can also search by provider too.
So if you're looking for space photos and you say, I just want NASA's authority on this, then you can sort of filter by that.
By that aggregate.
Very cool.
Yeah.
This is a constant challenge and it's great.
Like it's a challenge for blogs.
It's a challenge for like all these things.
Right.
But it makes perfect sense why WordPress would be interested in this.
Totally.
Yeah.
And we're hoping to have it integrated into WordPress down the line.
So like if you're working on a WordPress site and you want to add an image, one of the blocks that you can pull up is just a search on Openverse.
And then you pull it in and it will pull the attribution in with it.
And you don't have to do a whole lot of extra work.
So we're hoping that that's going to be coming down the line too.
And yeah, it's so easy to just like go to Google Images and find an image, but it's harder to find the appropriate attribution for that.
And particularly you can get into some very interesting legal spaces if you're making money off of that photo too.
Right.
I mean, it makes perfect sense if you're like a high school student doing like a research project.
Who cares?
Right.
But it starts to push the limit if you're selling something or you're making a book or whatever.
Yeah.
One of the things I think is interesting is that the difference between non-commercial and commercial.
And we think of it like big companies or blogs or something.
And it's not that cut and dry because like you start, say you're starting a podcast, you start getting sponsors and you're making like five bucks a week.
That's commercial.
But it's not like I can afford a huge license.
So, yeah.
Right.
Exactly.
And I mean, maybe you started non-commercially and then it became commercial.
Yeah.
Right.
But you had already used it and stuff like that as well.
Yeah.
How about a real time feature request?
Dean Langston asks, I wish it had a, this is a ping with a transparent background.
I hear it.
I use that feature all the time in Google Images.
Yeah.
We actually just finished a redesign of the site.
We launched yesterday.
For this redesign, which is really exciting.
But we have, I mean, we have lots of stuff that we want to, we want to start adding to this.
Turns out that making a search engine is not easy.
Surprise.
So there's a lot of work to be done.
But that's, yeah, that's a great feature request.
All of this too is a great plug.
So thank you for that comment.
All of this is open source.
And so if you just search Openverse GitHub, like we had mentioned earlier, because if you just search Openverse, you'll actually get the site.
You can go and make an issue on any one of the number of repos that we have for describing this project.
And on top of that too, if you know of a content provider, like a museum or whatnot that has an API that could have its images added to Openverse, we're trying to make it really easy to write those.
We call them provider ingestion scripts.
So even if you just know of one, you can make an issue for us and we'll write the provider script.
But we also love, you know, public contributions.
If you have a source that you want to add and you want to get it into Openverse.
Oh, yeah, that's great.
Brian, now are you ready for your extras?
I am.
Yeah.
So we were talking about security and supply chain for packages.
And so I noticed this actually, gosh, it just came out.
Like, was it yesterday?
Yesterday.
Brett Cannon announced that he's got a, he has a GitHub action that called pip secure install that he published.
And apparently VS Code or VS Code Python uses it.
But the thing is, is it just sort of, if you pip install something with a requirements file, it could have who knows what it all is in there and your requirements.
And then they have dependencies and they have dependencies.
So this, this secure install is, allows you to do through GitHub actions, use a requirements file, but you have to have, you have to have stuff in it.
So you have to have, no, it doesn't pick up any dependencies and it requires hashes.
So you, so you have to have a full requirements file with all of, all of the dependency tree in there with the hashes to eliminate, eliminate these like supply chain problems.
It doesn't eliminate them, but once you've tested a good package, you can just, you know, put this in there.
So I just wanted to shout out for, for this project by Brett.
So that was cool.
The second thing I wanted to shout out, which I'm like totally excited.
Basically, this is a shout out to everybody out there listening to this that has supported the Python testing with pytest book.
I was talking right before we started recording that today is the last day I get to touch it.
I get to my final edits are going in, but because of all the beta, the beta purchasers it's supported the rewrite and just, just been awesome support.
And right now it's at number two is the bestseller on pragmatic.
So that's pretty exciting.
Congratulations.
That's awesome.
That's fantastic.
Yeah.
Madison back to you.
Anything you want to give a quick shout out to?
Yeah.
A couple, couple quick things.
One thing I forgot to mention about Openverse is also written mostly in Python too.
So if you're familiar with Python, you can, you can help contribute.
But on top of that.
No, no, that's, yeah.
It's kind of interesting because most of WordPress is PHP and JavaScript, but Openverse is a fun little extra, you know, blob on the side that runs in Python.
So.
Yeah.
Beautiful.
Speaking of small Python web apps and whatnot.
Some folks in Seattle recently launched a new police accountability and information tool.
And so this is just a tool.
It's spd.watch for the URL.
And it's a tool that just allows you to search for police officers in the Seattle area and get information on them.
So, you know, if you're interacting with an officer, sort of what their, what their history is, how long they've been with the force, that sort of thing.
And it can be really useful for community safety.
And also just accountability.
And you all had mentioned Just in episode 242.
I just wanted to give, I just wanted to give a shout out to it.
I have been using this for every single project that I have touched.
When I go to a project that doesn't have Just, I get very angry.
It's so fantastic.
I mean, the fact that you can add comments for different recipes, your recipes can build on other recipes.
There's a lot of complexity that you can have in the Just file, which makes it easy for new people to come on and start contributing.
And so if you have, like, lots of Docker containers that require, you know, certain specialization in some sense, you don't have to write this big, long read me that describes all the steps.
You say, download Just, and then Just run.
And that's it.
It's so nice.
I totally forgot about Just.
So I'm glad you brought it up again.
It's so, I just, I can't sing its praises enough, honestly.
Although I do have to say, its name does make it very difficult to do Google searches for.
And then lastly, I just want to give a shout out to the GitHub Package Registry.
That's ghcr.io for githubcontainerregistry.io.
They do free Docker image hosting for open source projects.
And I'm not sure what the pricing is for it.
There's, or we could see the pricing.
But, yeah, they do.
They do free for open source projects, which Openverse is taking advantage of.
And I've used on a number of personal projects.
And it's been incredibly helpful to just be able to build and push an image for free with GitHub Actions and then have that hosted for free on GitHub Container Registry.
Oh, that's cool.
Yeah, it looks handy.
Cool.
Nice.
How about you, Michael?
I got a couple as well.
Yeah, I got a couple.
Let me go back here.
So very kind message came out on Twitter saying, here's a really cool way you can go to the transcripts for the podcast, which is on GitHub.
And then you can do like a search across them using some nice GitHub search features.
Absolutely true.
Very nice.
I also wanted to point out a couple of things that we actually have some neat features that people can play with.
First of all, we have a search engine.
You can click on the upper right.
This is, look, we're live streaming.
So the thing you can search for, so I could search for like pytest and it would come up with the episodes and whatnot.
I could search for Hawaii.
Like every single episode.
Yeah, exactly.
So we get like our Python on the beach that we did recently and whatnot.
My search for just was very difficult, but through no fault of your own.
If you search for just, we get a whole bunch of stuff back.
Yeah, yeah.
But it's pretty neat.
It also has a JSON API.
If people want to consume that, they can go and search for stuff and then it'll come up with, you know, a JSON variant of results and whatnot.
Yeah.
So that has been there for a while.
So people can check that out and that's cool.
But I also wanted to point out something brand new, Brian.
I don't know if you even got a chance to play with this because I just did this.
I did.
It's so cool.
It's so good.
So if you go to a trans or the transcript, so if you're on any episode, usually on the right, it'll say, unless the screen is really small, then it might be the bottom.
It'll say full transcript.
And then you can go in here and there's transcripts, which are searchable and there's a play thing.
But there's also now a ability to click on any paragraph or sentence, the little play button next to it.
That's awesome.
And it'll just start playing the episode at that time.
So if people want to go back and use what we've been doing for four or five years, whatever it's been,
as resources, yeah, that should make it a little bit easier.
Did you back part this to like old episodes also?
Yeah, because this is so let me tell you how I did it.
Because the transcripts, if you look at them, they just have a number.
They just have like a timestamp there.
Yeah.
So I use this really cool regular expressions 101 or regex101.com tool website to build up the regex using named groups.
And let me just check this out, which is on the screen.
You guys, you'll check out the link.
If you're listening, you can put the thing you want to search for.
And then the groups and the regex, it'll show if it's a match.
It'll actually highlight and name the different elements and color code the syntax of your regular expression elements into like name sections and all sorts of cool stuff.
What do you think of that?
It's awesome.
If I'm writing a regular expression that's longer than like three or four characters, then I'm using regex101.
Like this site is so fantastic.
It is.
I totally agree.
It has the references in the bottom right too for the different whatever the tokens.
Felix has loved it as well.
And so it also gives you hope.
So if I put it like on the D+, which means find one or more numbers, it'll say exactly what that kind of stuff means and so on.
So you can say like B down here and it'll tell you, you know, what is that doing?
And so on.
And that's a quick one.
Somewhere there's a search.
But it was nice that it will actually show you which sections and give you extra information about it and all kinds of neat stuff.
And like full descriptions too of like what each particular thing is doing.
It's so great.
There you go.
So if you like hover over the backslash D+, or whatever I got here, it says Meta Escape matches a digit equivalent to bracket zero to nine.
Here's a name group.
Here's just that matches the character.
And you just as you hover, you know, starts the start of the text, right?
For a carrot.
And as you hover over these things, you get real time like autocomplete for like the meaning of that section.
And like a full explanation in the top right too, which can be really helpful.
Absolutely.
Because so often when I look at this kind of stuff, it's right only, you know, like I got it working and I can't decipher it again.
So you can put it back in here and come to an understanding, which is cool.
All right.
One more thing real quick.
A new video on my Python short series that I'm doing.
Do you even need loops in Python?
People can check that out.
So it's really about list comprehensions and fun stuff you can do with list comprehensions in Python.
So I've been having a lot of fun with that.
And the open verse sounds very interesting for grabbing content to throw in some of those videos as well.
Oops.
Yeah.
Absolutely.
All right.
Well, that brings us to our joke, I do believe.
All right.
You all ready for it?
I have one.
There's a...
Oh, yeah.
I found a video.
Sorry.
This got shared in...
Speaking of Python loops, I don't know that I'm going to be able to show it, but well, fingers crossed here.
I...
This video was shared in a work channel recently, and I'm not going to be able to show it.
But it's a snake that is moving around a box.
Oh, here we go.
Perfect.
Oh, I love it.
Speaking of Python loops...
So you really don't need these Python loops.
Yes, exactly.
Oh, my God.
It's a Python slithering around a box, which is rotating it in a circle.
Here's a simple loop with Python.
And it also...
The snake isn't moving anywhere because of the way that it's slithering.
So anyway, you really don't need loops.
I love it.
That's awesome.
Roller out there says, the new Python short channel is great.
Thanks, Michael.
And Alvaro says, I usually test my regex with set and grep on the command line.
This seems easier.
That thing is awesome.
All right.
So I've got a joke that is not my joke, but is from instead Josh Thurston.
He sent them in a little while ago.
So there's kind of three together in sequence.
So here we go.
How did the hacker get away from the police?
He just ran somewhere.
Boo.
Oh, that joke makes me want to cry.
Oh, my goodness.
Where do you find a hacker?
Indie Crypt.
Oh, my goodness.
Oh, they're so bad.
These are full...
Hold on.
I'll add them to the stream as well.
Those are full-on dad jokes right there.
That's two thumbs down in a good way.
Absolutely.
Like overflows the bad buffer and becomes good again.
Yeah.
Wow.
Fantastic.
All right.
Well, speaking of fantastic, great to have you here, Madison.
Thanks so much for having me.
As always.
It's good.
You're welcome.
Yep.
Talk to everybody later.
Yeah.
Thanks, everyone.
Have a good one.
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.