Learn Python with Talk Python's 270 hours of courses

#316: Flask 2.0 Transcript

Recorded on Monday, May 10, 2021.

00:00 Flask is one of the most popular Python web frameworks, and they have huge news to share

00:04 with us. Flask 2.0 just released after a ton of work, and it's as big a deal as the version

00:10 number suggests. Async changes are coming, Python 3.5 and below, including Python 2 support has been

00:17 dropped, and much, much more. Join me as I discuss Flask 2.0 with David Lord and Philip Jones.

00:23 This is Talk Python to Me, episode 316, recorded May 10th, 2021.

00:28 Welcome to Talk Python to Me, a weekly podcast on Python, the language, the libraries, the ecosystem,

00:46 and the personalities. This is your host, Michael Kennedy. Follow me on Twitter, where I'm @mkennedy,

00:51 and keep up with the show and listen to past episodes at talkpython.fm, and follow the show on Twitter via at Talk Python.

00:58 This episode is brought to you by us over at Talk Python Training. If you want to learn Flask,

01:04 we built a fantastic course called Building Data-Driven Web Apps with Flask and SQLAlchemy.

01:09 In this course, we built a PyPI.org clone from scratch using Flask and SQLAlchemy. You'll

01:15 learn many of the major ingredients needed to build most web apps. If this sounds amazing,

01:19 just visit talkpython.fm/Flask or email us at sales at talkpython.fm.

01:25 David, Phil, welcome back both of you to Talk Python to Me.

01:29 Hello. Hello. Thank you.

01:30 Yeah, it's great to have you back. David, I've had you on to talk about Flask, and Phil,

01:35 I've had you on to talk about derivatives of Flask, I suppose, about Quart, your project. And

01:41 they're both kind of approaching the same type of thing and then sort of zeroing in. So now we have

01:46 you here together, I suppose, working on Flask 2.0, right?

01:50 It's all merging into one. Not really. Just our efforts. Still separate libraries.

01:56 Yeah, but it's really cool to see you working closely together rather than just two disjoint

02:01 things, right? I think that gives a lot of credibility, especially to Quart, right? Because

02:04 Quart was kind of this experimental thing. And now it's, if not exact, is it a Palette's project

02:08 officially or is it just working more closely?

02:10 It's working more closely. And in addition, it uses VerkZeg now, which it never used before. So

02:15 it's been quite a lot of work in that project to make that possible.

02:19 Yeah, that's really cool. And VerkZeg is like one of these foundational bits of Flask.

02:23 That's what we'll get into, I'm sure.

02:24 Yeah. So the idea is because Quart was supposed to be API compatible with Flask, we want to get it

02:31 using as much of what Flask is using as possible. A long-term plan is to get it using even more

02:37 works in VerkZeg.

02:38 Yeah, yeah. Super cool. Maybe some, it's dangerous as well. Get in there. Who knows?

02:42 It's risky, but you guys can make it happen. All right. Now, before we jump into the main topic,

02:47 Flask 2.0, you both have been on the show before. Often I ask people how they got in programming

02:52 in Python or whatnot. You've both answered that question previously. People can go back and hear

02:56 it if they want. So how much is it catch up? What have you been up to since you've been on the show

03:00 last? Bill, you want to go first?

03:02 Sure. I think in open source sense, it's been, yeah, working a lot on Quart and working more.

03:09 At the time, I don't think I was really helping with the Palette's project. So I've been helping with

03:12 them since. And yeah, just kind of developing those two and doing a lot of work trying to get,

03:19 well, the async support that's now coming to Flask, which is quite exciting. On a kind of personal note.

03:24 Yeah, very exciting. Yeah.

03:26 Yeah, on a personal note, I work in London. So I've just been, I've actually worked for a few

03:31 companies, tried my own startup. It didn't work, sadly. But yeah, working in London now. So that's good.

03:36 Nice. I love London. That's a fantastic town. I haven't been there in a year and a half,

03:40 oddly. I don't know why. And David, how about yourself? Where have you been up to?

03:44 So I'm trying to remember when we did our podcast last, but it must have been like three years ago.

03:49 That's been a while.

03:50 So yeah, after that, I've just been working down the backlog of all the issues on Flask and

03:57 palettes and all that. And now we're finally at the point where I'm confident about releasing

04:01 all this stuff. So yeah, it's just been more and more open source work. And then still working for

04:08 the same company I've been working for for 10 years now. So that hasn't changed at all.

04:12 Yeah, that's cool. And I suspect they're pretty supportive of Flask.

04:15 Oh, yeah, we get to use it internally. I actually introduced Python and Flask to the whole company

04:20 way back in the day now.

04:21 Yeah. I mean, how much of an advantage is that to have somebody like you?

04:24 Yeah.

04:24 We're so familiar with everything, right?

04:26 Yeah. When we're bidding for contracts and stuff, they definitely get to use that as like,

04:31 hey, we've got one of the maintainers of the libraries we want to use. What do you bring to

04:35 this table?

04:35 Yeah, exactly. What's the advantage you have? Well, have you met David? No, that's fantastic.

04:43 That's fantastic. And check this out. You were back on episode 177 and the title was Flask

04:48 goes 1.0.

04:49 Oh my gosh.

04:49 I feel like. Yeah, yeah. This is September 15th, 2018. So it's been a while. But also,

04:55 it's time to have you back because now you guys have incremented the big number in the version.

05:00 Well, not quite. Almost.

05:01 One more day.

05:02 Is it one more day?

05:03 Yeah, it's tomorrow.

05:04 Okay. So for people listening on your podcast player, that's like a week ago.

05:09 Oh, wow.

05:10 People on the live stream, one more day. Fantastic. Super cool. So I see some really interesting

05:14 questions from people who are watching the live stream, but let's dive into a little bit of

05:18 background stuff. And then I think we'll go from there. So I kind of wanted to start with the

05:23 larger landscape of the web. And maybe also you could tell us about, I just threw that out there

05:29 as if people would know the Pallets project. We talked about it a little bit with both of you.

05:33 David, give us an overview of what the Pallets project is because we have Flask and we have

05:39 Quart and then we have these other libraries as well. What's the relationship of all these things?

05:43 I know Quart is its own thing, but it uses like Brickzoic, for example.

05:46 Yeah. Well, Pallets is the organization, like just an open source organization, not an actual

05:51 company or anything that maintains Flask and the libraries that Flask uses. And so that's Flask,

05:58 Ferkzoic, Jinja, Click, It's Dangerous and Markup Safe. And it was started, all these libraries used

06:04 to be maintained by the original author, Armin, and his other group, Poku. And eventually they kind of

06:11 grew larger than that. And the original team kind of grew to do other things. And so he formed Pallets.

06:18 And that's about when I joined and started maintaining everything. Although recently I've come to the

06:23 understanding that as much as I push the name Pallets, I will never have as much name recognition

06:29 as Flask. And so you can also refer to things as Flask and I will know what you're talking about.

06:33 Yeah, no doubt. Like the general Flask obviously is made up of the foundational bits as well.

06:38 Yeah. Yeah. And so Pallets for a very long time was just the GitHub organization that these projects

06:45 repos were under. And I've been working over time to expand that into an actual open source organization,

06:52 kind of not nowhere near this yet, but inspired by like how Django software foundation works and those

06:58 sorts of things where they do things besides just develop. So we've been working on growing the

07:03 community, getting more maintainers involved, running FlaskCon last July, I think. And another

07:09 one is coming up, I think, in November is this tentative schedule.

07:13 Nice. And this is obviously, I would guess, online at this point?

