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


Transcript #212: SQLite as a file format (like docx)

Return to episode page view on github
Recorded on Wednesday, Dec 16, 2020.

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

00:05 This is episode 212. I can't believe the numbers keep going up.

00:09 I know.

00:10 We're recording this December 16th, 2020. I'm Brian Okken, of course.

00:15 I'm Michael Kennedy.

00:16 I'm Sherry Eskinawes.

00:18 Yay, we have a guest.

00:20 Yes, welcome Sherry. Yeah, it's great to have you here. Thanks for coming.

00:25 Thank you so much for having me. Great to be here.

00:28 Yeah, you got some cool projects and you wrote to us and said, hey, here's a project I'm working on.

00:33 And we're like, well, why don't you just come on the show and tell people about it?

00:36 So we'll get to that later and it'll be a lot of fun.

00:38 Yeah.

00:39 Brian, you should do something with pytest. I heard it's popular.

00:42 Yeah. So, yeah, it might not be a surprise. I am a fan of pytest.

00:47 But I wanted to shout out because the people at pytest have been working pretty hard at making things better.

00:54 And they've got so right now we've got Python 6.2.

00:59 I think I think we're at 6.2.1 now.

01:01 But 6.2 came up recently.

01:03 Oh, neat.

01:04 Look, changelog.

01:05 Cool.

01:07 So there's a few things that I really like that came up with the 6.2 release.

01:13 So pytester, there used to be, I mean, plug-in authors are going to be the only ones that really care about this, maybe.

01:21 But there was a fixture called TestDur that works fine to test your plug-ins.

01:27 But pytester is a way better name.

01:30 And it also uses PythonPath.lib instead of the old file system.

01:37 The OSPath.

01:38 Well, it was a PyPath thing.

01:41 It was similar to PathLib, but their own thing.

01:44 So this is better.

01:45 That's cool.

01:46 Yeah.

01:46 That's clear to use the way it's built in.

01:48 Yeah.

01:50 A couple other features I like.

01:52 Verbose mode.

01:54 Well, there used to be a way to, you had to, if you had a test that was skipped or X failed or X passed, you could add a reason.

02:03 But to get the reason was a little extra work.

02:07 And now you can just turn it into verb.

02:08 If you pass verbose mode, you get those reasons out.

02:11 That's pretty cool.

02:12 And the last one I wanted to highlight, last feature that came up, is a change to the monkey patch.

02:20 So monkey patch is a way, it's kind of like mocking.

02:26 It's a little kind of like a way to easily mock.

02:29 But the thing that changed was a context manager.

02:34 So they added a context manager.

02:35 And so either within a test, you can just, for part of the test, do the patch change.

02:44 Or it's also exposed at the pytest namespace level.

02:50 So you can even use monkey patches in helper functions and stuff like that.

02:54 So that's pretty neat.

02:56 How does that compare to, like, the patching with context block?

03:01 Well, yeah, it's exactly like that.

03:03 So you could use a with block to patch it.

03:07 So...

03:08 Fantastic.

03:08 Cool.

03:10 I think this is great.

03:11 Like, it's cool to see pytest moving along.

03:13 And, you know, there aren't really that many challengers these days, right?

03:16 It's pretty much the leading way to go.

03:19 Yeah.

03:20 I mean, there's still projects that use unit test.

03:22 And there's...

03:23 I don't know why they're still using it.

03:25 But pytest is there.

03:27 The only one that makes sense to me is I don't want a dependency.

03:30 I just want to be able to run it.

03:32 Okay.

03:32 But, yeah, sure.

03:34 There's just that...

03:36 You're not convinced.

03:36 Well, I mean, how many projects don't have dependencies?

03:40 Yeah, that's true.

03:41 The other bit...

03:44 I kind of like it being outside of Python because you can...

03:49 Like, let's say you upgrade your Python.

03:50 You don't...

03:52 I don't think you really want to upgrade your test runner at the same time you're upgrading...

03:57 Well, and also you get a lot higher velocity, right?

03:59 Like, the reason they didn't bring requests in to replace the internal URL HTTP stuff in Python

04:04 was, like, it's going to slow requests down.

04:06 Yeah.

04:07 Yeah.

04:08 So, it would slow pytest down, too.

04:09 And then I got a ping kind of on a related note from somebody that was using a plugin I wrote

04:16 called pytest-check and said, hey, I'm having trouble running this with pytest 6.

04:21 I'm like, oh, my gosh.

04:23 People are using that?

04:24 So, yeah, apparently there are some people using it.

04:27 So, I updated it to run with...

