Brought to you by Michael and Brian - take a Talk Python course or get Brian's pytest book


Transcript #207: FastAPI as a web platform (not just APIs)

Return to episode page view on github
Recorded on Wednesday, Nov 4, 2020.

00:00 Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.

00:04 This is episode 207, recorded November 4th, 2020. I'm Michael Kennedy.

00:09 And I'm Brian Okken.

00:10 And this episode is brought to you by us. We'll tell you more about that later.

00:14 Brian, how you been?

00:15 I am excellent today. A little tired. How about you?

00:18 Yeah, quite tired, actually. Quite tired. But I'm doing all right.

00:22 Life goes on, and we continue to work from home and all those things.

00:27 And, you know, luckily our industry and our tools were built for that world.

00:32 Yes, I'm very fortunate. Yeah, absolutely.

00:34 So speaking of fortunate, I think we're fortunate that Sebastian Ramirez created FastAPI,

00:40 because we've talked about FastAPI before. It's super neat.

00:43 We've talked about Pydantic before, which is a really cool way to take data class-like things

00:49 and automatically bind them with automatic conversion, validation, and whatnot for data.

00:55 That just comes from a JSON dictionary somewhere or just a Python dictionary.

00:58 But it often is JSON being submitted to a web, some sort of web API.

01:04 The reason I bring up FastAPI is I've been doing a lot of stuff with it,

01:07 actually working on a series of courses around FastAPI as well, which is super exciting.

01:12 And maybe I'll mention that briefly later.

01:14 But one of the things that bugs me about FastAPI is it's so API-oriented that it's tricky to know what to do

01:24 when you just say, I just want to create a website that has like a couple of pages and then some APIs.

01:31 So for example, if you just create a couple of APIs now and they're like, say it's about weather,

01:36 it'd be like slash API slash weather slash report, API slash weather slash latest or whatever, right?

01:43 Well, if you just click the, you know, you run it, you just click the little link in your IDE or VS Code or whatever

01:50 and open it, what do you get?

01:51 404.

01:53 Probably not the best response that you could imagine is that like the default behavior is just to like open up the site

02:00 and it says not found.

02:01 So you got to like type in this stuff.

02:03 Anyway, it supports Jinja in like a sort of manual way, the same way that Flask does, I guess, more or less.

02:10 But I wanted a better way to have HTML pages inside of my FastAPI app.

02:20 Because if you're going to build an API, there's a very good chance there's like two or three pages that you need, right?

02:25 Yeah.

02:25 Yeah.

02:26 So I wanted to have a couple of things.

02:29 I would like to be able to have a simple function that is a web view method.

02:34 It could be something that is like a HTTP endpoint for an API, but more likely it's going to be one of these pages.

02:40 And I want to just be able to have it return dictionaries and say that it takes some kind of template, right?

02:48 So put a little decorator and say this one has a template home slash index.html.

02:54 And it's automatically going to take that dictionary, send it over to whatever template engine you choose, turn it into HTML and send it back.

03:00 You know, set the content type to be HTML, all of those things, because by default it's JSON.

03:05 Okay.

03:06 So you'd like it to be the JSON data, but have it be formatted like HTML.

03:11 Well, often with these templates, what you need to do is like, suppose you've got a bookstore and you want to say, here's the categories.

03:16 You have to somehow pass data over to like categories.html and it'll get like a list of categories.

03:23 And then you'll iterate over them and generate the HTML to that dictionary being passed over.

03:27 That's the data that you're basically providing to the dynamic HTML, right?

03:32 So what I did is I went and I created this thing called FastAPI dash chameleon.

03:36 Oh, nice.

03:36 So if you want to use the chameleon template language, which previously was not really in any direct way supported, you could import all the libraries and just make it do it yourself.

03:45 But that's kind of painful.

03:46 Now you can just put a decorator, you know, from FastAPI underscore chameleon import template and just say at template and point some file at it and boom, you return a dictionary.

03:56 Now you have chameleon as your template language.

03:58 Oh, cool.

03:58 That's neat, right?

03:59 And it also, I found a way to write a decorator that will automatically adapt whether it's an asynchronous or a non-asynchronous method, right?

04:08 Because normally the decorator, what it does is it has like a wraps and has an inner and then like the inner function does stuff and then calls the actual thing it's decorating.

04:17 Well, if the thing it's decorating is async, you got to do one thing.

04:20 If it's not async, you got to do another thing.

04:22 So how do you tell?

04:23 There's a cool library called inspect, which will let you actually look, even if it has a little wraps decorator that tries to lie to you about what it is, it'll show you whether or not it's a coroutine, which is pretty cool.

04:35 Oh, nice.

04:35 Yeah.