07:16 Yeah, it'll be online still. It was online last time also, and it worked out pretty well. You can go

07:20 find all the videos on PyVideo. They're up there.

07:23 Yeah. Fantastic. Do you have sprints or anything like that around it, or is it just presentations?

07:27 We didn't do sprints last time because it was just our first time running a conference. We'll see what

07:32 happens this year. No concrete plans yet.

07:34 Yeah. Fantastic. All right. I kind of wanted to start off this conversation with a wider view,

07:40 looking at the Python web space. So I put up here for us to look at the Python developer survey from

07:47 the PSF and JetBrains for 2020. Obviously, it's 2021. But the results for that was the last survey

07:53 that have come out. And over there, we've got the web frameworks being used. And these things are never

07:59 comprehensive. There's 6% of other, whatever that means. But we have Flask now clearly being the most

08:06 popular one. So first of all, congratulations on that. That's awesome. I wonder if Quart was folded

08:11 into Flask or if it went into the other, you know, in a person's mind when they clicked the button,

08:16 which did they click, you know?

08:17 I imagine it's probably in the other and a small percentage. Very small.

08:20 Yeah. Nice. Okay. Well, so this is really neat. I guess the big interesting thing here as well,

08:26 beyond, I think it was you and Django, at least in this previous survey in 2019, were just tied,

08:33 basically. So now it's, you had talked about how there's a lot of growth and a lot of momentum.

08:37 And I think it's even more than what you see here on the screen. Like I think a lot of the APIs that

08:42 Flask embraces in the way of doing web programming has been adopted by many of the other new frameworks

08:48 as well. So for example, we have FastAPI making a jump up to 12% here, which is probably the biggest

08:54 difference from the year before as well. What do you think about this picture here? And then like,

08:59 you know, what do you think about just the Python web space in 2021, both of you?

09:04 FastAPI is definitely gaining ground. Flask, I'm continually surprised that so many people use

09:09 Flask. Never. It's hard to wrap your head around like that many people. I was just looking at the

09:13 downloads this morning and it was 14 million in the last 30 days.

09:16 In the last 30 days. That's so insane.

09:19 That's just Flask. Like if you look at like Jinja, because Jinja is used by

09:22 things besides Flask, like Ansible, we're like the 20 somethings.

09:27 Very cool. And you can use Jinja just on its own for super interesting things as well. Like

09:31 I recently did a project where I needed to generate a PDF that was like out of, you know,

09:35 here's data in a dictionary and I need to make a PDF that looks formatted. And I just use Jinja

09:40 and a Jinja template to generate the HTML, then feed it off to a PDF library that made it into

09:45 PDF, right? There's all sorts of little edge cases like that.

09:48 And same with Click. I mean, people use Click to make actual command line applications,

09:51 not just to provide a little CLI for Flask. So yeah, when you look at this, like you,

09:56 like you realize that like, oh, they're also using like all these other libraries,

09:59 but I never really like think about the numbers. I guess every now and then I remember Flask having

10:04 more stars than Django on GitHub, but that was because Django joined GitHub late and they've

10:08 surpassed us now, but that's about the only joke metric I follow really. But yeah, I've seen a lot

10:14 of interest in FastAPI and I think it's a, it's nice to just see that like none of nothing's

10:20 stagnating, you know, like everything, like there's, there's new ideas out there. People are developed,

10:24 like there's stable libraries that continue to develop like us and we were still adding new features.

10:28 And then there's like completely new ideas or new formulations of libraries.

10:33 Yeah. I feel like we're in a bit of a Cambrian sort of thousand flowers blooming type of time. And

10:38 many of them won't survive that, but there's a lot of fresh ideas out there and it's pretty exciting.

10:42 Yeah. Like having a healthy ecosystem, having choice that you can choose whether a certain

10:49 framework is more appropriate for, you know, the project you're starting or working on,

10:53 I think is really powerful for like users and for maintainers.

10:56 Yeah. And you can borrow ideas too. Like, Oh, I see the way FastAPI is doing types,

10:59 like mean this, maybe that makes sense to like allow that as an option somewhere else,

11:04 you know, who knows, right?

11:04 Well, one thing I quite like to take from this list is Falcon has a really quite exciting router.

11:10 And I think it might be a little too, too much for Verksug perhaps, but I've been playing around with

11:17 taking the ideas from Falcon and bringing it to Verksug. So what makes it exciting is it's a very fast

11:21 matching system and yeah, should outperform the Verksug router if we can get it in by a good fraction.

11:29 So that'd be exciting.

11:30 Yeah. There's a lot of interplay here that I think is pretty neat. And while we're on this sort of broad

11:33 topic, Rohit asks out in the live stream, you know, what are the advantages of using Flask over Django?

11:39 Maybe that pairs them up a little bit too tight, but you know, looking at this list,

11:43 these are the ones that probably the trade-offs people are thinking about.

11:46 Yeah. This gets harder for me to answer over time because I haven't used Django in a long time,

11:50 but it's hard to compare them one to one. It's like apples and oranges, right?

11:53 Like I said a couple of minutes ago, like you're choosing the project that's most appropriate or the

11:58 framework that's more appropriate for your project and the way you want to work. So it's not necessarily

12:02 that you're going to be losing out or getting any given feature by choosing one or the other. It's

12:08 about how they feel when you're working on them. You know, like sometimes Django makes more sense to

12:14 people or FastAPI makes more sense or, and then like they also have different goals, right? Like Flask is

12:19 deliberately just the web framework and wrapping some other libraries around it. But its goal is that

12:27 if you want other features, somebody develops an extension that is specific to that and you add

12:34 that on. And I mean, Django and I don't know about FastAPI yet, but like Django has the same idea. It's

12:38 just how many batteries they decide to include is different. Yeah. Yeah. Phil, you want to take a

12:43 shot at this before I give my thoughts as well, maybe? Yeah. I think specifically Flask and Django,

12:48 I always thought it came down to a kind of a choice about how to do things like Flask doesn't really

12:53 give you an answer and you can go and choose from the extensions, whereas Django does. And yeah, I think

12:58 it's like David said, a bit of what your preference is really, what you prefer. Yeah. I mean, Django is

13:03 making huge strides in like async also, and we're adapting to that too, but they all have different

13:09 solutions to the same thing and approaching it from different directions. Yeah, definitely. There's a lot of

13:13 interesting stuff happening in Django around this as well. So the way I see it is, you know, Flask,

13:18 it's like an empty canvas and it's got just a few really nice little building blocks and then you can

13:23 build what you want, right? You want to use Postgres and SQLAlchemy? Great. That's totally easy. You

13:27 want to use MongoDB and MongoEngine? Equally easy. Go have fun, right? Like you, you can pick just the

13:33 little bits that you really like. You don't have any other bits to worry about and then you're good to go,

13:37 right? Django, it's like, well, if you want to break from the Django ORM, probably you can do it,

13:42 but it's, there's a little bit of a mismatch there. You kind of got to work around it. Its advantages

13:48 kind of become less good, right? Like it's admin tools might not work as well if you try to say

13:52 switch to Mongo or something along those lines. And if what you want is like, I'm not really sure what

13:58 I'm doing to build this website. And I just want some guidance, like just show me the main way and I'll

14:03 just do that. I don't, I just would like to go along for the flow. I think Django is fantastic for that.

14:08 It gives you like really good prebuilt tools, like the admin stuff and whatnot. But if you really care

14:13 very much about which little piece you pick and you want to put them together just so, I feel like you're

14:17 better off with a micro framework of some sort like Flask. That's my, my view. And I know some people