04:29 Now it's compatible?

04:30 Yeah.

04:30 Sweet.

04:31 Sherry, do you do any testing?

04:33 Not with pytest.

04:37 I don't have experience with that yet.

04:39 Yeah.

04:40 Definitely a good one.

04:43 I know of a good book if you want to learn.

04:46 That's right.

04:47 That's right.

04:48 Well, the next thing I want to talk about, it takes a minute for this to sink in here.

04:54 And it's SQLite as an application file format.

04:58 So, we've all heard of SQLite, right?

04:59 It's a database, but it's not a server.

05:02 It's just the file.

05:03 And it's embedded into your application.

05:06 So, it's in process, which actually makes it incredibly fast, right?

05:10 SQLite ships with Python.

05:15 So, you don't have to have any dependencies even to use it.

05:19 You just connect to it.

05:21 You probably do want to have dependencies like, say, SQLAlchemy or something like that.

05:25 But you don't have to, right?

05:27 So, there's a cool thing that's actually part of the documentation, more or less, for SQLite.

05:32 But it was brought to my attention by...

05:35 Over here.

05:37 I'm going to pull up my notes.

05:38 By John Boltmeyer.

05:41 John Boltmeyer.

05:42 Thanks for letting us know about this one.

05:45 And the idea is that we so often, if we have some kind of custom file format for our application,

05:52 whether it's a command line tool or a GUI or maybe even a website, although those often default to databases anyway,

05:58 you have to think about, how am I going to store this file?

06:01 Should we put it in JSON?

06:03 And we could use some XML, Brian.

06:05 Does that sound good?

06:06 No.

06:09 No, no, no.

06:10 XML.

06:11 But, you know, JSON is super popular, right?

06:13 But even with JSON, you've got to figure out, okay, well, these are the blocks and here's how you read it.

06:17 And if some other application wants to talk to it, they need to work with it.

06:21 And there's all these really interesting advantages of saying, well, let's just have a single binary file that is a SQLite database.

06:29 And just that's our file format.

06:32 Much like docx has it, you know, is the file format for Word or xlsx for Excel or, you know, you name it, right?

06:43 All these different apps have their own file format.

06:45 Camtasia has its own and so on.

06:47 That could easily just be a SQLite file.

06:50 So if you go down here in this thing, there's a bunch of things that are highlights.

06:53 It says, look, simplified app development.

06:57 You don't have to write any code to figure out how to work with this file, right?

07:01 Like you've already got the SQLite built into Python.

07:04 Everything's contained into a single file, right?

07:08 So you can just easily move it around.

07:10 It becomes queryable because it's SQL, right?

07:14 So you just select star from tableware, such and such.

07:17 And now your app has search built in.

07:20 That's pretty cool.

07:21 A bunch of tools like we've talked about Beekeeper Studio and things like that.

07:28 They would just load this up and work with it, right?

07:30 So anything that works with SQLite is now working with it.

07:36 Cross-platform, right?

07:37 32-bit, 64-bit, Windows, macOS.

07:41 Atomic, right?

07:43 So multiple things can be working with it concurrently.

07:46 If you make changes to it, you could do like three changes and something goes wrong.

07:50 There's an exception.

07:51 Just rolls it back.

07:53 These things are all pretty cool, right?

07:54 Yeah.

07:55 Yeah.

07:56 So let's see.

07:57 Incremental updates.

07:59 This is another one that's interesting is with, say, something like a JSON file.

08:05 You'd have to load the whole thing up unless you're doing something really intense.

08:09 You would change something small about the file, then you'd write the whole thing back.

08:12 But the way SQLite works is you just make changes to little spots in the binary file as you insert stuff.

08:18 So writes are a lot simpler.

08:21 Super extensible.

08:24 And what else?

08:25 Performance.

08:26 It's a lot faster than, you know, they have compared some other styles.

08:30 Like you could have a pile of files like Git or something like that.

08:34 It's multi-threaded safe so multiple processes can access it, multiple languages, all sorts of stuff.

08:39 And also, finally, documentation.

08:41 Like you want to document how your file format works.

08:44 You just describe what the tables are and what the columns mean.

08:46 And that's it.

08:47 What do you think?

08:51 I actually really like using single file database styles like SQLite for persistence layers because you don't really have to think about it at this point.

09:03 I've also used TinyDB for a similar reason.

09:06 Yeah, TinyDB is interesting.

09:09 I think that uses JSON blocks, a little bunch of JSON files.

09:13 It kind of organizes, right?

09:14 Yeah.

09:14 Something like that.

09:16 Sorry, what do you think of this?