04:36 So on top of this, Mark Brooks saw this and said, that's awesome, but I don't really like, I don't use chameleon.

04:42 I like Jinja.

04:43 So he forked my repo and created a FastAPI dash Jinja.

04:47 So now you can do exactly the same thing if you like Jinja.

04:50 And guess what?

04:51 If there's someone out there that really, really wants to use, I don't know, Django templates or Mako or whatever, right?

04:57 That's like five lines of quote away from doing that as well.

05:01 The reason I think it's important to add these other template languages, not just say, well, it supports Jinja, so you're good.

05:08 The reason I think it's important is if you've got some web application that has APIs, it already has chameleon templates or in the other example that doesn't exist yet, some Django thing.

05:18 And you want to convert it to use mostly FastAPI, but you don't want to rewrite all the HTML, CSS and JavaScript.

05:24 If you can make it render those templates, then it's so much easier to move from some other web framework over to FastAPI because you don't have to touch the HTML.

05:34 You don't have to touch the CSS.

05:35 You don't have to touch the JavaScript.

05:37 There's just that middle part where you like handle the request and that's actually pretty limited.

05:40 Yeah.

05:41 So that was my idea for creating this was hopefully to make make it possible for people who have other stuff written in chameleon to move to FastAPI really easily.

05:50 And then also just to like sort of inspire a cleaner programming model.

05:53 Yeah.

05:53 I actually was going to ask you if it was possible to do something like that with Jinja and you already answered that.

05:58 Yeah.

05:58 Yeah.

05:59 It's actually, it's built in, but the way it's built into FastAPI is not with like a template decorator.

06:04 It's, you know, you actually go in and you say the actual file name and then you pass a bunch of it's like, it's not super clean.

06:11 So it is, it is quite clean the other way around, which is cool.

06:14 Yeah.

06:15 Nice.

06:15 Cool.

06:16 Nice.

06:16 Carrying on about APIs.

06:18 Yeah.

06:19 Maybe a little less clean of a way.

06:21 So yeah, we've been very excited about FastAPI recently for APIs and in the Django world, there's the Django rest framework is quite popular.

06:31 But what if you just want to use vanilla Django and write a rest API?

06:36 Adam Johnson took that on and said, yeah, of course you can do it, but you can also do it in one file.

06:42 So we're going to link to a little article where he has a simple rest API completely written in one file as a one file application.

06:51 It's a, it's a little API that gives you information on the characters from Rick and Morty, specifically just Rick and Morty.

07:00 And that's it.

07:00 But it's a good example.

07:02 I'd like it.

07:03 It shows, shows you how to do, how you can do redirects.

07:06 And so like, like for instance, the endpoint, one of his endpoints is characters.

07:11 So if you type your application slash characters with a slash at the end, it should return, Jason data with the information about Rick and Morty.

07:22 Now, what if you just don't put anything, if you put characters without the slash or don't put characters at all, like your homepage thing, he shows you how to do redirect.

07:31 So you can redirect two characters and, you know, it's pretty simple example, but it is kind of neat that you can do it off the shelf, Jason or off the shelf Django.

07:40 He also shows he's got some hard coded data classes within the application, but it's easy, you know, not that difficult to imagine that you can extend that to something that reads it out of a database or some other part of your system.

07:52 Yeah, absolutely.

07:53 And it's like 63 lines of code, which is not too much for a non-trivial little example API.

07:59 You know, I'm not necessarily on board with putting this in one file, but I am on board with this idea of like these simplified things.

08:06 You know, when you hear about Django, you always say, go ahead.

08:10 If I want an API, I'm going to have to add Django rest framework and all these other things to it.

08:15 If say you're in Flask and you want to work with users, like, well, I've got to add the Flask SQLAlchemy add in.

08:21 I've got to add the Flask users add in as an extension.

08:23 And maybe I want session.

08:25 So I got to add Flask session.

08:26 Like none of those things are necessary per se, especially on the, on the Flask side.

08:31 Like there's so much of it.

08:32 It adds like one or two lines of code that you don't have to write.

08:35 And now you have all the overhead of depending on making sure that that thing works right.

08:38 And the way you work with it is the way you want.

08:40 And so having just a, here's the bare bones view and you can add in stuff if you like.

08:44 I'm a fan of that.

08:45 Yeah.

08:46 I'm also thinking like, let's say you have a Django application already and you built it,

08:51 not intending anybody to use it as an API.

08:53 And somebody says like maybe an internal application, your business or something.

08:57 And somebody says, oh, this data here where this graph is, can we get that as an API so that we can, you know, use it in something else?

09:04 And this would be, you know, a good example to be able to just add.

09:09 You can use Django REST framework, of course.