14:22 love one side and hate the other and vice versa. So it's, you know, it's also a personal challenge or a

14:27 personal thing you got to work out for. Where, where do you fit on that spectrum?

14:31 Yeah. I mean, I personally started with Django. Flask was just being started when I was starting

14:36 to learn Python and web frameworks. And then I eventually ran into something where I wanted to

14:42 do things that Django wasn't designed to do, obviously. And I started running into a bunch

14:49 of stuff. And so I switched to Flask.

14:50 Yeah, that's cool. I know if you come from a, an ecosystem where there's like clearly one choice

14:56 for a lot of things, you know, if you come from Ruby, you got, you got rails and the Ruby ORM.

15:01 I'm from Microsoft, you got ASP.NET in a framework, like you don't have decisions. You just do the

15:07 thing. And then eventually you build your app, right? You come to Python, there's like, you know,

15:12 20 different choices at each level. And you're like, this is like the paradox of choice. This,

15:15 even though it's in some ways, it's great. In other ways, you're like, I have no idea what to do.

15:19 And so I think that can be a challenge for people as well. Yeah. But also an advantage

15:23 once you get into it. I think your best bet, if you're asking the question, should I use Django

15:27 or Flask is to just pick one and learn enough, you know, about that framework. And I think you will

15:34 be better equipped to answer that question for your project next time you have to ask it.

15:38 Yeah. Yeah.

15:39 It doesn't really matter what you start with.

15:40 All right. Before we get into a more specific, so sort of a general Flask question as well.

15:46 Ivan says, since Flask started as an April Fool's joke, does the core team,

15:50 David and crew, have any traditions around April Fool's? I haven't thought about that.

15:55 You know, every time somebody brings up that it was made on April Fool's,

15:58 I remember that it was made on April Fool's. I always forget that.

16:01 So I'm guessing not too many ones. Okay.

16:06 We don't have like a birthday party or anything or celebration. Maybe we should.

16:10 We'll bring it up to the community team.

16:12 There you go. There you go.

16:13 I think you put out a blog for last year, 10 years, didn't you? That was quite a good celebration,

16:18 but I think that was about it.

16:19 Oh, maybe it. Yeah. It's been 10 years for a lot of libraries at this point.

16:22 Yeah. Very cool. So let's talk Flask 2.0. You know, it's been a couple of years. It went to 1.0.

16:28 It was on the zero-ver train like so many projects were before then, right? That doesn't really mean

16:33 that it was such a huge transition, but there's a lot of stuff changing, not necessarily in a breaking

16:38 way, but a lot of new things in Flask 2.0. Give us the exciting news.

16:43 Well, the biggest one is probably async. I'll let Phil talk about that.

16:46 Yeah. There's like a async for Flask directly and then like maybe tighter integration with

16:53 Quart type of next level async, right?

16:55 Yeah, exactly. So with Flask 2, you'll be able to write async root handlers, depending on what you like

17:01 to call them, before and after request handlers and teardown functions. So it won't require any

17:07 special effort other than installing Flask with the extra support, but then you can just write async

17:12 and await and carry on with your current setup. You don't have to change anything else.

17:16 Yeah. That's super neat. And you actually gave a talk May 1st or something, 10 days ago.

17:21 What was it called? It was, why isn't Flask async?

17:25 And obviously that's like leading into where things are going. You want to tell people a little

17:30 bit about some of the ideas there? You talked about the history, obviously Flask being a

17:34 WSGI or WSGI application. Those are all naturally having a hard time moving to async because

17:42 the server itself needs to know. But then you also talked about some of the things that are

17:47 happening to allow some async stuff to run directly without any server changes. And then also moving

17:55 to an ASGI server. Yeah. So what's the story there?

17:58 So, yeah. So obviously Flask started as a Whisky framework. I think it was probably Whisky from

18:04 the start, right? So yeah, I know. Yeah. So I couldn't quite remember when Whisky was introduced.

18:09 So yeah. And obviously before Async await is introduced.

18:12 Yeah. We have all these different servers and I don't want to have just this framework run on

18:16 that server. So Whisky is born, right? But born in a world where async was less common.

18:20 Yes. But what it has supported the whole time, and I think what's good to point out is Flask has

18:26 been async the entire time just using greenlets. And a lot of people use that very effectively. I think

18:32 it's absolutely fine. And that for us, I think was one of the key things to bear in mind that

18:37 Flask works async. And if we introduce async await, we can't be breaking that at the same time.

18:41 So that was one of the big constraints really. And then, so for the one side, it's keeping support

18:48 with those existing async solutions. And the other is introducing the async await keywords,

18:52 which I think everyone has heard of the color problem and the virality associated with that,

18:57 which makes it actually really hard to get a little bit deep into the call stack, if you will,

19:02 async without really having to change the whole call stack to async in one sweep.

19:06 Yeah. The challenge, maybe I'll try to give a little bit of background just for people listening

19:10 is if I've got some low level data access library or service access library for like using HTTPX

19:17 or something, in order to await the thing at the bottom, that has to be an async method.

19:21 The next level up in order to call that method, it's got to be async. Then you got to await it.

19:25 So it's method's got to be async. And it just, it goes up the entire call stack in a lot of cases,

19:31 right? Yeah. So what it came down to and what we, what we did was follow Django,

19:35 what Django have already done really. And what they, they figured out is that you can run the

19:40 async event loop in one thread and the greenlet based one or whatever you were doing previously

19:46 in the main thread. And then everything coexists nicely. You just need these wrappers to,

19:51 to move things from one thread to another. And that library, if you're interested, is called

19:56 ASCII ref, but using that allows us to have this async code in the, in the view handler,

20:01 but keep flash synchronous in the rest and keep support with, with greenlet, which is really

20:06 nice. Yeah, that's really nice. And in production in a lot of the servers, it has threaded modes

20:12 already that if like you're awaiting something and then that something talks to a network, like a

20:16 database call or a web service call or something, it's going to release the GIL anyway. And the other

20:22 threads can run. So that can probably push out pretty far just on its own, right?

20:26 Yeah. It's, I think it's been very effective to a lot of companies. I know companies that use it.

20:31 I think it's been really nice. So that's what we've, we've got to, and I think you were talking about

20:35 where can we go? Can we go fully async and ASCII with Flask? And, this is possibly more of my

20:42 personal opinion, right? I'm not sure it is possible to go there with Flask. Cause I think if you do so,

20:46 you end up breaking extension support because it's quite common for extensions to extend the Flask

20:52 Clask and change the methods, but of course they won't be async. So how are they going to deal with

20:57 that? Yeah. There's the compatibility problem. And then there's also just the, the problem of having

21:02 mark everything as async await, if you mark one thing and we might discover, I'm a little more

21:08 optimistic than Phil, but I'm also not as experienced with it, but I would like it to be possible. Like

21:13 at some point for us, you know, we're focusing on like making a Verixoy sans IO. So it doesn't

21:19 require blocking IO operations when you make requests and stuff so that you can use it in ASGI

21:25 situations. And that's going to be a slow process. We're not like a hundred percent done with it or

21:30 anything like that. But my hope is that as we make Verixoy completely like IO agnostic, we might

21:38 discover some ways to adopt Flask. Yeah. But it's also not a hundred percent necessary because

21:44 cord exists also. That's an interesting point. Maybe there's a way to implement some of those

21:51 extension. So the problem is the extensions override certain functions that are part of the life cycle

21:56 of requests. And those are expected to be synchronous functions because they had been for all of time.

22:02 You can't just make those async and have those extensions still work. You know, at best,

22:06 they're going to be kicking out unstarted co-routines. You know, maybe it's probably worse