09:17 Yeah, it's, it's, it's, it's, this is actually new material for me.

09:22 So I'm.

09:23 Well, honestly, me too.

09:24 I looked at it and I was like, well, of course I know I can use SQLite, but I just hadn't really put it together.

09:28 Like, well, this is actually a really cool use of a file format that other people can use.

09:33 Yeah.

09:35 Yeah.

09:35 Yeah.

09:36 Yeah.

09:36 There's also a really cool project called Dataset.

09:40 D-A-T-A-S-E-T-T-E or something like that.

09:46 And another one related to it called Dog Sheep, which is a really interesting project that takes all these SQLite and SQL oriented data inputs and allows you to bring them together and do reporting and analysis on them.

10:04 So I did an interview recently with Simon, the guy behind the project over on Talk Python.

10:09 It's not out yet, but it's already recorded and it will be out.

10:12 And there's just all these interesting things you can do once data gets into these common formats.

10:17 So this just is another example.

10:20 And he also pointed out that there's all these different SQLite databases already on your machine, like the photos library for macOS.

10:29 That's a SQLite file.

10:31 Wow.

10:32 Yeah.

10:33 So there's like hundreds of these on your computer and you just didn't know it.

10:36 So anyway, this is hopefully solve some problems for people trying to create, you know, what are we going to do for our app format?

10:43 You know, our equivalent of Doc X.

10:45 What's that going to be?

10:46 Well, it definitely could be one of these.

10:47 Yeah.

10:50 That's pretty cool.

10:52 Yeah, definitely.

10:52 Yeah.

10:52 Yeah.

10:52 All right.

10:59 Next up, Sherry, tell us about your project.

11:01 This is the one I mentioned before.

11:03 Yeah.

11:04 So I'll start off by saying I noticed that kids' programming books are either really abstract or they don't teach the reader how to write a simple program or they're too, it's either that or they're too intensive in the format of a textbook or a book made up of a lot of tutorials with step-by-step instructions.

11:20 And so that's why I thought of taking a different approach by creating a programming book in the form of a picture book that tells a story with complete computer programs that represent real-life situations.

11:30 So my latest book is called A Day in Code Python, and it's now live on Kickstarter.

11:34 It tells a story using Python programs that describe real-life situations in the code.

11:39 And so for each two-page spread in the story, there's a code page that has a complete Python program that describes a situation in the story and a full-page illustration next to it that shows the scene that's being described.

11:51 So in that way, the book is presenting Python code examples in a continuous story, and the code is explained below each program.

11:59 And each program presents a new Python concept.

12:02 And so you might be wondering, like, why did I choose a picture book?

12:05 And so there's a few main reasons why I thought of doing that.

12:09 And so, of course, the most obvious is that a picture book is fun and colorful, and who doesn't like a picture book?

12:15 But I also wanted to show that everyday events can be described with the logic of code, and I think the programming concepts can be better understood by making the code relatable.

12:26 And I also wanted the book to be compact and show code examples conveniently.

12:30 So as a beginner, you don't need to dig through a big book looking for basic code examples.

12:35 And also, by having nice full-page illustrations, my aim is that the reader and kids especially will enjoy the book in the same way as a normal picture book that is flipped through again and again.

12:47 And while they're enjoying the pictures, they'll be looking at the code too.

12:51 And their understanding of the programming concepts will be reinforced.

12:55 And so this book will be in the same format as my first book, A Day in Code, which is written in the C programming language.

13:03 And that book was actually released a few weeks ago on Amazon, and I had previously launched a Kickstarter campaign for it.

13:10 And after delivering the book, I got a great response from kids to college students to adults.

13:16 So it's really for all ages.

13:18 And so now I'm focused on creating a Python version of that book.

13:22 And you can pre-order it in code.

13:23 Yeah, I think a Python book makes a lot of sense because it's the most popular learning programming language these days, right?

13:31 Yeah, it's definitely been gaining in popularity.

13:34 Yeah, very popular.

13:36 It's everywhere.

13:37 I like the idea of just sort of letting it wash over kids, right?

13:44 Maybe the goal isn't necessarily, it might not be to teach them programming and have them come out the other side of interacting with the book, actually writing code.

13:52 But kind of seeing the examples and just making code something that you kind of talk about, like reading or like writing or like history or anything.

14:01 So it's a cool format.

14:03 What do you think, Brian?

14:03 I think this is great.

14:05 So do you have like a target age in mind?

14:09 So that's why I say like, well, of course, being a picture book, it's great for kids.

14:15 But I've also gotten a lot of people, adults who say that they enjoy it too.