09:11 But if there's just something simple you need to add as an API, this is a way to do it.

09:16 Yeah.

09:16 No, it's cool.

09:16 And like, I do feel like these add-ons and these extra layers that you add, they better add a ton of value because they're also adding overhead and dependencies and breaking changes and like all that.

09:28 So yeah, if you've got something working, you want to just add a little bit of, you know, here's a few JSON endpoints.

09:32 Let's do that.

09:33 Yeah.

09:33 And for people that really enjoy this article and want to hear more from Adam, I've had him on Test and Code a couple times.

09:40 So we'll drop links to those episodes in the show notes.

09:43 Yeah, right on.

09:43 Now, before we get to the next one, which is a pretty big item, I just want to say this episode is brought to you by us.

09:51 Of course, it's over at Talk Python Training, Test and Code Podcast, and something to do with pytest.

09:56 Do you do anything with pytest?

09:57 I heard that pytest is a thing that people use.

09:59 Do you do anything with that?

10:00 Yeah.

10:01 So, yep, wrote a book on pytest.

10:03 I still think, and I still get call outs on Twitter saying it's the best book they read to get started with testing,

10:10 and they got excited about testing with reading Python, testing with pytest.

10:15 So it's a good book.

10:15 Yeah.

10:16 Awesome.

10:16 Yeah.

10:17 And over at Talk Python Training, I'm now working on a three-part series, so like three, four-hour sections or so,

10:23 on building FastAPIs and also like testing them and putting them in production and fun stuff like that.

10:30 Oh, that's exciting.

10:31 Can't wait to watch that.

10:32 Yeah, that'll be fun.

10:32 Yeah, yeah, that'll be super fun.

10:34 So anyway, that's coming.

10:35 People can go over there to training.talkpython.fm, you know, sign up to get notified and visit

10:41 Testing Code and listen over there as well.

10:43 Yep.

10:43 We also have Patreon, right?

10:44 Oh, yeah.

10:45 So had somebody reach out to us for the Patreon and say, hey, you guys mentioned that a whole bunch of people sponsor you for a buck a month,

10:53 but they said, that's the only tier you have.

10:55 And so Michael and I are definitely going to talk about in the future whether we should add some more tiers.

11:01 However, there is an option.

11:02 Even if you sign up for a dollar a month, if you want to send us more, you can change that within the Patreon thing.

11:10 So we'd appreciate it.

11:11 Yeah, much appreciated to everyone who supports us.

11:13 In all the ways.

11:14 Every way is valuable and appreciated.

11:16 Speaking of valuable and appreciated, we often talk about the Stack Overflow Developer Survey.

11:21 I mean, in my mind, there's two major surveys that take the pulse of the developer community.

11:25 One is the Stack Overflow Developer Survey.

11:27 The other is the PSF survey, which, by the way, just got extended to three more days.

11:33 By the time this comes out, that'll be already in the past.

11:36 But, you know, that's hopefully people have taken that.

11:38 We've talked about it before.

11:39 And we talked about the 2020 Stack Overflow Survey coming out, I believe, and I told folks to go take it or you did.

11:46 And then we just didn't follow up, right?

11:50 But the survey results are out, so I thought it might be fun to run through the survey results.

11:53 Yeah.

11:53 Yeah, and I just want to be clear.

11:55 Like, I kind of lost track of this.

11:57 I don't know exactly when this came out, but it's not brand new.

12:01 It's like four, five, six months ago.

12:04 But I just, you know, we didn't talk about the results.

12:07 We just talked about the survey.

12:08 So let's run through some of the things that are here.

12:11 Now, the 2020 Stack Overflow Survey is focused a lot on demographics and background and education and all those sorts of things.

12:20 And if you're interested in that, definitely go check it out.

12:22 There's a lot to see there.

12:24 Just because of the format.

12:25 I'm going to focus mostly on the tech side that they covered here.

12:28 Okay, so not whether we have a full-time job, how many of us work from home, none of that.

12:33 So some of the most popular technologies, and I just want to point out, I think the PSF survey and the JetBrains folks who worked with them to put that together is in a much better place.

12:42 This is a wacky, wacky, wacky survey, but it does have some good questions.

12:47 Yeah.

12:48 I'll expand on the wacky a sec.

12:50 But if we look at the most popular languages, most popular technologies, web frameworks, databases, and so on, certain languages, we have JavaScript, Python, and Java.

13:02 And JavaScript has 68%.

13:04 Python has 44%.

13:05 Java has 40%.

13:06 That's good, right?

13:08 I mean, like, everyone knows JavaScript's pretty popular.

13:10 So what's wacky here?

13:12 Why is this weird?