22:11 than that, but maybe, maybe that's what they do. I don't know. Something is not going to go super well,

22:16 but maybe you can create synchronous wrappers around the async stuff that can grab a, an event loop and run

22:23 it or something. I don't know. Like some, there could be some sort of an adaptation thing where just the

22:27 sync version maybe it's not quite as fast or something. I'm not sure as much experience you

22:32 guys have. I have a way less than that. So as a caveat, I was going to say, I think with Flask

22:38 too, I think this is, in my opinion, where you want to be because the motivation in my mind is you want

22:44 to use some async based library and there's, there's some exciting ones out there. So I can fully understand

22:49 that. And you can now in Flask and it will work, will work with your existing setups. I think the only

22:54 reason you could want to go fully async is, because you're only using async libraries perhaps,

23:00 or perhaps you might see a bit of performance improvement there, which isn't necessarily

23:05 guaranteed by the way for that though. I think there's court. So I kind of think all the users

23:10 motivations might be covered now, which I think is really exciting. That is very exciting. Yeah. And

23:15 our goal is just to get court and Flask as API compatible as possible. And they're already very,

23:20 very close, but you know, moving, very exciting that. And so like, ideally it should just be a

23:25 drop in like name replace for everything to keep working. Yeah. And you could probably pull it off

23:29 with just the right import statement, import court as Flask or something potentially almost.

23:35 Possibly. I don't know how Phil feels about that.

23:37 No, well, there's a, there's some monkey patching in court where you can tell everything else that

23:43 court is Flask. So you can use some of Flask extensions with court by allowing court to be there.

23:48 And it is Flask. It's just kind of, kind of fun.

23:50 Yeah. Yeah. That is quite, quite wild.

23:53 I did see a question. Will Flask break current extensions? No. Our goal was still compatibility

23:59 and stability. We are, we are making major releases and we are adding new features, but it shouldn't break,

24:05 shouldn't permanently break anything. You know, there might be some unforeseen incompatibility that

24:09 a library needs to update for, but it's not like they will suddenly have to rewrite their whole

24:13 thing async or something like that.

24:15 It's not, if it breaks it, it's not on purpose.

24:17 Yeah. That makes it sound bad too, but.

24:20 No, no. I mean, like your intention is to have it be compatible, right?

24:23 Yeah. Yeah. That's always the intention of these libraries. They're meant to be very stable.

24:28 And it's actually one of the things I've been working on as a maintainer, as I've been maintaining

24:34 these over the years, is when I do make releases or when I make changes, I try to make everything

24:40 show a deprecation warning first and then only remove it in the version after that. So I do

24:45 want to evolve things and refactor things or, you know, identify patterns that weren't great

24:51 or that don't, aren't needed anymore since we're dropping Python 2. I do want to evolve the libraries,

24:56 but I don't want to break anybody without warning them first. And so there's a ton of deprecation

25:02 warnings in all the libraries this time that you'll see if you're running tests.

25:05 That's cool. So speaking of that, yeah, I saw this really nice Flask 2.0 is coming. Please help us test

25:11 by Stetio. I don't know who this is. If you know, maybe you can give him a shout out.

25:15 Oh, that's me. Yeah.

25:16 Oh, is that you?

25:17 Okay.

25:17 Perfect. All right. Yeah. So from you, Phil, and he said from the changelog, one of the things coming,

25:23 well, first of all, one of the things coming is Python 3 plus, sorry, 3.6 plus only dropping 2 for

25:30 sure. And even 3.5. That's pretty interesting.

25:32 Well, 3.5 is end of life now. Yeah. Yeah. It seems so new in my mind, but it's clearly,

25:39 clearly not that new anymore.

25:40 When I first made the announcement of dropping Python 2, 3.5 wasn't going to go end of life

25:45 until like nine months later, but I decided to, I was going to drop 3.5 anyway. We won't usually,

25:50 usually we're going to, our plan is to try to wait for the actual official end of lives for Pythons

25:57 from now on, but 3.5 just, it was so much more convenient to drop it at the same time. And 3.6

26:02 is still supported, but the next versions after these will be 3.7 only because 3.6 will have gone

26:07 end of life probably by the time we make new releases. Right. Right. Okay. Very cool. And how

26:12 much the five versus six, was it just that 3.5 is going out or versus f-strings? We do use f-strings all

26:18 over the place now, but that wasn't the reason. I mean, since we were doing 3.6 plus, I decided to

26:23 like use f-strings in a lot of places. I don't remember what was inconvenient about 3.5, but there,

26:30 I mean, I do remember there was something, this was a year and a half ago now when I made this decision.

26:34 I think async was slightly different. I mean, look, if you're switching to two, it's a chance for a nice

26:40 break from some of these things, even if they've got a few months left. Exactly. Yeah. I was originally like,

26:44 originally 2.0 was just going to be like dropping Python 2 and making maybe a few minor changes. And

26:52 then I got anxiety about making releases and breaking everybody's stuff. And so I just kept

26:58 working on more and more stuff into 2.0 instead of releasing it. But because it's 2.0, that also kind

27:05 of gave me the opportunity to like identify more stuff that I wanted to deprecate than normal maybe,

27:10 or make more bigger features to add. Yeah. But it's a perfect time to do it with

27:14 such a big version number change. I want to pull out a few more things from now that I know it's

27:19 Phil's Reddit post here, which got 1.3, 1,300 upvotes. That's pretty awesome. Short form of decorators.

27:26 So instead of for routes or routes for you in London, instead of app.route, you know,

27:33 specifying get or post, you can just do app.get, app.post. That's easy, but nice.

27:37 Yeah. It's just a bit of a synthetic sugar really. It's a, yeah, should make it a little nicer.

27:43 Going back to the ecosystem, it's something the other frameworks will seem to adopt

27:48 Yeah. Yeah. Yeah. That's one of the big differences I've been seeing from the other

27:52 frameworks that they're very much like Flask, but they kind of put the verbs on the decorators a

27:57 little bit more. So why not take it back? Have you inspired them in the first place? Also,

28:01 you know, blueprints, man, blueprints are something I think do not get enough attention and love because

28:09 they're so nice for organizing your code into little bits and little categories of functionality

28:15 instead of, you know, trying to associate them all with the main app, the at app.

28:20 So there's some news around that for updates as well, right?

28:22 Yeah.

28:22 One of the oldest standing open issues, Phil decided to just like, oh, I can solve this. And he like

28:27 wrote something over a weekend, I think.

28:29 It felt like that.

28:30 Way to go, Phil. Now it's blueprints all the way down.

28:33 Well, I'll let Phil describe it.

28:35 Yeah. It's exactly like you can nest blueprints in blueprints. So I think the kind of code structure

28:42 is really helpful because now it doesn't have to be all in that one blueprint, right? You can split

28:46 over a few files and bring them in, which helps a lot. And there's other structures where maybe you

28:50 want to reuse some part of something in another blueprint. So you just bring in parts, but yeah,

28:55 you can just use that. And you can use the command register blueprint on a blueprint to register the

29:00 blueprint and carry on.

29:02 Yeah. You used to have to say app.registerblueprint and you would give it the blueprint and that would

29:06 help you build up the various pieces. But now you can nest them and they can be more hierarchical,

29:11 which is great.

29:12 Right. Before it was just one layer. You had the Flask app and then the blueprints. And so like each

29:17 blueprint could have a prefix, but people haven't actually asked for it for a while, but it's still

29:22 been an open issue and it doesn't seem unreasonable. People have wanted to like have prefixes for