14:19 And it's just a fun format for anyone to enjoy starting to learn programming or even just looking at it as a reference.

14:28 Even if you're experienced in programming or maybe you want to refresh your memory, it's just a convenient way to look back at simple code examples that go over all the basics of Python.

14:39 So functions, dictionaries, lists, tuples, all that stuff.

14:43 Yeah.

14:45 And it's almost funded on Kickstarter.

14:48 So it sounds like you're going to make it happen.

14:50 You're like $1,000 away.

14:51 And I'm sure people are interested.

14:54 Well, I'm going to like order one.

14:57 So thank you.

14:59 This looks great.

15:01 Yeah.

15:01 So once you get it funded, when do they come out?

15:05 So right now, the estimated delivery time is in April.

15:09 And it'll be a special edition book.

15:11 So I'm actually getting it printed at a U.S.-based facility that allows me to print with glossy paper, 100-pound paper,

15:21 and have a feature of having printed end sheets at the front and back of the book.

15:25 And so these features aren't available once the book goes on Amazon.

15:29 Cool.

15:31 Yeah.

15:32 Great project.

15:34 Happy to see it gaining some traction.

15:37 Hopefully people can make it happen because it'll be neat.

15:39 Yeah.

15:40 Thank you so much.

15:40 Yeah, absolutely.

15:42 So Brian, before we move on to the next one, speaking of books, maybe tell people about what we're up to so they can support us if they wish.

15:51 Yeah, well, the best way to support, let's say, me is by picking up a copy of Python Testing with pytest.

15:59 I still get feedback all the time of people thanking me for writing this because it helps them in their job, helps them get stuff done better.

16:08 So it's really awesome.

16:09 Yeah, absolutely.

16:12 And then if they want to learn some more about all sorts of types of Python, they should probably check out training.

16:18 They should.

16:19 Like, we've got a couple of new courses.

16:21 I just released the FastAPI course a couple weeks ago, and that is such a neat framework.

16:25 We also have our Excel to Python and the Python Memory Management Tips Deep Dive course.

16:31 So those and many more are out there for people to take.

16:34 If they're interested and they want to learn Python, there's a whole bunch of ways.

16:39 The Day in the Code, pytest, and then these courses as well.

16:42 I always forget that you have a memory management one.

16:44 Yeah, that's ironic, isn't it?

16:47 So.

16:54 Yes, Barry.

16:55 I don't.

16:56 Are we doing this next?

16:57 Okay, cool.

16:58 Yeah, this is what's next, yeah.

16:59 Nice.

17:00 So I can't believe we haven't done this, but actually, partly because I can't believe I just noticed this.

17:07 So I didn't know about this.

17:09 Yes, Barry, there is a Python Labs.

17:11 So it's pretty funny.

17:17 So this is at azure.pythonlabs.com, and it used to be just normally.

17:24 at www.pythonlabs.com.

17:27 So it's moved.

17:28 But this is back from, this is kind of an inside Python joke.

17:32 It's back, Tim Peters posted it in 2004.

17:36 And apparently it's a question, there was a question from Barry.

17:41 It just says Barry.

17:42 I'm assuming it's Barry Warsaw.

17:43 Yeah, I would guess.

17:44 Asked the question, what is Python Labs now?

17:48 Or is there a Python Labs now?

17:50 I don't know.

17:51 Guido owns the domain name, which is probably the biggest claim to Python lab hood there is.

17:56 And then Tim Peters replies with a very, yes, Virginia, there is a Santa Claus-esque answer.

18:04 And I just encourage people to go read it.

18:07 It's hilarious.

18:07 There's stuff like, Barry, your little friends are wrong.

18:12 They've been affected by the skepticism of a skeptical age.

18:16 Yes, Barry, there is a Python Labs.

18:18 It exists as certainly as love and generosity and devotion exist.

18:23 Alas, how dreary would be a world with no Python Labs.

18:26 So it goes on like that.

18:28 And it's pretty funny.

18:30 So I encourage people to check it out.

18:31 How funny.

18:33 Have you seen this before?

18:35 I've never seen this.

18:37 And apparently it's from 2004 originally.

18:39 But now it's on Microsoft Azure.

18:41 And I'm wondering if this has anything to do with Peter Van Rossum moving over to Microsoft.

18:47 Yeah, I assume so.

18:49 I was going to try to look at where I found this.

18:52 And I think just somebody mentioned that it moved to Azure a couple months ago or recently.

18:58 Yeah, yeah, funny.

18:59 You know, another piece of news I caught that was not officially on the radar.