13:13 And I'm not necessarily saying there's not 68% of the people doing Node.js.

13:18 They may well be.

13:18 But do you know what language is between JavaScript and Python?

13:22 CSS.

13:23 Dude, I know no application that is shipped running on CSS.

13:28 I can't even compile CSS.

13:30 I could probably compile SAS or less over to it, but I can't compile CSS to a running application.

13:34 It's not a programming language.

13:36 Yeah.

13:36 And SQL.

13:37 Perhaps it's true and complete, but yeah, and SQL.

13:39 SQL is a thing you use within a language.

13:41 Yeah.

13:42 It is not a programming language that builds things, right?

13:45 Yeah.

13:45 So they have this, this is what I was talking about where it's wacky.

13:48 And JavaScript is in this world, right?

13:50 They needed to ask very, very clearly, do you work exclusively in JavaScript as a Node.js developer or a pure front-end developer?

14:00 Or did you check, I also use JavaScript and CSS and Python?

14:05 I also use JavaScript and CSS and Java, right?

14:08 And so the JavaScript one has like bundled up all these, I do anything in the web on any language plus the Node.js developers, right?

14:17 I think the contention there is a little bit closer, but it still wouldn't surprise me if JavaScript was actually in the lead.

14:24 I don't know, I feel like I'm all hyped up on like percentages and trajectories given all this election talk that we just went through.

14:30 Well, I remember checking the box for JavaScript once and like, yes, I use JavaScript.

14:34 Yeah, exactly.

14:35 But what does that mean?

14:36 I have an app that does use a little bit of JavaScript and I looked at the code once.

14:41 Right.

14:41 Did you do $document.ready?

14:43 You're a JavaScript developer, like not really.

14:47 Yeah.

14:47 On the other hand, if you build an app with Vue.js or Angular, you're a JavaScript developer.

14:52 If you build something with Express a Note, you're a JavaScript developer.

14:55 So I think it's a little bit weird that they didn't like really clearly make that distinction because you can't put two buckets and add up those numbers next to other buckets and make that make sense, right?

15:07 CSS is the same thing.

15:08 Like no one would check it if you said I primarily code in CSS to build apps and ship on the CSS platform.

15:14 Anyway, okay.

15:15 So web frameworks, you know what the most popular web framework is?

15:19 Well, I do now that I just looked.

15:21 Do you believe it?

15:21 But I wouldn't have guessed this.

15:22 Do you believe it?

15:23 No.

15:24 It's jQuery.

15:25 Nobody.

15:26 How can jQuery be in the same category as like Django?

15:30 Yeah, yeah, yeah.

15:30 It's even on the front end side of the JavaScript front end frameworks.

15:35 There's Vue, there's Angular.

15:35 All those are really legitimate things.

15:37 jQuery is not the primary way in which people write web applications.

15:42 But a lot of people use it.

15:43 So it's in there.

15:43 All right.

15:44 So anyway, those two are a little bit weird.

15:45 I take away.

15:46 Python is really quite popular and up there.

15:49 The Python web frameworks, I think there's just so many.

15:51 They don't filter very high to the top individually.

15:54 Databases is much clearer.

15:56 You know, you don't have to talk about other funky stuff.

15:58 So for the most popular ones, we have MySQL at 56%, PostgreSQL at 36%, Microsoft SQL Server

16:06 at 33%, and MongoDB at 26%, which is actually pretty high in my understanding of the world.

16:12 But that's pretty cool.

16:13 For platforms, as a developer I work on, not I deploy my code too, we have Windows at 46%,

16:21 macOS at 28%, and Linux at 27%.

16:24 So again, most common platform for development is Windows.

16:27 So we can't forget them when we build our packages and whatnot, right?

16:31 Steve Dower goes on and on about that, which is good.

16:33 My favorite part of these surveys, though, that these are legitimately good, is the most

16:38 loved and the most dreaded, the most wanted section.

16:42 So the most loved languages are Rust, TypeScript, and Python.

16:47 Those are neat.

16:48 TypeScript personally drives me a little bit crazy, because it's like so picky.

16:51 It's like the type annotations, but you don't get it exactly right.

16:55 It's not going to work.

16:56 Anyway, it's still pretty neat.

16:58 Rust, I would like to learn.

16:59 Python, I know something about.

17:00 The most wanted languages, I think, is also interesting.

17:03 So most loved is I work with it and I love it, versus I dread it.

17:06 Or I don't get to work with it very often and I'd like to do more, is the number one,

17:10 Python.

17:11 Python.

17:11 Number two, JavaScript.

17:12 Number three, go.

17:13 Go figure.

17:14 Nice.

17:14 Yeah?

17:15 Most dreaded?