29:28 prefixes. And so then you get nested blueprints and now it's possible.

29:31 Yeah. Awesome. Let me take a couple of the questions out of life.

29:33 Sure.

29:33 First, Doug Farrell out there. Hey, Doug says, Hey, I'm working on a book that uses Python

29:38 Flask as a primary example application. When might Flask 2.0 be released? And should I plan on updating

29:44 the book to use it? I'm guessing Doug didn't catch the very first opening bit because you said tomorrow.

29:49 Tomorrow. If you're interested in following Pallets news in general, there's at Pallets team on

29:55 Twitter and there's also palletsprojects.com slash blog, which has an RSS feed. And so we actually

30:00 have announced this already, but yeah, it's May 11th tomorrow.

30:04 Fantastic. And then John Sheehan says, you're right. We don't hear enough about blueprints.

30:09 I love blueprints. Yes, absolutely.

30:11 Right.

30:12 So I says, in our Talk Python Training web training course, which is a Flask covers,

30:17 it says Flask basically rebuild pypi.org with Flask. Is it used as a safe to use Flask 2.0? I think so.

30:23 Like David said, there shouldn't be any breaking changes, maybe deprecations. If you see them,

30:27 let me know. I can update that, but I think it should be fine. Right. Same reason that production

30:31 apps work. The, the like example apps should work.

30:34 This is the first time we've tried to do release candidates before we've made releases.

30:38 And so we actually have had release candidates up for about a month now for all the libraries

30:42 where you could test your existing code with the new versions. But I think in the future,

30:48 when we do this, we need to do a better job at advertising that. So something we'll get better

30:52 at over time, but yeah, cool. Wow. People listening now know. Then also I think interestingly related to

30:58 both the micro framework side of the story, but also the new features like, especially the async stuff,

31:04 Rohit asks, which will be the most compatible database to supporting framework for Flask.io on

31:10 one hand, like just do whatever you want. Right. But on the other, you've got Flask SQL

31:14 Alchemy as an extension. You've got the ability to use like tortoise ORM because of the async support.

31:21 Like there are new options, right? What do you think? Yeah. I mean, Flask makes no requirement.

31:25 It doesn't affect what database you use. Flask SQLAlchemy that will have a 3.0 release

31:31 similar to these soon-ish. I think I'm going to take a little break after this release first,

31:37 but it should continue to work. What's the, you know, SQLAlchemy 1.4 just released with the first async API and they're moving towards 2.0 as well

31:47 with a new API. What's the story around their new API and the SQLAlchemy async support with Flask SQLAlchemy?

31:55 Is there anything overlapping there? So Flask SQLAlchemy is compatible with 1.4 right now. I did make a

32:01 little bug fix release recently for that. 2.0 is just deprecating things. So, and nothing that Flask SQL

32:08 Alchemy uses is going away. So it'll work with SQLAlchemy 2.0 when that happens. In terms of the async

32:15 stuff, we might, Flask SQLAlchemy, like the extension might have to do something if we want to enable using

32:21 that pattern. But we might also not because it's using a pretty clever use of greenlets to enable

32:29 compatibility between sync and async code. And Flask's async support should support that out of the box,

32:36 or not out of the box, but it's possible to extend it to do that.

32:40 Yeah, super cool. All right. Another thing I saw in the release notes was that around Vexoig,

32:45 there's performance improvements coming in Flask and Vexoig. Want to just give people a little

32:51 insight into what's coming there?

32:52 Yeah. One of the things I think the one that got the most attention, got some interest on the Python

32:57 subreddit, was an improvement we did to the form parsing. So I think there's this issue that's about

33:03 five years old saying it was a bit slow, especially for large files. And as David mentioned earlier,

33:08 we were looking at moving that to be Sans.io. And in the work to do that, the original author of that

33:14 issue actually came back and said, Oh, if you do this, you'll make it a lot quicker as well. And when

33:18 we did that, he pointed out, we've made it about 10 to 15 times quicker than the previous form parser.

33:24 So yeah, so if you're being sent files to your Flask server, it should be a lot quicker.

33:29 Yeah. Form data in general is faster. And then if you're uploading large files, that's way,

33:35 faster than what it used to be. Oh, wow. Like multi-part form upload type of files.

33:40 Yeah. So if you were uploading even like hundreds of megabytes, it could be really slow in some cases.

33:45 And so now you can just upload gigabytes of ISOs if you want. It should work fine.

33:51 Nice. Just like streams in or something.

33:53 I mean, it'll still take as long as it takes to upload.

33:55 Yeah. It doesn't make it worse. I see. Cool.

34:00 But I don't know. I think I'm trying to think if there were any other performance improvements in

34:04 Varick Swag. I know a couple of releases ago, we made a pretty big one where to our URL building,

34:10 which made it like 10 times faster or something that's already released. So, but it has been

34:14 getting faster. Yeah. Okay.

34:15 We haven't measured it. I think the work taking out all the compatibility shims and just going pure Python 3 should be noticeable.

34:24 Yeah. Since we removed all the compatibility code for Python 2 stuff, like literally the .compat.py files are gone

34:32 and all the code that was calling that. There's still some more work to be done on that in terms of like

34:37 accepting both bytes and strings in a lot of places where it doesn't really make sense anymore.

34:40 So there's still some overhead, but there's a lot less compatibility overhead than there was before.

34:45 But yeah, it hasn't been measured, but I expect that to be noticeable because when Virk Swag and Flask first added support for Python 3,

34:53 you know, going the other direction. So it was Python 2 only, and then it became Python 3.

34:58 Some people stuck with like really old versions of Virk Swag and Flask because there was a noticeable performance degradation by adding all that compatibility code.

35:06 So now that it's gone, it should be better.

35:09 Yeah, fantastic. I know the NumPy people, they actually got a lot better. They shrunk their code a bunch by dropping 2.0 or Python 2, 2.7. And similar for you all?

35:21 Yeah, it's just, I mean, besides the performance improvements, it's just more maintainable now.

35:26 I pushed really hard to drop Python 2.0 even before it went end of life. I started thinking about how to do it because I never used Python 2.0 back then, and I still don't know.

35:36 So every time I had to fix something, I had to like, oh gosh, now I got to run the Python 2.0 version of the tests and figure out how to like make some weird compatibility shim, you know, between the two.

35:47 So it was a nightmare maintenance for like maintainers and contributors.

35:50 Yeah, I was going to say it's probably easier for contributors as well now to come in because they don't have to, you know, a lot of people these days, they don't know Python 2, right?

35:58 Right, exactly.

35:59 They don't want to come in and like learn, you know, something from 10 years ago so they can keep it compatible. They just want to add the new feature.

36:05 Yeah. If you somehow have like a Python 3.5 application still, you can stick with Flask 1.1. You'll still get your application working just fine. I mean, we're not going to be supporting it because we just don't have that capacity.

36:18 But the libraries are fairly stable, you know, like we almost never get bug reports asking us to backport something, for example.

36:26 You know, I use Dependabot like pretty much anybody who uses GitHub does, at least for security.

36:31 Right. I think people have become a lot more aware overall of that they should be pinning dependencies and how to do that and how to upgrade intentionally.

36:39 And so hopefully over time that, you know, less people will be surprised by updates and their applications will continue working with the versions they work with.

36:47 Right, exactly. And if you're worried about these changes, just pin it to 1.11 or whatever it is and just let it be until you're really ready.

36:54 But also you'll get notified of any security issues that you might need to jump in and fix, right?

36:59 So I know what I was going to say is I don't remember seeing any around Flask and Rixzoig almost ever.

37:05 So they're pretty stable, it seems.

