Okay, so now we're going to have lightning talks. We originally had a talk schedule for
this slide, but unfortunately the speaker could not get a visa to come here. So we basically
had to replace the talk and instead we're doing lightning talks, as you probably all know.
Who does know where lightning talk is? Everyone knows, actually, perfect. So lightning talks
are five minutes at most, and then we basically just pull the plug and then next we hear
comes. So we're going to have four talks now. First one is by Mia. Second one is Denny.
And then we have Voidysha, I think it's called. And then we have Tiago. And I would like
to ask all the lightning talk speakers to queue up here so that the transitions are faster.
Okay, so off you go. Hi, everyone. I'm Mia. This is my first for STEM and also for STEM
in Belgium. So I arrived here on Thursday evening. I went for a short walk and I took this
photo. As you could see, there are lots of beautiful churches here in Belgium and this photo
actually reminded me of my neighborhood. This is Prague Czech Republic and we also have lots
of wonderful churches around. And after the walk I went to grab a beer. Belgium is famous
for craft beer. So you can see lots of breweries with really great beer around. And if
beer is your thing, I'm pretty sure that you would also enjoy visiting Prague Czech Republic
because we are one of the biggest producer of beer per capita in the world. We're also the
biggest consumer of beer per capita in the world. I'm not sure if that's a good or bad thing
but beer is your thing. I'm pretty sure that you would like it. Walking down the street, you
could also notice how many pink sculptures are here. So I saw a ping boy, I saw a ping girl. And I also
saw a ping dog. And in Czech Republic we have them too. So there is a sculpture of a two-man
ping on the country. And the last thing we have common this year is that in Brussels there is
this great conference where people from all over Europe and beyond gather to share their knowledge
and spark new ideas. And it happens that in Czech Republic there is a big conference coming this
year as well. Europartum 25, it is a week of all things Python. There will be two days of
tutorials, three days of talks and two days of sprints, except of official events. We also have
social events and we have open spaces to spark new ideas. You can expect around 1500 participants
it will last for seven days and we will have over 200 speakers. And if you would like to be one
of those speakers as well, it happens that we have open calls for proposals but it closes to more
of so hurry up. So I'd like to invite you to give a proposal if you have anything that is
worth sharing, it can be about Python, it can be about related technologies, it can be about community,
anything, just send your proposal over and you will see. Except that we also have open call
for reviewers. So if you would like to help shape the program, you can scan the QR code above
or you can go to this URL. So you can leave your feedback on our proposals. And the last thing
is we also have a short story with three questions. What would you like to see at Europartum this year?
So if whether you have already been to Europartum or not, you will have a chance to
influence how Europartum 25 will look this year. So that's all for me and I hope to see you all
in Prague. Thank you. Excellent. So you have two minutes left. In case you want to do something else.
No? Okay. Then then he is next.
Okay. Let's go. Hi everyone. I will talk about Django version. So how to version control
your Django models. And to make an example, I will talk about how to make pizza.
And first, you need to start using the floor or a floor. And then you can add extra virgin oil.
You add a little bit of tomato sauce. And then you need to pick toppings. And of course you may
do mistakes. For example, adding pineapple on your pizza. And what if you want to roll back your
mistakes and add proper toppings? Well, you can use Django version. And in Django version,
you can use it like an extension for your Django application to provide version control for your
model instances. It allows you to roll back to any point in the model instance A3 to recover the
related model instances. And everything with a simple admin integration. To install it, you can
install Django version, add version to your installed apps and migrate your database.
Then you extend your admin from version admin and create your initial revisions.
So if you go to your admin page, you can see this recovered related contacts icons,
for example, in your admin page. And you can see a list of deleted records.
Same in your detailed page, you can view the history of all your changes in the specific records.
You can also use this in a programmatic way, registering your models. And you can even say
which fields to include or exclude from your revisions from your history. And then you can get all
versions and reverts to a specific version. So for example, then you can update your pizza using
proper toppings and bake your pizza. But what about Django or Spraymark? Well, I wrote an
extension for this. So you just need to install Django version or Spraymark and add
her version mid-erware to your mid-erware in settings. And then, of course, you need to register your
model using a version. And if you extend the history model, you set, then you can add a lot of
useful points in your Django APIs. So you have an historian point to list all the version histories.
And also to see a specific record, a specific region. You can see all the deleted records.
And also, you can revert to a specific version of a single object. You can use mixing. So if you
just want to see the history and version, you can use the history mixing, delete the mixing or
revert mixing, if you want to. Everything. And that's it. Thank you very much.
Thank you. You've been as you're really fast in these lightning talks. So we can have more
lightning talks. If someone wants to do another lightning talk, then please queue up there. And
then we just continue until the time is up. So next is Bodhisattva.
What can we plug in here? This is HGMI.
Okay, can you hear me? Thank you again. So welcome. I'm Bodhi. This is my
second time at Bodhisattva. First time I'm doing a talk. What I'm going to share is some nice
small things about the personal Python project I have. What the personal project is about,
it's basically a grab bag of random small utilities. It's probably nothing that you would find useful.
But some of the ideas about how I implemented this project may be useful for you either in your
personal life or at work. So I'm going to share those. Basically there's a small backup script
that I used to wrap board for doing personal backups as a small static website generator because
who doesn't have one personal helper functions for calling sub-processes because I shell out to a lot
of utilities. Also in my Python programs, refactoring all of these experiments on how to package
Python projects in an efficient way. So a lot of random small stuff, which is useful for me,
some of the ideas might be also useful for you. The way the project is set up is that there is a
one root main project that is wrapping all of the other things and I'm going to share how this
looks like. If you go on GitHub, you can see the project top level here. There's a root
pipeline project, it should be very familiar to all of you. It's quite standard-based. I currently
use UV so I use UV lock file for configuring and defining all of the dependencies.
The project set up is very simple. So this is one of the nice things I like is that all of the
system level dependencies that you need to install before you can get started with my project
is Python 3. That's all. You can bootstrap from Python 3 because even though I use UV,
I use the, I guess, unofficial way of paper installing UV inside the virtual end that I create
next to the project folder. So I create the VM first. I activate that. I bootstrap UV using
pip install. Then I use UV sink to install all of the other dependencies in the UV lock file. If I
clone from scratch and random directory, it looks like this. This is the Git clone. This is great
in the VM, activate the VM, install UV, then use UV sink to install everything else. So getting started
is very nice. The root level pipeline project top all defines all of my development dependencies.
It's very standard based, for example, I did it like poetry because of this because it uses a lot of
tool dot poetry that's something. So it's not really portable to other package managers,
but with UV or with PVM, it's a little bit better. I will create one VM for all of my projects,
because I don't like switching between a lot of different virtual environments. And then I have a lot
of subjects in my package folder, so package, sub project by project Tomo that defines all of
dependencies and configurations for all of the real stuff that I care about. That those are
all completely independent. They are in the sub folder. They don't know about any of the other
sub folders I have in the Git repo. They don't even know that I'm using UV to manage everything.
So it's quite standard based. This is the root pipeline project Tomo. It just defines the name,
description, development dependencies. There's the dependency groups for all of my
real sub projects. I use UV and UV sources and workspaces to include all of the sub projects
from the neighboring sub folders. Here's how that's done. I used rough for linting. I could put
any common configuration here in this root pipeline project Tomo. And here's one of the sub
projects. It's a PKG slash BODCLI slash by project Tomo. It defines my command line interface
sub project. If you see a by project Tomo before it's quite standard. Nothing interesting.
It has an entry point for my main function. The main function for the CLI. That's another very nice
small thing. So I have my own custom CLI name as from up from myself for doing stuff that I care about.
I do it for my own development stuff. So this is kind of what I use instead of make or just
or whatever. For example, package the Python libraries that I have within this project or create
the documentation. Here's how it looks like. It's a simple main function. This is in the CLI sub
package. I use this as a 160 line implementation of a CLI. But this doesn't complain all of the CLI
functions that I have. I have factored some of that out using my plugins package. All of the
package code is this 50 lines. I probably could have used plug-ee for this. But what I really needed
was basically just this function from the Python standard library import lib entry point.
So that when I create another sub package, I can create a hook, which creates a CLI sub command.
So for example, when I'm working. I think we need to shut you down now.
Okay. Thank you very much. It's very interesting. So give me a video class.
So next is Thiago?
If it is. Is it working? I'm not sure.
I moved the mouse to the side.
Nope. Oh, I do have a. Yeah, I do have a.
Did you just shoot? Yeah, this was okay.
There you go. Can you can you hold this? Okay, okay. Is it registered?
So hello everyone. My name is Thiago. I came from Brazil, but I'm currently living
a very near here in the Netherlands. And I'm here to talk about actually I like to give a brief
explanation of how to expose your Django application using GraphQL. It's rather a GraphQL.
I am one of the Strawberry maintainers. So if you have any questions after this, feel free to
reach me out. So why GraphQL? GraphQL is basically a library that allows you to
allows your clients to request specific data and get predictable results.
No overfetching under fetching or even like not knowing what type you are going to get.
I like to show this image every time. Like if I went to make an API to request a burger.
If I don't want to request some of the stuff that comes from the burger like I don't want
tomatoes because I don't like tomatoes for some reason. I don't need to request those. And that's
like a base comparison with rest. So let's keep it simple because I only have five minutes.
So in here, we have for example in our model. We have a user. We have the mayo. The mayo has a
primary key to the user. Of course. And we want to expose it like this. This is a GraphQL
always schema, a basic one. We have the root query here in the type query. We can see that we can
request me. It's going to be myself. The user that is lucky. Logging. We can retrieve a user given
a primary key or even list users and there is a pagination in there. Of course, like if we are
returning a user in here, we'd have to type it as well. We do have the user type in there.
With attributes and the user has a list of mayo. So here is the type of the email. So how
to translate that to Python? This is, I just just said this. I decided to do this like a couple
of hours ago, so I'm sorry about this. So in here, for example, as I showed you, we had the
user type, the email type. So we can easily write this as a strawberry type. It's the syntax
is very similar to the data classes. So we can just write just as we would write a data class,
but using strawberry dot type as the decorator for the class. For the Django integration itself,
we can basically, instead of using a strawberry dot type, we can use a strawberry Django dot type
and pass the model. And that allows us to use a one-mange connotator notation, alto, which you
basically introspect the Django model and automatically type it as first. So for example,
to define the BigQuery, I can just go there and define a strawberry field that when it got called,
I will return info.context.user, which is like their Django request itself. For the user itself,
just do user.objects.get and I can get it in the same for users. In this case, just returning the
user model, it's going to get translated to the user that we just type it. In the end, we're
going to get something very similar to this. I removed the implementation for the math, because
it will not fit in there. So let's now query it. So now I need you to believe that this is
exposed it. I have not showed you how to expose this, but like we don't have that time for that.
But if we want to say now a query to get a user, we just want to request the name, the emails,
inside the emails, the email itself, if it's a primary, email or not, we can query it and we should
get something like this. They made the user 1, 2, 3, it's myself. I'm not going to expose my email
here, but there you go. And that's it. If you want to know more about strawberry, there are some
resources to free to join our square channel. We are very welcoming to people in the community.
And thank you very much for this. I appreciate it.
Thank you. Thank you very much.
OK. OK. All right. Hello. Yeah, I'm here to talk about another Python event this year.
We don't have anything missing around the CD or dogs or people. But we have an amazing event with
more than 1,000 people and more than 100 tools and workshop in Bologna this year. So I'm going
to present you Python italias going to be from the 20 hate to the 31st of May.
Yeah, this year it's the first year after basically 20 years that we are moving from Florence to
Bologna because we're having a bigger venue for demand. I'd like to, I mean, if you're interested,
we are now selling tickets, CFP, unfortunately, is already closed. But we are working on the program.
We're going to release it by the end of the month. So yeah, this is it. If you want to follow
us or check it out on the website about prices and events and all the stuff about Python italias,
this is it. Thank you. Thank you.
All right. So the next speaker. Hello, everyone. How new book here is contributing to Python
projects in any way, code, documentation, whatever. How many of you skip your hand up?
It's spending at least five hours per month doing that. Many hands. Now, keep it there. How many of
you are a Python contributor member? PSF contributor member. See, this happened all the time.
You are entitled to be a PSF contributor member. If you're spent at least five hours,
so I really encourage you to go to the Python.org website, PSF, and then you can find information
there about the memberships and how to become a member. If you don't know what, what is the PSF
this guy talking? The Python software foundation is a nonprofit behind the Python language,
which is protecting the language, and of course trying to bring it to many other places as well.
So besides that, I just wanted to invite you to do that and also in case you want to
donate to the nonprofit, maybe yourself, but through your companies and stuff, we are always looking
for responsive. And if you have questions or if you're approached me, I have some very limited
editions shiny Python stickers. So if you want to find me around, just ask me for one. I will
be glad that you'll give you one in case you are contributing to projects or you want to do it.
That's it. Thank you very much. Thank you.
So I think this is it in terms of lightening talks, so we are going to continue with regular schedule
in a few minutes.