17:16 VBA and Objective-C.

17:18 Does that surprise you?

17:21 Well, in Perl's number three is still interesting.

17:24 It still brings dread.

17:26 So that's the languages.

17:27 And then the databases, most loved, Redis, Postgres, Elasticsearch.

17:32 Again, Elasticsearch is like CSS a little bit to me.

17:34 Is that really a database?

17:35 Anyway.

17:36 And MongoDB.

17:37 So those are all quite high.

17:39 Most wanted database is MongoDB and Postgres are neck and neck at the top.

17:44 Okay.

17:44 And you still do both.

17:46 You do a lot of Mongo, right?

17:47 Oh yeah.

17:48 I love Mongo.

17:48 I think it's sweet.

17:49 Okay.

17:49 So clean and easy to work with.

17:51 It's been years since I've had to do a database migration and production.

17:55 I love it.

17:55 As in, like, I changed my schema and now the app won't run unless I apply this script.

17:59 Yeah.

17:59 Yeah.

18:00 So anyway, rounded out, most dreaded database, IBM DB2.

18:04 Doesn't surprise at all.

18:06 Anyway, that's the survey.

18:08 I just want to give a shout out or like a call to the community.

18:11 If you have any influence on this, find a way to separate things that are unequal, right?

18:18 Don't put just I do some JavaScript from I do some C++.

18:22 Those are not equivalent.

18:23 Or I do some jQuery and Angular and I do Django.

18:28 Those are just not even in the same category.

18:31 And it really drives me crazy that they're put this way.

18:33 And it just makes me appreciate the Python Software Foundation survey more because it had

18:37 less of this weirdness.

18:38 Yeah.

18:38 Yeah.

18:39 There's some weird things that get bucketed together.

18:41 Yeah.

18:42 Interesting.

18:43 I would say the PSF one is more regular, wouldn't you say?

18:46 More regular.

18:47 Oh yeah.

18:47 Nice transition.

18:48 Thank you.

18:49 But before we move on, there was another.

18:53 Nobody else will care about this but me.

18:55 But what was the other survey that is closing in a couple days?

18:58 The PSF survey.

18:59 The one at python.org, I believe.

19:02 Let's see.

19:03 Is it still up there?

19:03 Okay.

19:03 I don't know where it went.

19:05 But yeah.

19:06 Yeah.

19:06 It's right there in the middle.

19:07 Can I mail in my ballot and get it as long as it's postmarked in time?

19:11 Well, if you postmark it at the right time, yeah.

19:14 Sorry.

19:16 Couldn't resist.

19:17 So, regular expressions.

19:18 So, I'm sure we've talked about regular expressions before, but they occasionally crop up in my work.

19:24 I always forget them.

19:25 I learn them and then I forget them.

19:27 I have to learn them all over again.

19:28 So, this is going to be helpful.

19:30 Yeah.

19:30 So, Amit Chaudhary, I think, wrote a visual guide to regular expressions.

19:34 And this came out recently.

19:36 And this is kind of a very nice, gentle introduction to regular expressions by building up.

19:42 And I think it helps you build up a correct mental model of how they work.

19:46 He utilizes visual highlighting as if he kind of went through it with a highlighter pen and highlighted the different things that could be matched.

19:54 So, it goes through a whole bunch of stuff.

19:56 It starts with just a specific character.

19:58 So, like, if you have a string and you're matching, like, the character A or something like that, what would it hit?

20:05 And then moves on to white space and digits and word characters.

20:10 And a lot of these gentle introduction type things go through some of the basics and then sort of stop there.

20:16 And what I really love about this is he talks about some of the more advanced things like pattern negations.

20:23 So, like, and why they're weird.

20:26 Like, slash lowercase d is digits.

20:28 Slash uppercase d is everything that's not a digit.

20:31 And some of these exclusions.

20:34 Talking about anchors, like, beginning and the end of the line.

20:37 Character sets with brackets.

20:39 And then ranges with a dash within the ranges.

20:42 You're talking about repetition.

20:44 And this is kind of something that threw me off when I first learned about them.

20:48 Using curly brackets.

20:49 I was used to using star for zero or more items and plus for one or more item.

20:54 I think.

20:55 Or maybe it's the other way around.

20:56 Yeah, that's right.

20:57 Yeah, that's right.

20:58 And then, but you can use a question mark for it.

21:01 Only can be one, but it can be there or it doesn't have to be.

21:04 And then the, if it has to be a certain number of times, you can use curly brackets for saying it needs to be two of these or something like that.

21:11 And then it goes on and says, okay, well, now you've learned all this stuff.

21:15 How do you put it in place with Python?

21:17 And with Python, you use the, one of the ways is the RE module for regular expressions.