19:04 But a friend of the show and our friend, Anthony Shaw, he is headed towards Guido as well.

19:11 You hear that?

19:12 I did.

19:13 Yeah, he joined Microsoft as some kind of Python specialist.

19:18 I'm not sure.

19:19 So I hope they throw some money on him to try to move him to the Northwest.

19:24 That would be cool.

19:25 That would be cool.

19:26 Yeah, that we could hang out with him more.

19:27 He's far away.

19:28 He's in Australia, which is a long way.

19:29 But it's going to be hard for him to leave.

19:30 He lives on the beach in like a picture.

19:33 Yeah.

19:34 Yeah, anyway.

19:35 He always posts his like, you know, surfing report and stuff like that.

19:39 Exactly.

19:40 Because life's hard sometimes.

19:42 We surf in Oregon.

19:43 Yeah.

19:44 With wetsuits.

19:45 For about five seconds.

19:46 Yeah.

19:46 And we change color.

19:47 Then we come out.

19:48 All right.

19:51 Let's see.

19:52 What's the next one here?

19:53 I think.

19:54 Yeah.

19:54 So remember, Brian, I did an extra, extra, extra, extra the other day.

19:59 Yeah.

20:00 That was fun.

20:00 Do more of that.

20:01 Because I had so much stuff.

20:02 Well, let's do an extra, extra, extra, extra, extra, extra this time.

20:06 Because, oh my goodness, there is so much stuff.

20:10 I'm not just going to turn this into another element here of the show.

20:14 So first of all, we spoke about NumPy in installing.

20:17 I think it was on Big Sur.

20:18 It was having some problems.

20:19 It wouldn't install correctly.

20:22 I don't remember if it was Windows or Linux or macOS.

20:26 I think it felt like it was macOS.

20:28 But anyway, it was a problem with one of the platforms.

20:30 But what was interesting is I got a message from Grice that, hey, quick follow up on episode

20:36 208.

20:38 Did you know?

20:39 I didn't know.

20:40 Did you know that in your requirements TXT file, you can say like NumPy equal equal one dot

20:48 19 dot three semicolon and then platform.

20:51 So you can say platform underscore system equal equal Windows.

20:54 Then another different version of NumPy platform equals Linux.

20:58 Another one platform equals Darwin.

21:01 Isn't that cool?

21:03 Yeah.

21:04 I had no idea.

21:05 You could kind of split the requirements file to say the Windows install gets this and the

21:11 Linux install gets that.

21:12 Oh, that's cool.

21:13 Yeah.

21:15 Yeah.

21:15 I had never seen this.

21:16 But the problem was NumPy was not.

21:19 Oh, it was Windows update that broke NumPy.

21:21 That's what it was.

21:22 And so here's a way to pin the Windows version to an older NumPy, but let the other stuff be

21:28 newer.

21:28 That's what it was.

21:30 So here's a really simple way to fix that, huh?

21:33 Yeah.

21:34 I hope I never need this trick.

21:35 Yes, exactly.

21:38 And then I got another message from William Silva.

21:44 And he said, hey, check this thing out.

21:46 There's, you probably heard of material design, the way that Google styles some of their apps

21:52 and so on.

21:53 And we've all heard of probably the best way to build cross-platform apps with sort of native

22:00 widgets.

22:01 You know, maybe Electron's the best way, but native widgets would be with Qt and PySize.

22:07 PySize 6 and probably PyQT.

22:12 I don't know if it's upgraded yet, but there's this cool theme that you can put on to make

22:16 it look material.

22:17 Doesn't that look neat?

22:18 Oh, that is neat.

22:19 I like it.

22:20 Yeah.

22:20 Yeah.

22:20 So often these cross-platform apps, they just look, boy, I don't know.

22:25 They just look like they're standing out weird, but this looks really nice here.

22:29 I totally like it.

22:30 So I'll put that in the show notes.

22:33 People can check that out.

22:35 Number three, I just announced this.

22:37 I thought it was pretty neat.

22:38 I wrote a blog post that talked Python hit 20 million downloads and is the number two developer

22:45 podcast out there.

22:46 I just found out.

22:47 I wrote a blog post just sort of celebrating that.

22:49 That's very impressive.

22:52 Yeah.

22:53 Good job.

22:53 That's crazy.

22:53 Yeah.

22:54 Thanks.

22:54 Thanks.

22:55 And by the way, Python bytes is around 6 million and going.

22:58 So we're pretty strong over here as well.

23:00 Nice.

23:01 Yeah.

23:01 Awesome.

23:02 Pyramid.