37:07 It's pretty rare for there to be like critical bugs or security related bugs reported.

37:12 We get stuff every now and then, but we just make a point release.

37:15 Yeah. And Rohit asked previously about like, why would I use something like Flask over say something like Django?

37:20 I noticed security releases for Django more often. And I think it's because they just have so much more going on.

37:26 Like they have a whole admin section with forms and input and you guys just, if it's not there, it can't have a vulnerability in it.

37:33 There's a much larger attack surface. Yeah.

37:35 Yes, exactly.

37:36 But it's not that Django is less secure overall though. I mean, first of all, they're releasing all these security updates.

37:42 So they're staying secure, but I think they have a much larger team. And so they have the capacity to do these sorts of analysis that maybe we don't.

37:51 I'm not saying like, I think Flask is insecure, but it could be that, you know, they're just, they've just got more eyeballs on these things.

37:58 Fuck like noticing like, oh yeah, we shouldn't do this. We can make it safer or something like that.

38:05 Yeah. Yeah. And I just think the surface area is so much larger.

38:08 Yeah.

38:08 It's bound to happen.

38:10 Maybe someday we'll be in that position for Flask too.

38:12 Doug says, oh man, trying to get in Django, my new job, so much magic, too much magic happening there for me.

38:19 But he also has a question that I think maybe, you know, Phil, you spoke about in your presentation.

38:25 Like does this release change how you run in production?

38:29 Like Unicorn versus Micro Whiskey versus who knows what? Hypercorn.

38:34 The good thing to say is that, no, it doesn't change it at all. It still works the same and you can still use Unicorn

38:40 and use the async capabilities now in Flask. If you wish to use an ASCII server, you can as well. You need some middleware and adapter to do it.

38:49 And there's some examples in the Flask docs if you want to see which one we recommend.

38:53 So you can choose any server.

38:55 But yeah, very important for me to point out that you don't have to change anything. You can just carry on as before.

39:00 Yeah. So if you want, how would you categorize? You actually in your talk spoke about a spectrum of async capability.

39:06 On one hand, you have Flask with its decent async support, but not full AGSI server capabilities.

39:15 And then you've got Court, which can be 100% ASGI. And so you kind of thought of it as a spectrum, right?

39:20 Yeah. So my idea is that if your code base is mostly sync, as it may have started, then Flask is a great choice.

39:27 If you want to add a bit of async here and there, it's still a great choice.

39:30 It's only when perhaps you want to go fully async or you've mostly async with maybe a few sync pieces of code that you actually would choose Court.

39:39 But I think the really nice thing for the user is you can hopefully just go across that spectrum, eventually change the name, but then just continue.

39:46 And it's a pleasant experience is my hope.

39:49 Yeah. Awesome.

39:50 You should still be able to use the same WSGI servers, basically.

39:53 Like we've said a couple of times, like we're not breaking anything.

39:56 We're not changing how Flask works or anything like that.

39:59 So you still deploy it the same way.

40:01 And if you do want to use an ASGI framework or server for some reason, you can always use an adapter to serve a WSGI app over ASGI too.

40:09 You just don't get any of the benefits, really.

40:11 Yeah.

40:11 And Doug makes a good point out there that Flask for the Wind is still making G-Unicorn a good solution.

40:15 With G-Unicorn, you can change the worker type, right?

40:20 You can let it be the regular one, or you can say, I think it's dash K for the option.

40:24 Change the worker type to UVicorn workers, which would switch it to be an ASGI version.

40:31 So you don't even necessarily have to change anything, but like part of your command line for your startup of your G-Unicorn.

40:37 And that could be the total change you have to do.

40:40 And going back to a point that Phil made earlier, in the same way, you could change the worker to use like G-Event or something and already have an ASYNC Flask, just, you know, with an older version of ASYNC code or an older implementation.

40:55 Yeah. And Joe out there says, I had to look at the new ASYNC I-O features, but it seems from the docs that it's early days and maybe later versions will get more ASYNC I-O adoptions.

41:06 I guess that's a good direction to have a quick chat about.

41:09 So what's the, so this is 2.0.

41:11 Is this where you see it sort of landing or do you see this as a progression?

41:15 I think it's fair to say it's a, it's a progression.

41:17 Definitely.

41:18 I mean, the ideal outcome in the end would be to somehow merge Flask and Quart users, be able to use any amount of ASYNC and, or Biaski or Whiskey and everything just, just works nicely for them.

41:29 Really.

41:29 Again, as I said earlier, I'm a bit skeptical about whether that could be the one namespace I just call Flask or whether you need to split it up as it is now.

41:36 But yeah, I think it's the start.

41:38 Hopefully we can, we can keep going.

41:39 Yeah.

41:40 Like the ASYNC stuff we've gotten there so far is for supporting the most important thing that we thought people were needing ASYNC for, which is I have some ASYNC code or like I'm using discord.py, for example, to write a discord bot or something.

41:56 That's all ASYNC, right?

41:57 So if you want to write that code, you need to type ASYNC def and put your code in there.

42:02 Right.

42:02 So we're enabling that.

42:04 We've got extension points to change, you know, what ASYNC IO loop you're using, like ASYNC IO versus Trio versus Greenback.

42:12 Or UV loop or something maybe.

42:13 Or you, I'm not sure if that would tie in.

42:16 Phil might be able to answer that.

42:17 And then like, you know, addressing things like being able to do web sockets and that sort of thing.

42:21 We might be able to do that in Flask eventually, or that might be the place where you switch over to the Quart namespace.

42:26 And, but you're using the same API.

42:28 It's just a different name.

42:29 Yeah, Phil, that's something I wanted to ask you about it.

42:31 Just to let you give a quick shout out about is the web socket support that you all have in Quart.

42:36 Oh, yeah.

42:37 I mean, I don't know if there's much more to say than it.

42:39 It's definitely supported.

42:40 And you just go ahead and use it.

42:42 It supports web sockets.

42:44 You did bring some of that stuff back to Verksoig, though.

42:47 Because you're using Verksoig in Quart, you needed to be able to route to web socket URLs as opposed to HTTP URLs.

42:54 And so we now have a way to identify in our Verksoig router whether something is intended to be a web socket or not.

43:01 So it'll change based on the scheme you're using.

43:04 I think it's good to point out that Miguel has a kind of experimental support, I think, in Flask as well for web sockets, which is good to keep an eye on.

43:12 We'll have to see how that goes.

43:13 Oh, yeah, that was really cool.

43:14 I don't remember what it was called or anything, but there's a way that G-Unicorn will let you take control of the HTTP socket from an endpoint.

43:24 And so within your Flask view, you could take over controlling the socket and start treating it like a web socket instead.

43:31 Like an upgrade type thing?

43:32 Yeah.

43:32 So you still are in Flask and WSGI mode.

43:35 So you're still like sync in terms of one worker is blocked handling that one thing.

43:38 But it's pretty clever.

43:40 Yeah.

43:40 And Joe out there throws out that it's Miguel Grinberg.

43:43 Justin is the Miguel you're talking about.

43:45 Yeah.

43:46 There's also Flask socket IO, but this is like a more native thing where you can just do this directly in Flask instead of needing an extension.

43:52 So cool stuff.

43:54 Yeah.

43:54 Super cool.

43:55 All right.

43:55 We're getting sort of short on time.

43:58 So I want to ask a couple of questions.

44:00 Hit on some high notes as well here.

44:02 One of the things that I think is pretty exciting that GitHub has done, you know, GitHub, I think, continues to be pretty neat.

44:09 And one of the things they've done is they've added sponsor support for projects.