21:23 So it goes through a quick example of using find all, match and match group and search.

21:29 So if you're a Python developer and you have to deal with some regular expressions, I think there's definitely something to check out.

21:34 Yeah, it's really nice.

21:35 And it's a very gentle introduction.

21:38 So people can just go through and the coloring and stuff.

21:41 Yeah.

21:42 Because normally a lot of these presentations of regular expressions, man, it's like write only.

21:49 You know, you look at it like, whoa, that is a mess.

21:51 And then, you know, then it's gone.

21:53 Like you could write it, but you could go back and read it again type of thing.

21:56 Yeah.

21:58 Yeah.

21:58 Yeah.

21:59 So this is nice.

22:00 This is good.

22:00 Yeah.

22:00 Cool.

22:01 Nice one.

22:01 Yeah.

22:02 I can't take credit for that one though.

22:03 Somebody else wrote it.

22:05 You probably shouldn't take credit for it.

22:06 Right.

22:07 Did you, did you create it?

22:08 I mean, like you probably shouldn't.

22:09 No, I just brought it up.

22:10 So I don't really know the whole story with this next one, but it's, I entitled it taking credit.

22:16 And this was based on a GitHub project and a tweet by Tim Nolet.

22:21 Tim Nolet, I'm not entirely sure how to say his name.

22:23 Hopefully one of those works.

22:26 And he created this project, which is called, let me check it out, Headless Recorder over

22:32 at Playwright, I believe.

22:33 Let's see.

22:34 It is, yeah, it's called Headless Recorder.

22:37 And so what it does is it allows, it's a Chrome extension that allows you to create scripts that

22:43 interact with either Puppeteer or Playwright that do just like web automation.

22:48 You know, a little bit like non-programmatic solenium or those types of things, right?

22:54 Yeah.

22:54 Fine.

22:54 That's all cool.

22:55 So there's a bunch of JavaScript that you write in there.

22:57 That's pretty interesting.

22:58 And the tweet says, I'll just read the tweet and then we'll go from there.

23:02 It says, oh, AWS Cloud, I really do love you.

23:05 But next time you fork my open source project and present it as your new service, please

23:10 give the maintainers a short, nice, good job, kids, or something.

23:13 I mean, it doesn't necessarily have to follow the APL version 2 license and stuff, but at

23:17 least a little credit would be great.

23:19 Wow.

23:19 So there's also a linked announcement about this thing called AWS CloudWatch Synthetics

23:26 launches a recorder to generate user flow scripts for Canaries, which is, you look at the syntax

23:32 in the examples, it does now say credits based on headless recorder at the bottom, but I'm

23:38 pretty certain that it didn't say that in the beginning.

23:40 I mean, I don't have like a diff of the webpage, but it would not be surprising.

23:45 I wouldn't think he would put that up there if at the bottom it said that.

23:48 So now it does.

23:50 Anyway, this is not relevant to this project really at all.

23:54 It's more just a conversation about what do you do when big companies adopt your open source

23:59 project, but don't give you credit.

24:01 I think that's lame.

24:02 Well, I think it should be even more than that.

24:04 I mean, I think anybody that personally, if somebody else, if I had like, let's say I've

24:10 got a couple of small projects that I don't really do much with.

24:13 And if somebody else took that and forked it and then like did something big with it and

24:18 started making a startup or some money with it, fine.

24:21 Good for them.

24:22 But if it's a big company like Amazon.

24:25 It's a Google, Microsoft, Apple, AWS sort of thing.

24:29 Anytime.

24:29 I think credit is due.

24:31 If you're not the one that came up with it, if you just forked it, ran with it, I think

24:35 giving some, and that's typical.

24:36 I mean, we often give credit to say, hey, I ran with it.

24:40 It started here, but I did a whole bunch.

24:42 That's fine.

24:43 But a big company, I think they should both give credit.

24:46 And I think some cash should go to the original idea starter.

24:50 Yeah.

24:51 Yeah.

24:52 I hear you.

24:53 If it's not cash, which, you know, that might be a hard sell.

24:57 How about as we maintain this project, we sort of forked from your stuff.

25:02 We'll push changes back to make yours better.

25:04 Right.

25:05 At least some sort of, hey, we've based this on your thing, but by doing so, we're going

25:10 to make that thing better because we've made a commitment to at least, you know, do

25:15 a little bit of give back PRs, improvements.

25:17 Right.

25:18 And also, I don't know, like, I don't know this guy, but at the AWS reInvent conference,

25:25 when they announced this, if they said, hey, this is based on this cool project by Tim,

25:28 you know, that would raise his profile and I'm sure he would really appreciate it.