23:03 Pyramid 2, the web framework is coming out and I actually tested it.

23:08 Talk Python training, which is about 25,000 lines of Python is written in it.

23:12 Just upgraded it.

23:13 Ran everything.

23:14 All the pytests pass.

23:16 Everything else is good.

23:18 So Pyramid 2 is looking solid.

23:20 Not too much change, but it's good to see how it's going.

23:22 Oh, Python 3.9.1 is out with 282 changes from, that's a lot.

23:30 Well, let's go through them all.

23:31 Yeah.

23:32 Okay.

23:32 Well, I'm going to say it like 10, 10, 10 X speed, if you don't mind.

23:35 Now, the other notable thing, almost the reason I'm bringing this out is that the Python on

23:40 macOS also ships as a universal binary, which means it has an Intel version and an Apple M1

23:45 version.

23:46 Oh, nice.

23:47 Which leads to all sorts of interesting weirdness when you pip install things that expect Intel.

23:53 But nonetheless, it's out there and people can start playing with it.

23:56 I actually did a stream, live stream number six with Paul Everett from JetBrains.

24:03 So we're exploring what's the Python experience on the Apple M1 Mac mini.

24:07 So that's like an hour long video he and I did last Friday.

24:11 And I will link to that.

24:13 You can check it out.

24:14 Well, what's the punchline though?

24:15 The punchline is almost everything works, but we couldn't get JupyterLab to work for some

24:20 reason.

24:20 Oh, okay.

24:21 But everything else seemed to be pretty much fine.

24:24 But the trick is you kind of need a lot of times you're going to work with something that

24:30 maybe doesn't have an M1 version of the package or the wheel.

24:34 But if you go to the terminal and you create a copy of it and then you tell it to run under

24:42 Rosetta, every Python command you issue becomes a Intel Python command.

24:47 So if you pip install something, it'll use the wheels for the Intel version of Mac, not the

24:54 M1 version of Mac and stuff like that.

24:57 So it's kind of your escape hatch.

24:58 Like once you open up that terminal, you've fallen back into the Intel world.

25:02 So you don't have compatibility issues there.

25:04 Okay.

25:06 Anyway, we did a ton of that with stuff.

25:10 Sherry, do you have an M1 Mac?

25:12 Are you on?

25:12 No, actually.

25:13 I'm not on a Mac.

25:15 I'm not on that.

25:16 What's your OS of choice?

25:18 Well, Microsoft.

25:23 Yeah, Windows?

25:24 Yeah.

25:24 Awesome.

25:25 Yeah.

25:26 Yeah, they're doing good stuff.

25:27 Like there's a ton of Python things happening over there.

25:29 That's pretty exciting.

25:30 All right.

25:31 And then last thing, this is brand shiny new, is we have the Python steering council selected.

25:38 We have Pablo Galindo.

25:40 We have Carol Willing, Brett Cannon, Barry Warsaw, and last one, T. Wooders were all selected to

25:53 be the new steering council.

25:55 folks.

25:56 So that's exciting.

25:58 Yeah.

25:59 Yeah.

25:59 That's it.

26:00 Those are my extra, extra 6X extras.

26:02 Well, cool.

26:05 Yeah.

26:06 Awesome.

26:06 And I guess last thing to talk about is a little computer vision.

26:12 Yeah.

26:13 Yeah.

26:13 Yeah.

26:13 Yeah.

26:13 Yeah.

26:13 Yeah.

26:13 So this is like a really cool product I found out about a few years ago.

26:18 And it's called OpenMV cam.

26:20 And it's called OpenMV cam.

26:20 And it's the latest one.

26:21 It's a microcontroller development board with an onboard camera that runs machine vision algorithms

26:26 with MicroPython.

26:28 The OpenMV IDE and libraries make it really easy to run complex machine vision algorithms

26:33 with simple Python code for things like color tracking, face detection, eye tracking.

26:39 One particular application that I really like, which I did, is detecting April tags, which

26:45 are like QR codes in that there are 2D binary pattern squares, but they encode a much smaller

26:51 amount of bits between 4 and 12 bits rather than a QR code, which can store up to 3 kilobytes.

26:58 And so by storing encoding a smaller amount of data, it makes them easier to detect and

27:03 be able to be robustly detected with variations in the camera viewing angle and the lighting

27:08 conditions.

27:09 And they can be detected from a longer distance.

27:12 And so it's just so convenient because the OpenMV IDE has an April tag generator.

27:19 So you can easily create the tags and print them out.

27:22 And it has an April tag MicroPython library.

