Python Bytes - #225 SELECT Pydantic FROM MongoDB
Episode Date: March 17, 2021Topics covered in this episode: Raspberry Pi Pico New MongoDB ODM: Beanie Sourcery Neomodel Conference radar Extras Joke See the full show notes for this episode on the website at pythonbytes.fm.../225
Transcript
Discussion (0)
Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.
This is episode 225, recorded March, March 17th.
I'm Brian Aukin.
I'm Michael Kennedy.
And I'm Sebastian Bitovsky.
Yay, we have a special guest.
Yay.
Welcome, Sebastian.
Thanks. I'm excited to be here. Huge fan of the show.
Thank you. Thanks so much.
Should we kick it off?
Yeah, yeah. Also, I want to say thanks to Linode for sponsoring this episode.
And Brian, I've heard of people getting like smaller computers, Raspberry Pis and things like that.
But you've got you're taking it to some crazy extreme here.
Is that what's happening?
Yeah.
What is this thing?
The Pico.
So actually, I saw this announcement on Twitter.
It's actually came out in January, but we haven't covered it yet.
It's kind of exciting.
The Pico is $4, and I know they have a $5 little chip also, or a little controller.
But this is really like in microcontroller land, which is, it's really pretty cool.
It doesn't have a lot, like there's no Wi-Fi on it.
There's not a lot on it, but there's also not a lot on it.
So it's very low powered so
really microcontroller size one of the exciting things about this is this is i think this is the
first uh the first raspberry pi with a chip designed by raspberry pi so this is a custom
raspberry pi chip and what do they call it a uh oh i can't remember rp 2040 is the the chip that goes in it means
anything to anybody but um but the the low power thing is what i think is fascinating and i um is
because there's some there's some things that you can even you can power like led lights and stuff
with it even and there's there is enough power to do quite a bit with peripherals um but you
also can since it's so low power this will be good for things like uh you know temperature
sensors and other sensors that you leave alone someplace and a microcontroller that you can like
leave somewhere and then come pick up later um this is um this is some and that you can control
with python is something new
and that's pretty exciting yeah that's super cool and apparently it's coming coming soon also is the
arduino nano connect which comes with a nine axis imu and a microphone and microphone um a powerful
wi-fi and bluetooth module and a crypto chip and stuff like that. So that'd be kind of cool as well, right?
Like put this thing on Wi-Fi and whatnot.
Yeah. And one of the other things I forgot to mention,
this is the first Raspberry Pi product that has an ADC on it.
So with that, you can do, it isn't just like you,
you can do analog input so you can, you know,
more accurately hook up a temperature sensor or something.
Oh, right.
So if you're working with, like, this is your IoT thing and you want to just work with, like, plug in a voltage meter or whatever, right?
Yeah.
Okay.
Super cool.
Yeah.
So that's pretty exciting.
And anything that drives people working with a combination of hardware and software together in a nice language like python very much
appreciated this is an exciting part of the python world i also want to mention the the editor
mu that can be found at code with mu and i don't have this up here but they they released they're
working on the 1.1 version and the beta 2 is out.
And one of the things it supports is this Pika board, along with some of the Lego Spike products and a whole bunch of new fixes.
So, especially when we're working with microcontrollers and students, that's a nice thing to have.
Did you mention the price?
That is $4?
Yes.
Yeah, that's amazing.
$4, that is so dollars yes yeah that's amazing dollars that is so awesome right so yeah that the
um later on in this uh the announcement they've got like this picture of them like wrapped up
like a whole like a reel of these i think they're trying to encourage people to buy like a whole
bunch of them at a time it's like a candy wrapper but you get a computer instead yeah that's pretty
great really good i love it that's as good as our jokes sebastian
what do you think of this thing um i never actually got into raspberry pi and all this
hardware programming hardware i actually bought raspberry pi like years ago and it was in my
drawer until one day i decided to put a pie hole on it to get rid of the ads and it's been working
flawlessly since then so i have raspberry pi somewhere there but i'm impressed to see how they are dropping the price like four dollars it's like extremely
affordable yeah yeah that's really really wild that thing pretty awesome also brian a comment
paul sanders in the live stream says can you use ubuntu on pico like a regular quote regular
raspberry pi or is it like its own thing i'm pretty sure it's its own thing i don't think
it has a full operating system on it. Yeah. It describes itself as a micro controller, right?
Yeah. So it's, it's like more like MicroPython, Adafruit, Adacircuit, Python, so on. Yeah. It
would be cool, but yeah, I don't know. It's pretty small. $4. Yeah. I think it is running MicroPython,
but I'm not sure. Yeah. Yeah. Yeah. Very cool. All right. Well, I want to talk about something
brand new for the next item here, and that is Beanie. So I gave across this yesterday
and actually I had some other thing I was going to cover. I'm like, no, no, no. Beanie is cool.
I want to talk about Beanie. I'm pretty excited about it because I was recently talking with a
friend of mine about, oh, what would you use with fast API and MongoDB? Well, the traditional ORMs,
ODMs, they don't call them ORMs in Mongo because they
don't map relations, they map documents. So they call them ODMs, object document mappers,
but same idea. I was talking with him and saying, you know, it's like, well, what would you use with
fast API? Because you really want to leverage the async and await nature of the views, which is so
easy to do there and whatnot. But I started looking, all the old standbys that I like,
Mongo Engine and some of the others,
the ORM, ODM side don't seem to be
really supporting the async and await world.
You start looking around, well, there's Motor,
which is the official async library from MongoDB,
the company, the organization to support this.
But the way you program there is I run a query
as sort of almost like SQL syntax there is I run a query as,
you know, sort of almost like SQL syntax and I get back a Python dictionary, which is okay,
but I don't know. I don't really like that style. Really like getting a class back,
be able to do queries with the class, have the class have like types and constraints and whatnot.
Because if you're just working with dictionaries, it's so easy to like forget to set it. I know
a field you didn't remember existed or something weird like that and get inconsistent data.
So I ran across this thing called Beanie,
which is an async-friendly ODM for MongoDB.
And we've talked a lot about Pydantic.
Pydantic's awesome, right?
Yeah.
Yeah.
So with Beanie, it basically takes and uses Pydantic models
as the classes that map to the database.
And I think that's just super cool.
Yeah, very cool.
Yeah. So let me see if I can pull up some examples here. So the idea is that with the document
databases, you can embed stuff. So I might have one class that's containing a list of other classes
I define, and that just is a record in the database. So the way it works with Beanie is you
create anything that derives from base model. That means it's a Pydantic model with all the validation and loading and
stuff that you get from that world. And then you have a top level document that drives from this
Beanie.document, which is really just a specialization of a Pydantic model. So everything
you do with Pydantic happens here. And then you actually just work with the motor async driver,
which is the official, in quotes, way to talk to MongoDB asynchronously from Python. And then you actually just work with the motor async driver, which is the official, in
quotes, way to talk to MongoDB asynchronously from Python. And then you can create a class,
embed your objects, hit save. You can go and just go to your document, just say insert one as a
class, insert many. You can do filters. You can either do like get by ID, or you can say do a
find query or something like that.
So yeah, I think it's pretty neat that it allows you to take this sort of blended.
It's like half ORM, ODM, and half sort of just working directly with the MongoDB API.
And yeah, it's pretty neat.
One of the big notable things that I feel like it's kind of missing is it doesn't support
creating and managing indexes through
this object model. But I was talking to the guy who created it, Roman Wright, on GitHub. And he's
like, yeah, that's a good idea. It's like one of the next things I'm thinking about. So pretty cool.
If you're doing stuff with MongoDB and you're looking and you like Pydantic, here's an exciting
new project that people can check out. It even leverage, it even has capabilities for the
aggregation model, which is like MapReduce plus sort of that kind of processing, which often doesn't show up in
these ODMs. So people can check it out. It's growing. It was almost brand new yesterday.
Now it's up to 25 stars. So it's not super, super popular, but it's like 25 times more popular than
it was yesterday. So that's pretty cool. It's on on a good track i got a question about indexes so if you even if it didn't support it could you go around and just request them
anyway yeah no problem you could go to like motor and do it in python say create index at this you
know like it's not create it's ensure index like create if does not exist index uh during app
startup or you just literally could go to the database and actually use some management tool
and create the indexes there so you it's not like you can't use indexes. It's just like,
if you're defining the whole model, it would be cool if it could just happen as part of the class
definition. As many things do like, um, SQL alchemy does that Mongo engine does that, right?
It's a pretty standard paradigm here. So I don't know. What do you guys think?
I kind of really like the idea of having a, odmb like this hybrid model of like it's not really taking over hiding mongo because one was
actually not that hard to deal with anyway it's adding some of these class uh wrappers and giving
you a lot of the power of mongo at the same time yeah for sure and you can see like actually the
document or the blog post that announces this rather than the GitHub repo has a few examples.
And they're all fast API.
Like, you have an asynchronous API endpoint.
And then you await note.create, which saves it.
Or you can await, like, a query.
Let me see if, yeah.
Anyway, you can await queries and things like that, which is the really cool thing.
So, Pydantic plus async and await.
Pretty neat.
Yeah, that's pretty cool.
Especially the list of features that you show,
it's pretty impressive for such a new project.
Yeah, yeah.
This guy Roman, apparently, he comments in here,
like, this is something I've been using for myself
for a while, and it's really awesome.
So now I'm just sort of putting it out there.
Hopefully it grows from that.
So that's pretty cool.
So you work with Async more than I have.
Is this something that I could, if you want to start playing with it, would you have to
jump into the async world or could you use Beanie without async stuff?
You know, I hadn't really thought about it.
Looking at it, it looks like it has to be async.
Okay.
Right?
Because the queries like the find one, create and so on, they all are awaitable.
They're all being awaited.
Okay.
And I don't see a way just quickly glancing at it to say, don't be that.
You know what I mean?
Like, I don't see how it's both at the same time.
And if it is, you probably have to use it.
So I'm guessing actually you do have to use it as an async, but I don't know for sure.
I haven't tried it well enough.
It's a good question.
All right. Well, speaking of good stuff, something I've talked about on TalkPython, but not. async but i don't know for sure i haven't tried it okay well enough it's a good question all right
well speaking of good stuff something i've talked about on python but not on python bytes so
sebastian is going to tell you guys about something uh over there right that we talked about over
there yeah so i wanted to talk about a tool that i have been using for a long time and i know that
you michael are familiar with it because you already have a huge I'm a huge fan of code quality, refactoring,
all that kind of stuff.
Having your editor tell you,
this could be better, press this button to make it happen.
Yeah, exactly.
That's why I absolutely love this tool
because it's one level above, let's say, linter.
Because when you're using PyLinter,
you get some warnings saying, look, this is wrong.
And then there is Sorcery
that tries to make your code better. It gives you like refactoring tooltips
just as you type. So for example, if you scroll a bit down there, there is some gif showing what
it can do. And for example, if you have like an if statement and both branches have the same
statement, you will get a pop-up saying that, look, this can be moved outside.
Or for example, when you have like a for loop, you will get a recommendation saying, hey,
this can be turned into a list comprehension.
So I really like it.
And it integrates, I think, with PyCharm and VS Code.
So I don't know about Veeam.
I don't think there is any support right now for stuff like that.
And it's super easy to use because you just got a pop-up and you can click yes i want to have this refactoring you actually can yeah you
can see the diff of how it will look after the refactoring and yeah it's also it's free to use
at least in the code editor i think they have like they have the pricing tab but i think you can pay
to have like um analytics for your project
and set it up with continuous integration servers and stuff like that.
But for VS Code and PyCharm, it's free to use.
Yeah.
It looks like you get a couple of extra refactorings and whole project analysis for money.
Yeah.
But the basic refactorings that can already help you a lot, they are there for free. And at least for me,
I just keep getting constant pop-ups
saying like this code can be refactored.
So I mean, maybe I'm a terrible programmer,
but sometimes I'm like tired
and I don't see something.
So it's nice to just click one thing
and have like three lines of code
turn into one line.
So that's pretty awesome.
I don't know.
Yeah.
Brian, have you used it?
Because I know that Michael has. I haven't used it it yet but i'm pretty excited it looks pretty fun yeah it
looks really neat and like i said i did interview the guys over there on the show about what they're
doing and i believe that all the like one of the things that some people have worried about is
these kinds of tools sometimes you know especially the ones that try to use like ai ml to help you
i don't think that this is one of those. They'll end up sending your code over.
And I think this is all just local stuff, which is nice.
Yeah, I guess that's one of my questions.
I often run, you know, I often do a lot of coding
on my laptop with it, with no Wi-Fi connection or anything.
Can I, does this help at all?
I'm pretty sure.
I don't think it makes any,
I don't think it uses the internet to do its magic.
So I think it's all just in the editor and PyCharm. Yeah, I'm pretty sure that's the case. But
the one thing, so I used this for a while and I liked it. The one thing that drove me crazy and
possibly it's been fixed is there's one or two recommendations. Like a lot of the recommendations
it makes are great, but there was one or two that I really didn't like. I think for example,
I was using a guarding clause.
So I would say, coming into the method,
the very first thing is like,
if something's wrong, return and then there's an error
and then go do the thing I was really wanting to do.
So it's not indented.
I really liked that style.
And it was suggesting that I like include,
like I reversed that if,
so I don't have as many, as much cycle,
not cyclamen, as many decision points, right?
There's not as many branches i
as going on there and that's fine i just don't have to accept that it doesn't automatically do
it but it constantly was highlighting that with like squiggles as if something was wrong my editor
and other tools like pie charm do that you could just say you know what for this thing please don't
tell me that this is the fix because i really want this to be here for reason x y and z i couldn't
find a way to do that in Sorcery.
And it was driving me crazy.
I'm like, no, this is not wrong.
Please stop telling me it's wrong.
So I really hope if they're listening,
maybe you could hint, hint, add a hash ignore Sorcery line
type of thing like all the other editors have.
But yeah, no, I do think it's a cool tool.
And people should check it out if it sounds interesting.
Yeah, it would be nice to have this configurable.
Stop complaining about this refactoring.
Right.
Or either I would even be happy to just say, please don't tell me about it because it was
like very specific, like one very small suggestion.
Like, just don't suggest that to me ever.
I don't ever want that.
But everything else you do, I love you.
Thank you.
Nice. Yeah. John She do, I love you. Thank you. Nice.
Yeah.
John Sheehan has a comment.
Some code efficiency improvements could end up obfuscating intent.
Absolutely, for sure.
They definitely could.
I feel like a lot of what it's suggesting actually is a clarifying change.
Look, you're duplicating this code or this is overly indented.
Here's how you change it so it's not.
So I feel like on that regard, Sorcery is really good.
Yeah, same.
I have the same feeling.
Like it doesn't try to give you
like very quirky refactorings.
It's actually tries to make your code easier
by like removing redundant lines
and stuff like that.
Yeah, very good point.
But a tool like this
that could make it more obfuscated.
Now there's something.
There's job security right there, baby.
Yeah.
Command alt L reformat for.
Reformat for Brian.
Exactly.
I know it can work on this project, but so and so.
Quickly reformat it to viewable, work on it and re-encode it.
Perfect.
Yeah.
That'd be cool.
Yeah.
Something else that's awesome is Linode.
Thank you, Linode.
Thank you for sponsoring the episode. Simplify your infrastructure and cut your cloud bills in awesome is Linode. Thank you, Linode. Thank you for sponsoring the episode.
Simplify your infrastructure and cut your cloud bills in half with Linode's Linux virtual machines.
Develop, deploy, and scale your modern applications faster and easier.
Whether you're developing a personal project or managing larger workloads, you deserve simple, affordable, and accessible cloud computing solutions.
As a listener of Python Bytes, you'll get a $100 free credit.
You can find all the details at pythonbytes.fm.
Linode has data centers around the world with the same simple and consistent pricing
regardless of location.
That's cool.
Choose the data center nearest to your users.
You also receive 24-7, 365 human support with no tiers or handoffs, regardless of your plan size.
You can choose shared or dedicated compute instances, or you can use your $100 credit
on an S3 compatible object storage, manage Kubernetes and more.
If it runs on Linux, it runs on Linode.
Visit pythonbytes.fm slash Linode and click on the create free account button to get started.
Absolutely.
You know what I like about Linode?
It's like straightforward and simple. I go to to places like aws i'm like what is
all this stuff and what why am i like so deep in the permissions of aims in order to send an email
over here to connect like it's just ah like i just want to create a server make it go let's do that
nice are we there we're there we're there we. Okay. We're on to your next item, I believe.
Wait, no, we're not.
I'm jumping ahead.
We're on to my next item.
So I'm going to feel back of that.
So I'm on a database kick for some reason this week.
I mean, I love databases, which is weird because when I first learned them, they seemed so challenging and odd and I struggled with them.
But I don't know.
I just really enjoy thinking about databases because they're like the magic of your application, right?
A really slow, clunky database will just like bring it down.
But a really nice polished one is like, how is that so fast and smooth?
Like, I really like working with this site.
So one that I haven't spoken much about and honestly don't have a ton of experience with,
but I do think is an interesting consideration is another branch of the NoSQL world and graph
databases.
So instead of modeling columns, you're really
modeling entities and then their relationships. Like the relationship thing is first class thing
you can query by relationships instead of querying by data and then like joining and so on.
So a popular one for this is Neo4j. And there's some nice ways to talk to it from Python. And
there's this, I don't even know what to call it.
OGM, I guess is the right.
And so I said ODM for object document mapper.
So in the graph world, it's OGM for object graph mapper.
So there's an object graph mapper called NeoModel.
And I ran across this and I'm just like,
oh, this is super cool.
So the idea is that you can basically create these classes.
And if you look at how you do it,
if you've ever used Django
ORM or Mongo Engine or something like that, it's literally the same thing. So if you know Django
ORM, you basically can do this, which is powerful because it gives you a whole different way to work
with data and a whole different option without rethinking the world. So I could create, say,
for example, a country, which is derived from structured node. And then just like Django,
you would say code equals instead of string column, you would say string property. And it has
an index. The index is uniqueness. The field is required. Boom, that's it. Like one line field
and it's defined. Then a person, person might have a relationship back to a country and so on. And
really, really neat the way you just sort of define this. And then you can do interesting queries on it. You can ask like, give me the nodes where the person nodes where the name is Jim. And that's pretty
simple. Or you can say, give me the nodes where the age is greater than three or whatever. But
also you can ask things like, give me the country. So go Jim.country. Is that connected to Germany?
Yes or no. If it is, then Jim is from Germany.
Or you can go to Germany and say, give me all the inhabitants.
And it'll tell you all the people in there.
And you can even say things like, I would like all the people in Germany whose name is Jim. So Germany.inhabitant.search name equals Jim.
Like an incredibly simple programming model to work with these graph databases.
So if you've got like really structured related data,
but you want to like follow those relationships around,
you know, maybe Postgres is not the best option
for that kind of data.
And this would be a good one.
Cool, huh?
Takes a bit of a mind bending, getting used to it,
but pretty neat.
Yeah.
Yeah, Sebastian, have you ever had to do anything
with graph databases?
No, but when I was looking at your code examples,
I was thinking why there is Django code.
And then you started saying, yeah, it looks similar to Django. And I was like, okay.
Yeah, exactly. Why is there Django code in my graph database? But I think that's a huge benefit
for the Python world, right? Like a lot of people know that the Django ORM model, or it's also the
same as Mongo Engine, which obviously is also inspired by Django's ORM. And so a really
straightforward way, like I think you could get up to speed in an hour if inspired by Django's ORM. And so a really straightforward way,
like I think you could get up to speed in an hour
if you knew Django working with this thing.
It seems real straightforward.
So it might be kind of cool to see
like somebody do an example
where they did the toy example in a graph database,
a relational and a document to see
what the trade-offs and benefits and things that
are right we've had we've got that like silly to-do app that everyone has used for javascript
front-end frameworks to show like here's how you build to-do in view j's here's how you build it
and react i think having like this canonical database represented like side by side like
here's the postgres version here's the neo4j version all in Python. That would be an awesome article. Somebody had a bunch of time and desire.
Yeah. Yeah. Pretty cool. Pretty cool. Now, now you can talk about your item. I didn't mean to
shoot you too far ahead there. No, so I lost my window there. There it is. So I, I was,
I've been thinking about, I don't mock much.
When I test, I try to test everything whenever I can.
But I've been learning about mocks a little bit and mocking just because in some cases you kind of want to.
So as I got into it, I didn't get very far before I realized that specking was like something that people found out about later, but sounds sort of magical.
And I wanted to know more. Um, and I, and so I asked the Twitter verse, uh, whoever follows me
and stuff, um, uh, if specking is something that you should do always or avoid it, is there downsides?
And, um, and then one of the things that I got back was a star girl flowers article called my Python, my Python testing style guide, which
includes this incredible section on mocking and, and her section is a, the section is called a,
a mock must always have a spec. And, um, and it's, it's just a really, uh, if you've ever
wondered about this, it's a, it's a really good, uh, discussion about mocking because it's not,
it's not, they're evil and it's also not go discussion about mocking because it's not, it's not their evil.
And it's also not go run out and use them. The recommendations really are use real objects for
collaborators whenever possible, but if you must mock always use auto spec. And so the idea around
specking or not specking is if I, if I create a mock object, it can be anything. I can ask it for the date.
I can ask it for the temperature of my coffee.
I can ask it for anything or I can pass it anything
and it'll accept it.
That's kind of what mocks do.
But if you say auto spec, you say,
I want this thing to mock this other class
and have auto spec be true.
It means I can't do anything to that mocked class
that I couldn't do
to the real thing so all the interface is identical you can't do you can't do functions
that aren't there and that's where i thought well that seems like a good thing and apparently i
it is um i think it's a good thing because you would like your test to at least require
a thing behaves like the real thing right it might It might not give the real data back, but you shouldn't be able to call functions that don't exist or access fields that don't
exist and so on. And more importantly, one of the things that's highlighted in this article is
even if you could manually get it just right, later you might change the interface. You might
change the API call, add a function or add a parameter that's required or remove a parameter that's not needed
anymore. And your tests that use the mock that are custom built are still passing, but they
shouldn't be. And with Autospec, your tests will fail at that point when the interface's
break happens. Wait, you run your tests more than once? No, of course. Obviously, this is why
one of the main values is, this thing is locked down. I want to be able to make
dramatic changes to it and see that it hangs together. And if things like
rename a function has no effect on the test path, that's not so good.
Yeah, and then there's a whole bunch of other great advice that she gives around mocking.
Talks about consider using stubs and fakes and even gives an example of what those are. And basically, it's like writing your own little tiny thing to substitute for the real thing. And spies, which are cool spies are like a mock wrapper around a real object. So it behaves the same as it always did. But you can interrogate like how it was called. That's kind of a neat thing.
And some advice that I didn't really consider before is to the code test
code is way cleaner.
If you don't give the mocks special names,
like a lot of people,
if I wanted to mock foo,
I might kind of title it mock foo.
And she says,
don't do that.
Just name it foo.
Then your code looks a lot cleaner.
And I tried it out. It does really great.
It does help out.
Anyway, great advice on mocking.
So if you're considering mocking, go read that.
And if you're doing unit testing and you want to not test all of your dependencies,
basically, if you don't want to do integration tests,
you probably should be doing something like this.
Yeah, I mean, I hardly ever use them.
I do things like rerouting my code through like like any, I kind of design it into my code
if I have a chance.
I, like for instance, if I need to have a,
I know anything with a database,
I know I'm going to have to redirect the database
during testing.
So that's just built into the design of the system
to be able to reroute that somewhere.
Yeah.
Sebastian, what do you think?
Yeah, that's a bunch of good advice.
So that's a very good good advice so that's that's
a very good article and i kind of agree with you like i also prefer to kind of like
mug a specific method of a real object not to create a mug and then add stuff around although
i think it's a different word for mocking a method it's a stab or one of those words i i could never
remember which one is which yeah yeah for sure and for sure. And then Robert Robertson is getting philosophical
here. Says a mock must always have a spec. Well, they add that
to the Zen of Python. I don't know. In Python 4.0. Yeah,
exactly. These are two things that are very unlikely.
Zen is not extensible. Yeah, possibly. Oh, also
Dean was asking if the live stream started, possibly. Oh, also, Dean was asking if the episode started,
the live stream started early today.
Hey, Dean, daylight savings mismatched by a few weeks
with the rest of the world, at least with Europe.
Yeah, exactly.
That's the story.
All right.
Speaking of time zones and stuff that's challenging,
speaking at conferences can be tricky
because it's virtual.
You're not actually there.
So when does it really start?
Well, maybe at least we can know which ones are out there and when the call for proposals
are done, huh, Sebastian?
Yeah.
So, yeah, as you said, since the PyCon call for proposal acceptance emails will be sent
this week, I was thinking about conferences.
And since it's 2021, most conferences are moving online, which is really cool because, well, they are cheaper.
Well, first of all, tickets are cheaper.
A lot of them are free.
Then you don't have to pay for the accommodation.
You don't have to pay for the ticket.
You don't have to fly.
So you don't have to take holidays.
So a lot of benefits.
And I was wondering, like, how do you find conferences to attend? Like there is this list at python.org
that lists some conferences,
but it doesn't have the smaller local events
and you also don't have dates.
So you only have links to all the global,
well, countrywide conferences,
but you don't know when they are starting.
So I found this tool called Conference Radar
and it's a PyPI package that you can install
and then you get a command line
tool that you can run to get a list of upcoming conferences which is pretty cool especially that
you can have some parameters like you can ask when you can get a list of conferences that have opened
the call for proposal so you can if you want to submit a talk you can see which conferences are
accepting those and i really like it that you get this nice ASCII table in the terminal.
Since I love CLI tools, this is really cool for me to use.
Yeah, yeah.
I think these integrate some rich, even like fancier tables.
But yeah, it's really nice.
Yeah.
But the downside is that they don't have that many conferences because it's using only a
few data sources.
So when I was running it today, I couldn't find that many conferences because it's using only a few data sources. So when I was running it today,
I couldn't find that many conferences. And actually, there was no call for proposal open,
like no date was there. So I hope it will improve. But so far, this is my best tool to like find
upcoming conferences. Yeah. And if people are out there listening, they have a conference,
they want to get the word out about it, you know, might as well go add it to the data source that these things are using.
Yeah, that would be awesome.
Yeah, this thing's cool.
I checked it out.
One bit of confusion for me is if you look at the description, it says installation, you can simply use pip to install Conrad for conference radar.
So you can use pip to install Conrad, but you cannot pip install Conrad.
That will not work.
It may work.
If it does,
you should maybe be concerned because someone heard the show and put something in. You have
to pip install conference-radar. So I don't know, maybe just a little clarification for people who
want to check this out. But the command, the CLI is Conrad show, Conrad refresh, Conrad call for
proposals, things like that. You can even set reminders, right? It'll like remind you when the call for proposal is closing.
Oh, cool.
I didn't see that.
That's nice.
I think there's a remind feature in here.
I can't remember exactly how it works, but yeah, pretty cool.
I'm glad that you mentioned that because I just tried to pip install Conrad and I'm like,
it didn't work, man.
It's broken.
What is this thing?
I just think the documentation is a little unclear because the CLI and the package name
are not the same.
At least you didn't get some malicious package exactly mining bitcoins right now exactly why is my computer hot that's weird oh well suddenly my camera turned on oh no
we're doing a live stream that's why yep yep oh and also uh dean has a quick comment for you
there's fashion oh this is perfect and i think i maintain a quick comment for you there, Sebastian. Oh, this is perfect. And I think I maintain a Google Calendar for conferences.
Oh, cool.
Yeah, that's a good idea.
Yeah, I was looking for different sources
where to get the conference information.
And so far, the most reliable one is my friend Miro on Twitter,
who is submitting and speaking at a lot of conferences.
I'm just following him and he's always speaking.
He's always tweeting. So that's my best bet so far. I met him and he's always speaking uh he's always tweeting so that
that's my best bet so far i met him at pycon slovakia so yeah i know he's at the conferences
often yeah awesome brian is that it uh that's it for me do you have any uh anything you want to
share oh yeah i almost have an extra extra extra extra here all about it section to share but not
quite so i'll keep it keep a little bit quick here, but I'll go through some things. First of all, quick announcement. Sebastian and I have been working for, as he hinted at,
I don't know if this was on the recording or before we started, but for like six months on
a project called Modern Python Projects, which is a follow-on sort of course version of the Modern
Python Developers Toolkit thing we did over at TalkPython episode 279, I think. So we've got this awesome course out at TalkPython.fm slash modern-python-projects,
or just click the link in the show notes and you can check it out.
That's been out for an hour and 10 minutes.
So not very long.
This looks really cool.
I am excited about this.
Yeah, a lot of neat stuff that Sebastian, this is all Sebastian's work that he put into
it here.
So it's really cool.
Oh, you helped a lot as well.
Thanks.
What would you like to, maybe, what do you think, quick thing to share, tell people about this course that you built?
Yeah. So basically my idea was to give you an overview of everything you need to know,
even if you don't have Python installed on your computer, all the way up to actually
building and publishing your project. So basically we start by installing Python. I show
you how to manage dependencies. I also show you how to set up VS Code for programming with Python.
Then we add tests, then we add tools like linters, formatters, some static code analysis.
Then we add test documentation, obviously. We talk about continuous integration. There are like
three sections where we build different projects.
And actually, each of them is done in a different manner.
So for one, I use poetry.
For the other one, I don't use poetry.
So we have a comparison.
And all the way up to deploying, where I show you how to deploy, for example, to Heroku
and how to create a Docker image.
And yeah, all spectrum.
Yeah, it's cool.
I definitely like it.
So people can check that out.
That's a quick item there, just that we launched that recently.
And also, Brian, our Pythonbytes.fm
looks very bright right now.
What do you think?
Yeah, neat.
So one thing I wanted to do,
people have been contacting us and saying,
hey, I heard you mentioned like,
oh, we just mentioned Dean's name on the live stream.
What is this live stream?
When is it?
How do I find it?
So what I've done is I've updated the Pythonbytes website
and TalkPython for its live stream. But for Python Bytes, if you go to pythonbytes.fm,
if we're live streaming at that very moment, there's like a big red banner across the top,
like we're live streaming right now, come be part of the show. And then there's also a live stream
menu item that'll take you over and show you like the live stuff that's happening. And it'll
basically show you the live playing stream, but you can open that up on youtube to be part of the live chat and so on so live stream now on the podcast page if it's a
podcast site if you visit it and it's all bright you know and you got a moment go check out the
live stream yeah and then also um uh if uh if michael's up to date on it which he does all the
work on this i appreciate that um uh we announced when the next one's going to be so if you're not
sure you can just check it out anyway.
And there should be a link there to say when.
Yeah, that's right.
So normally what I try to do is schedule the next one
when we're done with this one.
So if people go there, they'll see the,
like, here's the next live streaming
and YouTube has a button to say,
set a reminder, tell me when this is happening.
Last time, I think I said,
is Python on Mars?
Question mark.
Because that F plane, that flight overview system, it was using Python to train the models.
But I think it's using C++ to fly the little helicopter thing.
And I just mentioned, if anybody knows Python's on Mars, that would be awesome.
Because this is really cool and related.
But it's not the same as Python on Mars.
So Bojack Norseman sent a tweet over and said, hey, Python Bytes, you guys asked for a confirmation.
Linux Unplugged, the Linux podcast,
has an interview with Tim Canham at JPL
where he talks about running various machines
and mentions Python.
So the thing that he talked about is,
remember when the thing was landing
and there was the sky crane that like lowered Perseverance
and there were all these different camera views.
You could see the bottom flying away.
You could see it like shooting off dust and coming down.
There's all these views, like these onboard cameras.
Apparently all those were controlled and collected and like processed with Python on Mars.
So yes, Python is on Mars.
That's sweet.
Nice.
Following up on your item, Sebastian Gita Van Rossum has sent out,
it says that signups for the Python Language Summit at PyCon online only are now open.
If you represent a third-party package
and want to have a say in Python's future,
please sign up.
So if you have a third-party package
and you want to be part of this, please sign up.
I'll put the link in the show notes.
Oh, wait.
Does a single developer package
qualify as a third-party package?
Do you want to have a say in Python's
future? They might not listen to you. They're like, well, I'm going to talk to the guys that
do Flask and Django. You can go get a seat in the corner. I don't think people should listen to me.
Robert Robertson has a very nice meme. The snake has landed. Instead of the eagle,
right? The snake has landed. Beautiful for the Python thing. All right. Sebastian,
anything else you want to throw out there real quick? Yeah, I have a kind of a curiosity because I started using VS Code in a browser recently.
I started a new project and everyone on the team is using VS Code in the browser.
And it's working surprisingly well.
I would never try to use a code editor in a browser, like out of myself, never, because
I need to have everything installed locally.
But now that I have to use it, I'm like super impressed.
Everything works smoothly and my experience is amazing.
So it made me think like,
well, is this the future of programming?
It's definitely nice to have everything on the same page
because it's like super easy to set up the same plugins,
the same configuration for the whole team.
People don't have to install anything.
So yeah, I'm wondering to see in which direction it will go. Yeah, it's super interesting. You know, I haven't done a lot
of it, but it's probably using that thing where they said, well, this is an Electron app. Let's
take the UI bit and just move the backend farther away and put that in a Docker container or
something. I'm guessing that's how it ran, right? It wasn't pure all JavaScript. Yeah, I think so.
But I was expecting some latency and nothing like that i mean my only concern is that the browser is interrupting some keyboard
shortcuts so whenever i want to close a tab in the vs code i'm closing the browser window because
that's the same combination that drives me crazy about about the browser editors it's like i'm
editing i'm editing i want to make this tab go away oh why is the whole thing gone again
yeah yeah i didn't know what to do about that.
Yeah, I know that that's really cool.
And, you know, it's really applicable for,
like, if you've got a class full of students
and they have Chromebooks
and they can't install Python and VS Code
on their Chromebook,
but they have Chrome, they're good.
They're good to go, right?
Or things like that, or an iPad that doesn't allow it.
So you really need possibilities there.
Exactly.
We have some custom libraries
and they are already available on those virtual machines
with VS Code.
So that's super easy to use.
Yeah, absolutely.
So Brian, I put together a joke for us, but we'll have to clean it up just a little bit
for the air.
Okay.
I'm not reading it.
I'll read it.
I'll read it.
I'll read it.
So I'll put it up here.
So it's a picture of some birds on a power line, right?
And they sort of often sit together in little groups.
Like, I don't know why they're hanging out on the power line.
They've got like incredible balance
and they're all just sitting there.
And there's one bird that's like outside of the power line.
It's like where the power line stops and goes down.
The bird's just sitting there floating in midair.
And the other birds are looking at you like,
how is he just, his wings aren't flapping.
How is he just sitting there in midair?
And they go, oh, he has wifi.
But then the bird comes crashing down and he goes, the falling bird
screams, oh, darn router. I love it. I thought it was good. It might not be totally safe for work,
but it's good. Yeah. There's a lot of routers that aren't properly tested with mortgage works
equipment. So yeah. Yeah. I mean, if you were floating suspended in midair by your wifi,
then it stops. That's a little risky.
That's good. Well, thanks, Sebastian, for stopping by and doing the show with us.
Thank you for having me.
Quite a lot of fun.
Yeah, it was fun.
Thanks for coming. Thanks, Brian. Thanks for being here.
Thank you.
Bye, everyone.
Thanks.