25:32 Personally, a lot of my stuff's under MIT.

25:34 And so people don't have to mention me, do anything, say anything, whatever.

25:38 A few things are not, but it's, you know, a lot of it's just example code and people

25:42 are like, well, can I use this example in my commercial application?

25:45 I'm like, yes, I really don't care if you like recreate my random sample in your project.

25:49 That's fine.

25:49 Right.

25:50 I don't want anybody to have those feelings, but if I was building something useful, I'd

25:54 at least want, you know, a shout out.

25:56 I guess that's all he's asking for as well.

25:58 Yeah.

25:58 Anyway.

25:58 And they did it.

26:00 So that's good.

26:00 They did come around and do it.

26:01 Yeah, they did.

26:02 I'm pretty sure that was not the beginning situation, but now it is.

26:06 And so that's quite good.

26:08 And just given the amount of people who are in the Python space, who listen to the

26:12 podcast, they do open source.

26:13 I thought this story would be interesting, even though it's technically JavaScript.

26:16 Yeah.

26:16 Yeah.

26:17 I bet you could even write that JavaScript on a Raspberry Pi, Brian.

26:20 Maybe.

26:22 So I was just curious, what was the first computer you programmed on?

26:26 So the first computer that I programmed on was one of those Apple IIEs that was beige and

26:32 had a green screen, I believe.

26:34 Okay.

26:34 You started on a IIE as well.

26:36 Yeah.

26:36 But that was like in middle school or now, maybe even elementary school where it was just,

26:43 you know, something that I went for class.

26:44 The very first thing that I actually got to sort of sit down and program on, my brother

26:49 had a Commodore 64, but I didn't really use it for anything constructive.

26:53 I would say a 286.

26:55 IBM 286.

26:56 Okay.

26:57 I programmed to Apple IIE at school, but it wasn't confusing enough to me that I didn't

27:05 run with it right away.

27:07 I kind of dropped programming after that.

27:09 But anyway, I bring this up because there's a new computer out and it reminded me of this

27:14 about those early computers.

27:17 So, or the Commodore 64 is kind of the same category.

27:20 So the Apple IIE was kind of like-

27:22 This is cool.

27:22 It was, yeah, it was a higher end.

27:25 I had to, or Commodore 64 was a little bit lower than a IIE, I guess, I would think.

27:30 And then below that is the TRS-80 from Radio Shack.

27:34 That's what I had.

27:35 I had my, but anyway, so the, the Raspberry Pi 400 is out now or it's announced and it's

27:42 going to be out by the holidays, apparently.

27:44 It's really cool.

27:45 It's like, it kind of reminds me of these Apple IIEs because it's the, it's the computer

27:50 in the keyboard.

27:51 So the, the keyboard is the computer and you can even hook up two large monitors to it

27:57 because it does, it supports two displays, 4K video.

28:01 It'll do a two 4K monitors out of your keyboard.

28:04 Yeah.

28:04 And that's cool.

28:06 This one's got four gigabytes of RAM.

28:08 You both do wifi and LANs.

28:11 It has a hard landline entry point, which is good.

28:13 Four core 64 bit processor.

28:15 It just looks fun.

28:17 They're telling it as a whole kit for like a hundred bucks.

28:19 So you get a, like you can start somebody up on a computer.

28:22 I'm covering this cause I'm, I was thinking, geez, do I want to get this for my kid or do

28:28 I want to get it for me?

28:29 Yeah, exactly.

28:30 And it comes with a beginner's guide and shows you how to get started and even includes getting

28:34 people a little bit started on Python and apparently.

28:37 So that's good.

28:38 Yeah.

28:38 It seems super neat.

28:40 And the processor is pretty good actually.

28:42 Four core, four gigs of RAM.

28:44 And it looks like just one of these little, you know, wifi, USB, like over the little RF

28:50 or radio frequency dongle thing keyboards that you would get.

28:54 But that's the whole computer on the back of the keyboard.

28:57 It's got the HDMI ports.

28:59 It's got the other ports, the power, everything.

29:01 Yeah.

29:02 So you got to get your own monitor, of course, but plug it in and you can get started.

29:06 And there's videos on the, on the Raspberry Pi site that are amazing watching this thing

29:11 go.

29:11 It's, it's powering two big monitors and it's just feels, it looks like it's as zippy as

29:16 a normal computer.

29:17 So I think it'd be cool for educational use and lots of uses.

29:22 So it's pretty nice.

29:24 Even for just a travel computer.

29:26 A travel computer.

29:27 Yeah.

29:27 Right.

29:28 Imagine when, remember when people left their house.

29:30 So imagine it were like that again.

29:31 And then you could go places.