27:26 So you can easily implement the algorithm and the code will return the rotation and the ID

27:32 code, among other information about it.

27:34 And the company OpenMV has said they want to be the Arduino of machine vision because they

27:41 have such an Arduino-like user interface.

27:44 And you can view the output of the camera in the IDE.

27:46 And they actually just announced a few weeks ago that they're now partnered with Arduino to

27:51 support computer vision on a new wireless Arduino board called Portenta 8.

27:56 7 with OpenMV firmware and the OpenMV IDE programmed in MicroPython.

28:02 So it's really cool to be able to easily implement these complex machine vision algorithms with just a few

28:09 lines of Python code on a plug and play STM32 microcontroller board.

28:15 Yeah.

28:16 Do you know what it costs?

28:17 The latest one, I think it's, I got it, it's like 60, around $60.

28:22 I'm trying to remember now.

28:24 Oh, yeah, 65.

28:25 Yeah, yeah, 65.

28:26 That's to set up a little computer vision system for 65 bucks.

28:30 That's cool.

28:31 Yeah.

28:32 I mean, I was very impressed.

28:35 So I was just taking out of the box and running this example code that came with the IDE and was able to

28:41 detect these April tags.

28:42 And it's interesting to see how it compares to QR codes and they're more robust in detecting.

28:48 Yeah.

28:50 Okay.

28:51 Yeah.

28:51 And they have a little code example here that's quite straightforward, right?

28:55 You just set the pixel format, how many frames, and then take a snapshot and run things like image.findblobs and like magic happens on that line.

29:06 Yeah.

29:08 Yeah.

29:10 That's super cool.

29:11 So one of the things that I've always wanted to do, and I don't know if I'll ever do, but I want to create an IoT course.

29:19 And I would like the final exercise of the course to be setting up a camera so you can have a multiplayer or a computer against human game, but have the computer do it through computer vision.

29:31 So over like a checkers board or a tic-tac-toe, like you draw on it, the computer looks at it and says, I want to go there.

29:38 That would be so fun.

29:40 It looks like this might be something I could use to make that happen.

29:43 Yeah, definitely.

29:45 I read that you can run TensorFlow Lite on it too, so you can train AI.

29:51 You can train models for AI with TensorFlow running on this.

29:56 Run it right on the device, not shipping it to the cloud.

29:59 Yeah.

30:00 Yeah.

30:00 That'd make it really responsive.

30:01 That's cool.

30:02 Brian, what do you think?

30:04 What would you do with it?

30:05 I think you should run with that board thing and do a chess thing.

30:10 You should get into robotics also and have it just move it.

30:17 The claw comes out, grabs it.

30:20 How about Settlers of Catan?

30:25 Come on.

30:26 If we could automate Settlers of Catan.

30:29 And your would be even better, actually, would be not just have the computer play, but in

30:35 this whole weird social distancing, bizarro world we live in.

30:39 You could set it up so you and your friends just play and both have a board and the thing

30:46 just tells you, oh, your friend moved here.

30:47 You got to move that over.

30:48 That'd be great.

30:49 I've never even got through the instructions on Settlers of Catan yet.

30:52 One of my daughters loves it and one of them hates it.

30:55 They're like, please, we can't play.

30:56 It takes so long.

30:56 We can't do that.

30:59 Yeah, it's funny.

30:59 But anyway, I think this is a cool device and it'd be really fun to play around with it.

31:05 65 bucks for the whole thing.

31:08 That seems pretty affordable.

31:09 Yeah.

31:10 Yeah, definitely.

31:11 Yeah.

31:12 Awesome.

31:13 All right.

31:14 Well, what else have we got?

31:17 I don't have any extras, Brian.

31:20 I've already gone through my six extras.

31:22 You got any extras?

31:22 I just have one shout out to, I guess, the Python community on Twitter.

31:28 I just want to say, I don't know.

31:30 I'm getting a little cheesy today near Christmas.

31:32 But this is a sort of a silly thing.

31:36 But I saw there was a discussion on Twitter.

31:38 It happened last night and today.

31:41 There was somebody named Nicole Carlson that started this question of, do you say for K-W-A-R-G-S, do you pronounce that keyword arguments or do you pronounce it quarks?

31:54 Oh, my gosh.

31:57 And I had never considered pronouncing it quarks before.

32:00 How about you, Michael?

32:01 I think I did.

32:03 I think I do say quarks.

32:04 No, no.

32:06 I say K-W-R-G-S.

32:07 That's what I say.

32:08 Okay.

32:08 Yeah.

32:09 So that was brought up by a couple of people that they use that.

32:11 Yeah.