44:13 Has that been helpful to you all?

44:15 Yeah.

44:15 We've gotten quite a lot of support.

44:18 We're part of the PSF.

44:19 And so we take donations through them.

44:22 If you go to palletsprojects.com slash donate, you get the PSF donation page.

44:26 We've got lots of people, you know, making one-time donations or scheduled, you know, monthly donations.

44:31 And we're also part of Tidelift, which is a commercial sort of open source support service that we're getting funding through.

44:40 And we're also, I mean, this isn't really a sponsor link, but since we host all our docs on Read the Docs, we're partnered with Ethical Ads, which is their advertising platform to share the advertising revenue on all our docs.

44:52 So we're getting quite a bit of funding.

44:54 We're going to put it towards Flask conferences.

44:56 Yeah, that's fantastic.

44:57 That's good to hear.

44:57 I do feel like there's probably a handful of billion-dollar companies that are using Flask at the core that maybe could click that link and do a little more.

45:05 But, you know, shout out to them.

45:07 If you're using Flask at your company, take a look at the sponsor links.

45:11 Yeah.

45:12 We have lots of plans for what to do with it.

45:13 Yeah.

45:13 I was really happy to see GitHub put this in here because, like, just having, like, a little, you know, buy me a coffee link on the side of a homepage, that didn't seem like it worked.

45:22 But I think this sort of central way, and what's interesting is I didn't realize that you could link to external sponsors.

45:28 Like, my thought was that that sponsor button really was going through the GitHub sponsor channel or framework or whatever.

45:36 People recommend that we use GitHub sponsors as well because a lot of companies who are already in GitHub's ecosystem have an easier time clicking that button than something external.

45:46 So that's something I will be looking into.

45:49 Kind of like App Store versus not App Store.

45:51 Like, first go to our site to buy a type of integration, right?

45:55 I feel like it's almost like that.

45:56 I would definitely recommend it.

45:57 I've sponsored some things through the sponsor button there, and it's super easy.

46:02 Okay.

46:03 Mars.

46:04 How about that?

46:05 Yeah.

46:05 Flask is on Mars or help the lander get to Mars.

46:09 And I bet if I pull this up, let me see if I can find your user profile here.

46:13 I just have to hack the URL.

46:14 It's going to have to be that way.

46:15 And I go down here.

46:17 Here you go.

46:18 You have the official achievement, Mars 2020 helicopter contributor.

46:23 How awesome is that?

46:25 Phil, do you have one of these as well?

46:27 Yeah, I think so.

46:28 Yeah, yeah.

46:28 I'm so jealous.

46:29 I want one of these.

46:30 Everybody who's gotten a code contribution to the repositories should have that badge.

46:37 And there's been plenty more people who have contributed in other ways that should have that badge, but don't.

46:43 Yeah.

46:43 Yeah.

46:43 Yeah.

46:43 Yeah.

46:44 You should also have the Arctic vault contributor.

46:47 Oh, I have the Arctic one, but I turned it off a while ago because I thought it was kind of silly.

46:50 Yeah.

46:51 This one is way more.

46:53 I don't know how that whole system works, but if they had archived Flask 2.0 after all my work was done, I'd be much happier.

47:01 But they archived it like two years ago now.

47:04 Yeah.

47:05 So there's a lot of ways in which Python is being used on Mars.

47:10 When the lander first landed there and, you know, people said, oh, look, there's the F prime library that was used to power the Ingenuity helicopter.

47:21 That means Python's there.

47:23 I'm like, ah, it looks like maybe Python just trained the model and C++ was there.

47:27 But it turned out in the lander that went down, actually the cameras, all the different angles were controlled by Python.

47:32 And then getting those images back to JPL was part of Python.

47:37 And yeah, what's the story of the Flask and Mars?

47:41 This is so cool.

47:41 Yeah.

47:42 So Flask is actually part of F prime.

47:44 So F prime is like their, I'm not an expert on this, but it's like their flight control software, I think.

47:49 So it's like a monitoring dashboard for everything.

47:51 So they're using Flask to provide like all this information about the launches and flights and landings and get updates in real time.

47:59 So I think that's where our stuff came in.

48:01 But I'm sure other parts of their code are using Jinja or click in other ways, not necessarily through Flask.

48:07 Yeah.

48:08 Wow, that's so cool.

48:09 What did you all think when you heard this?

48:11 Every now and then I'll see like a, you know, some big thing like this F prime and I'll, they won't have mentioned Flask or anything, but I'll have to like, somehow I'll have like this intuition that it was used.

48:22 And so like, I, I went and just looked at F prime and I like, I'm like, oh, it's Python requirements.txt.

48:28 Flask.

48:30 I went and announced it on GitHub.

48:31 I'm like, wow, check this out.

48:33 Yeah, that's super cool.

48:34 Go to the dependency graph.

48:35 I'm sure we'll see.

48:36 Yeah.

48:36 Look what number one dependency right there.

48:38 There we are.

48:39 In Flask or RESTful.

48:40 Yeah.

48:40 Something to do with APIs here, right?

48:41 Yeah.

48:42 Cool.

48:42 All right.

48:43 Let's, I guess, round this out with two things, actually.

48:47 Real quick, though.

48:47 I want to take a question, I think, or follow up comment from Ikivu.

48:51 Might be off topic.

48:52 They say they would love to know more about how to convince a large employer to spend money sponsoring an open source project.

49:00 I wish I had a good answer for this.

49:01 I know there has been thought on this.

49:04 I'm just not the best person to talk about it.

49:06 I'm not an expert yet.

49:07 I would say, look at Tidelift.

49:10 Their company and their whole job is to be that in-between between open source who doesn't know how to convince companies to do this and companies who are using a lot of open source but don't know how to analyze their dependencies and divide up their support.

49:24 And so if you go look at Tidelift, their whole goal is to enable that sort of thing and discuss it with management and all that.

49:32 That's not good.

49:32 Tidelift.

49:33 Is it?

49:33 Maybe Tidelift.

49:34 That's not good.

49:35 They might be down temporarily.

49:37 Never seen that before.

49:38 Maybe HTTP versus HTTPS.

49:40 Yeah, so that place.

49:41 I do think this is a good option as well.

49:44 You know, they sponsored TalkByThon for a little while.

49:46 And I think they're definitely trying to be creative in this, right?

49:48 They're trying to offer something to employers that's not just put it on your charity column in the balance sheet.

49:55 They're like, we don't have a charity column in the balance sheet.

49:57 What are you talking about, right?

49:58 So doing something a little bit different there.

50:01 You can look at it, I think, as a company as part of your recruiting spend.

50:05 I think every company knows how competitive the market is.

50:07 And I do think engineers do like what interests and what you do in the open source community and look at it in a positive light.

50:15 So I think that might help.

50:17 I totally agree.

50:17 A couple other quick follow-up questions.

50:19 Olga asks, can F Prime connect to APIs on Earth?

50:24 Like, do you guys know anything about this?

50:26 I think it is used on Earth as well.

50:27 I mean, like I said, it's like a monitoring dashboard.

50:29 So it's not something that's actively running on the rover, I think, from what I understand.

50:35 I think it is accepting data from sources like the rover and other systems and then displaying that and coordinating it.

50:43 Very, very cool.

50:43 And then Joe asks if Armin Roeneker's still involved with the project, any?

50:48 Armin is not.

50:51 He's still part of the GitHub organization and he's like in our maintainer channel on Discord, but he's moved on to other things.

50:58 You know, he's working in Rust a lot and other things.

51:01 My impression is he's kind of moved on to Rust and is just enjoying his time there, which is totally fine.