29:33 But if you were just going on a trip and you're like, ah, maybe I'll just like need a computer.

29:37 I want to plug in.

29:37 You know, bring a HDMI cord, plug it into the, the TV at the hotel, plug it into some sort

29:43 of monitor at like some office you're dropping in on.

29:46 You could just take that and have, you know, do presentations and stuff.

29:50 It's cool.

29:50 Yeah.

29:51 Cause like that's true.

29:53 Cause the HDMI output, it's a lot of TVs just take that now too.

29:56 So yeah, exactly.

29:57 Just bring a little short HDMI cable with you if you need to.

30:00 And then you're good.

30:00 I'm including a linking to a video from Lee Moore Freed from Aja Fruit in there.

30:05 She says that it reminds her of the Apple 2E as well.

30:07 Nice.

30:08 I'll check that out.

30:08 Super cool.

30:09 So that's our main items.

30:11 That's quite an adventure.

30:12 Brian, you got any other, other things you want to just throw out there real quick?

30:16 Once quick thing.

30:17 I got reminded.

30:18 I ran across this a while ago and I, somebody reminded me of it on Twitter recently is a

30:24 Vim adventures.

30:25 It's Vim dash adventures.com.

30:27 Remember the dash, but it's a kind of like this adventure game, like these old going through

30:34 a dungeon sort of thing and picking up treasure and things like that.

30:36 And you just is to help you practice your Vim key bindings while playing an adventure game.

30:42 So if you're having trouble getting learning Vim, maybe try this.

30:46 Yeah.

30:46 That looks quite cool.

30:47 Actually, it's a neat little adventure game.

30:50 Now, I just want to throw out something I got from Tyler Pedersen just a little bit ago.

30:55 And this kind of comes back to the language talk around Stack Overflow that I mentioned.

31:01 And this is an update for the TOBE index, T-I-O-B-E index for November 2020.

31:08 And my feeling and my theory is that things like Stack Overflow and whatnot, those places

31:18 are often measuring like the pulse of the industry right now, whereas TOBE seems to have a little

31:25 bit of a latency, like how many legacy apps of this style are you working on and this technology

31:29 and whatnot, right?

31:30 So it's a little bit of a longer term moving average.

31:34 Well, anyway, the headline is November headline, Python is unstoppable and surpasses Java.

31:38 For the first time since the start of the TOBE index, nearly 20 years, Java and C don't make up

31:44 the top two positions.

31:45 Okay.

31:46 In 20 years.

31:47 Wow.

31:47 So Python's not a top, but it's right below C.

31:50 It's right below C.

31:51 And it's, you know, it's been a long time coming, right?

31:54 So anyway, I think this is pretty neat.

31:57 And Tyler, thanks for sending that along.

31:59 People can check it out.

32:00 Yeah.

32:00 Cool.

32:01 Ain't no joke.

32:01 But how about a joke?

32:03 A joke would be great.

32:04 All right.

32:04 So we've got a cartoon, but this one is super simple.

32:07 And I think just the words will do it.

32:09 So this is from Geek and Poke, which has some fun things.

32:13 And the title is, You Build It, You Run It.

32:16 It's all about microservices.

32:17 Okay.

32:18 Okay.

32:18 So there's a woman developer and a guy developer just kind of staring at each other.

32:22 And it says, when we decide to create a new microservice, we just need 30 seconds to

32:28 get a blank microservice running in that Kubernetes cluster.

32:31 So amazing.

32:33 They kind of stare at each other for blankly for a minute.

32:35 Then the woman says, and what?

32:38 You just need another week to come up for with a funny name for it.

32:41 Two weeks.

32:42 Two weeks, says the guy.

32:44 Yeah.

32:47 Yeah.

32:47 Anyway, I thought people running a funky name to microservices would definitely appreciate

32:53 that one.

32:53 Yeah.

32:53 Name is the hardest thing in programming.

32:55 That's right.

32:56 It sure is.

32:56 All right.

32:57 But not this podcast.

32:58 That was a lot of fun.

32:59 Thanks for being here.

32:59 It was.

33:00 Yeah.

33:01 Thank you.

33:01 You bet.

33:02 Bye.

33:02 Bye.

33:02 Thank you for listening to Python Bytes.

33:04 Follow the show on Twitter via at Python Bytes.

33:07 That's Python Bytes as in B-Y-T-E-S.

33:10 And get the full show notes at pythonbytes.fm.

33:13 If you have a news item you want featured, just visit pythonbytes.fm and send it our way.

33:17 We're always on the lookout for sharing something cool.

33:20 On behalf of myself and Brian Okken, this is Michael Kennedy.

33:23 Thank you for listening and sharing this podcast with your friends and colleagues.

Back to show page