32:11 K-W-R-G.

32:13 That's what I say.

32:13 And so I just, I'd never even consider, I like quarks.

32:16 I'm going to start using that now.

32:18 Sounds like it comes from Star Trek.

32:20 But, yeah.

32:21 A Klingon word.

32:22 I don't know.

32:23 Or, yeah, or quark from Deep Space Nine.

32:26 Yeah.

32:27 So Vicky Boykas said, I've never even considered not saying quarks.

32:32 And a whole bunch of other people had different comments.

32:35 And I just wanted to bring this up because it reminded me of like a conversation we'd have over beer or something at PyCon.

32:43 Or in the, you know, in the hallway or something like that.

32:47 And that little bit of just stupid conversation around Python, I just really appreciate it.

32:55 And I like that that little bit is alive on Twitter at least a little bit.

33:00 So.

33:01 Yeah.

33:01 Funny.

33:02 Sherry, how do you say it?

33:04 Oh, gosh.

33:05 I am actually, I don't normally say that.

33:08 You know what's funny is like when you, there's all these different little acronymy.

33:13 words and programming.

33:14 And it's funny when people, they mostly just read them the whole time and all of a sudden they have to say them.

33:22 Right?

33:22 Like pypi.org.

33:27 Right?

33:27 Like some people say PyPy and some people say IPI and so on.

33:31 Right?

33:31 I'm on the PyPI side.

33:33 But it's just, you know, sometimes you don't have to pronounce it.

33:37 But sometimes you do.

33:38 Yeah.

33:38 I'm not sure what side to take on this issue.

33:40 Yeah.

33:41 This changed my life though.

33:42 I'm going to, it quarks all the time now.

33:44 Right on.

33:45 Sounds good.

33:46 Sherry, anything else you want to give a shout out to while we're here?

33:50 I don't know.

33:52 I mean, just thank you.

33:53 Thank you so much for listening.

33:54 And thank you for checking out my Kickstarter campaign for a Dan Code Python.

33:59 Yeah.

33:59 Yeah.

33:59 It's good to have you here this time.

34:00 All right.

34:01 Brian, I think we should finish it with a joke.

34:04 What do you think?

34:04 Sure.

34:05 All right.

34:06 So I'm having this problem.

34:08 I lived in this apartment complex, the fourth floor, the fourth apartment on that floor.

34:16 And yeah, the number of the apartment was 404.

34:21 But, you know, what's the problem?

34:22 404 apartment not found.

34:26 Exactly.

34:26 Every time I order a pizza, the delivery guy tells me he couldn't find the place.

34:30 Was that really your apartment?

34:33 No, I wish I was.

34:34 That would have been awesome.

34:35 No.

34:37 I lived on 214.

34:38 I don't know if that's an HTTP status code, but that's as close as it's been.

34:42 108.

34:43 I don't know what 100s even really do.

34:45 And I know they're status codes, but I don't know 108.

34:48 I'll stop my head either.

34:48 But this one, this is a good one.

34:51 I like it a lot.

34:51 I like that too.

34:53 Well, I got one last joke.

34:56 Okay.

34:57 So why do software developers or many of them prefer dark mode?

35:02 Why?

35:05 Tell us.

35:06 Because bugs are attracted to light.

35:08 Oh, yes.

35:10 Awesome.

35:10 I heard this on Twitter.

35:12 It's terrible.

35:13 And I told my family.

35:16 It's one of those, sometimes some jokes you tell your family and they just stare at you.

35:22 Yeah.

35:22 Yeah.

35:23 They don't get it.

35:23 All right.

35:24 Really quick.

35:24 I want to follow up with one comment from the live stream.

35:27 And if you're not listening, you're not interested, you don't know about yet the live stream.

35:31 We're also streaming this onto YouTube now.

35:33 So check out pythonbytes.fm/YouTube and you can subscribe to the upcoming live streams.

35:38 But Brian, there's a question here.

35:43 When's your second edition coming out?

35:45 Come on, man.

35:46 There is no planned date.

35:48 Okay.

35:49 And then also we have the German version of KW Args.

35:53 I say KV Args.

35:57 KV Args.

35:59 That's just like saying KW, the German pronunciation, Args.

36:04 Yeah.

36:05 Awesome.

36:05 All right.

36:06 Well, thanks so much.

36:08 Sherry, thanks for being here.

36:09 Thank you so much.

36:10 Thank you.

36:11 That was really fun.

36:12 Yeah, you bet.

36:13 Bye.

36:13 Bye, everyone.

36:14 Thanks for watching.

Back to show page