51:06 Like people don't have to stick with one technology their whole life, right?

51:09 Right, right.

51:09 They make big contributions.

51:10 That's one of the things I've been trying to do, too, since I became a maintainer was get more maintainers, right?

51:17 So it's not just Armin and then after Armin, it's not just me.

51:21 You know, I'm trying to expand it so it doesn't matter if Armin or I are still involved.

51:26 Yeah.

51:26 And Box of Ninjas out there says, I need the Mars endpoint.

51:29 Yeah, I don't think they just let that out to anybody.

51:33 Yeah, there's probably...

51:34 They don't put auth in there.

51:36 It's hard to find the endpoint.

51:39 Next to the right satellite at the right time.

51:41 Exactly.

51:41 You can just tunnel over there.

51:43 All right.

51:44 So I think that's probably all the stuff we got time for.

51:48 But, you know, thank you guys for covering this.

51:50 Let me ask you the last two questions before you get out of here.

51:52 If you're going to work on Flask or Quark, what editor do you use these days?

51:56 I've been using PyCharm for almost a decade now, I feel like.

52:00 Pretty much since I started using Python.

52:02 So PyCharm, all the way.

52:04 Right on.

52:05 Bill?

52:05 I use Emacs, although I've used VS Code a few times.

52:08 If I ever record something, I use VS Code.

52:10 But yeah, Emacs is where I do the work.

52:11 I do it right down the bare metal.

52:13 Cool.

52:15 And then recommend some library package you all have come across recently that you're like,

52:20 oh, this is super cool.

52:20 People should know about X.

52:22 Any ideas?

52:23 I'm really enjoying using Pydantic to validate the incoming requests, like just as a data

52:28 class setup.

52:29 I know you can do it with different ones as well, but the syntax seems so clean just to

52:33 say this looks exactly like a data class and I just use it to validate my incoming.

52:38 It's great.

52:39 That's fantastic.

52:39 Yeah.

52:39 One of the things I've started to do as like the first line in my Flask API endpoints

52:44 is to say Pydantic model equals, you know, class star star.

52:49 What is it?

52:50 Request dot JSON.

52:51 Something like that.

52:52 Like just immediately try to convert it to invalidate it with Pydantic.

52:56 Something I learned recently, I had Samuel on the show who creates and maintains Pydantic

53:01 is, although I didn't learn about it on the show, someone else pointed out to me, there's

53:04 a, like a secrets capability built right into Pydantic that like works with like .env files

53:11 and all sorts of stuff.

53:12 It's got this whole mechanism.

53:13 So yeah, that library does a bunch of cool stuff.

53:15 I don't have a good answer for this because I've been just dealing with Flask itself for

53:21 so long and getting those ready that I haven't really been exploring new stuff for myself.

53:25 Does this mean I get another?

53:26 You can have another, but yeah.

53:28 So like hopefully I get to learn about some new libraries as soon after, you know, Flask

53:33 2.0 goes stable.

53:34 I will say at work, and this isn't official yet because we're going to, we need to write

53:39 documentation.

53:40 It's totally unusable right now because it's not documented, but we've been working on a

53:44 open source library called AutoInvent, which takes a data model, like such as your SQL

53:50 Alchemy models and produces an entire GraphQL API and React front end.

53:55 From just the data model, plus like customizations to some metadata.

53:58 Oh, that's cool.

53:59 It's super handy.

54:00 It's really cool.

54:01 It's completely undocumented.

54:03 So I will at some point, maybe half a year from now, announce the actual project.

54:08 But if you go to an autoinvent.dev, you can see all our messy code right now.

54:12 Nice.

54:13 Bill, you got one more.

54:14 Go for it.

54:14 Oh, yeah.

54:15 So Trio, if you've not heard of it, is a different Async Await-based event loop implementation.

54:21 And I think I really like it because the structured concurrency it introduces is the way, I think,

54:27 the most Pythonic way to do Async Await.

54:30 Yeah.

54:30 Trio is neat.

54:30 I had the, I don't remember the maintainer's name, but I had him on the show.

54:34 Nathan?

54:34 Nathaniel, that's right.

54:35 I had Nathaniel on the show.

54:38 And yeah, it's super cool, like how you can have dependencies between, you know, this

54:42 task, created those tasks, and you cancel one, you cancel them all.

54:45 There's a lot of interesting patterns that come out of there.

54:47 Very neat.

54:48 All right.

54:49 I think that's it.

54:50 David, Phil, thank you.

54:52 Quick shout out or a quick final call to action.

54:54 People want to get into Flask 2.0.

54:56 They want to upgrade their stuff.

54:58 Maybe they want to take advantage of the Async stuff or whatever.

55:00 What do you tell them?

55:01 Where do they go from here?

55:02 Well, look for that new version releasing tomorrow or a week ago, depending on where you listen

55:07 to this.

55:08 Follow Palette's team on Twitter if you want to see announcements for new things.

55:13 And also, if you're interested in like contributing to these projects, I would encourage more people

55:19 to go on GitHub, you know, at least star the projects you're using, but also watch them,

55:24 you know, watch for new issues coming in.

55:26 Anybody can pick up one of these things and help out.

55:28 Yeah, you know, I think star and fork are the ones that get all the attention.

55:33 You know, one thing that GitHub just recently added, I know I said that, but I just want to

55:37 give a little quick awareness to people.

55:39 I think it's super cool.

55:40 If you forked a repo, it used to be you'd have to go to CLI and, you know, add an upstream

55:47 origin.

55:48 And then you have to kind of keep that in sync.

55:49 Now they've added a button that if you go to a fork and it's yours, you can just click

55:52 a button and go sync my fork with the original now.

55:56 And I think that, you know, encourage people to fork it and just stay up to date a little

55:59 bit easier.

56:00 So that's pretty cool as well.

56:01 Phil, final call to action.

56:04 What do you say to folks?

56:05 Maybe something core focused?

56:06 I think it would be go out and use it and let us know if it solves your needs, if it does

56:11 what you want.

56:11 Yeah.

56:12 Yeah.

56:12 Awesome.

56:12 All right.

56:13 Thank you both for being here.

56:14 Thanks, Michael.

56:15 See you later.

56:16 Yep.

56:16 Bye.

56:17 Bye.

56:17 Bye.

56:17 This has been another episode of Talk Python to Me.

56:21 Our guests on this episode were David Lord and Philip Jones, and it's been brought to you

56:25 by us over at Talk Python Training.

56:27 Want to level up your Python?

56:29 We have one of the largest catalogs of Python video courses over at Talk Python.

56:33 Our content ranges from true beginners to deeply advanced topics like memory and async.

56:38 And best of all, there's not a subscription in sight.

56:41 Check it out for yourself at training.talkpython.fm.

56:44 Be sure to subscribe to the show.

56:46 Open your favorite podcast app and search for Python.

56:48 We should be right at the top.

56:50 You can also find the iTunes feed at /itunes, the Google Play feed at /play,

56:55 and the direct RSS feed at /rss on talkpython.fm.

56:59 We're live streaming most of our recordings these days.

57:02 If you want to be part of the show and have your comments featured on the air, be sure to

57:07 subscribe to our YouTube channel at talkpython.fm/youtube.

57:10 This is your host, Michael Kennedy.

57:12 Thanks so much for listening.

57:13 I really appreciate it.

57:15 Now get out there and write some Python code.

57:16 Bye.

57:17 Bye.

57:17 Bye.

57:17 We'll see you next time.

Back to show page
Talk Python's Mastodon Michael Kennedy's Mastodon