Learn Python with Talk Python's 270 hours of courses

#342: Python in Architecture (as in actual buildings) Transcript

Recorded on Sunday, Nov 7, 2021.

00:00 At PyCon 2017, Jake Vander Plaats gave a great keynote where he said Python is a mosaic.

00:05 He described how Python is stronger and growing because it's being adopted and used by people

00:10 with diverse technical backgrounds.

00:12 In this episode, we're adding to that mosaic by diving into how Python is being used in

00:18 the architecture, engineering, and construction industry.

00:20 Our guest, Gui Talrico, has worked as an architect who helped automate that world by bringing

00:25 Python to solve problems where others were just using point-and-click tooling.

00:30 I think you'll enjoy this look into that world.

00:32 We also touch on his project, PyAirtable, near the end as well.

00:35 This is Talk Python to Me, episode 342, recorded November 7th, 2021.

00:42 Welcome to Talk Python to Me, a weekly podcast on Python.

00:59 This is your host, Michael Kennedy.

01:00 Follow me on Twitter, where I'm @mkennedy, and keep up with the show and listen to past

01:04 episodes at talkpython.fm.

01:06 And follow the show on Twitter via at Talk Python.

01:09 We've started streaming most of our episodes live on YouTube.

01:13 Subscribe to our YouTube channel over at talkpython.fm/youtube to get notified about upcoming

01:19 shows and be part of that episode.

01:21 This episode is brought to you by Shortcut and Linode, and the transcripts are sponsored

01:26 by Assembly AI.

01:28 Dee, welcome to Talk Python.

01:31 Thanks.

01:31 Happy to be here.

01:32 Yeah, it's fantastic to have you here.

01:34 I'm really excited to talk about buildings and architecture and that kind of stuff just

01:40 permeates our lives, right?

01:41 That's, you walk around, you go to cities, you marvel at the large buildings, go to someone's

01:46 house, and it's this beautiful place.

01:48 Really nice to see.

01:49 All that starts with good architecture and design, right?

01:52 Yeah, that's right.

01:53 Where we live, where we work, pretty much most of our lives we spend inside some sort of structure.

02:01 Exactly.

02:01 Exactly.

02:02 Cool.

02:02 Well, we're going to talk about that.

02:03 Before we get into that, though, let's just start with your story.

02:06 How'd you get into programming in Python?

02:07 Yeah, it was a bit of a long journey to Python.

02:09 I think my first experience with programming was actually with Lego Mindstorm.

02:15 I don't know if you're familiar with it.

02:16 Yeah.

02:16 A little robot thing, right?

02:18 Yeah.

02:18 You can program those with Python, can't you?

02:20 Yeah.

02:20 I don't know what it looks like these days.

02:22 I guess when I got it, I was maybe, yeah, in my early teenage years or something.

02:26 And at the time, they had something that was similar to MIT's Scratch kind of block, plug and play.

02:32 So I did a little bit of that.

02:33 And then later, I tried to learn Visual Basic 6, I think also in my early teenage years.

02:40 And that was fun.

02:42 I built a couple little personal projects.

02:44 I feel like we still don't have something to take the place of Visual Basic 6.

02:49 Yeah.

02:49 Yeah.

02:50 Do you think so?

02:51 I mean, I look around at all the different UI platforms, whether that's the stuff we have

02:56 in Python or whether that's Swift or whether that's .NET with WPF or whatever else you want

03:03 to talk about.

03:04 Nothing is as easy as, I want these buttons here in a text box and a list and I double click

03:09 it and I write three lines of code and that happens, right?

03:12 Yeah.

03:12 The environment has changed, right?

03:14 Because before they were just desktop apps, right?

03:16 You would build it and that's it.

03:18 And now you have to think about, even if.

03:21 React has made it as easy to build front end app, you still have to deal with something

03:25 else for styling and then you have to figure out how you're going to serve the data or are

03:29 going to deploy it to you.

03:30 Yeah.

03:31 I think you're right.

03:32 I mean, I'm not saying VV6 is the pinnacle of what we could design, right?

03:36 It's not going to win massive design awards, but wow.

03:39 Could people get stuff done quickly with that framework?

03:42 Yeah.

03:42 So you did a little bit there, huh?

03:44 Yeah.

03:44 I never got too deep, but it was an extension of a robotics course that I was taking.

03:47 So we were building these little UIs and then clicking around and having the robot move or

03:52 something.

03:53 So it was very basic UI.

03:55 But what was interesting is at the time I grew up in Brazil and at the time it was still there

04:00 and I wanted to get really deep, but there was this, there was a bit of a language barrier,

04:03 I think.

04:04 This was also, you know, pre-Google.

04:05 So trying to learn how to program while also not knowing how to speak English, I actually

04:11 feel like it slowed me down a bit.

04:13 Yeah.

04:14 I can imagine.

04:15 I've always had a lot of both respect and I guess a little bit of sympathy for people

04:20 who are non-native English speakers, especially people who didn't particularly speak English

04:26 super well, but then had to program with for loops and while loops and true and false and

04:32 ints.

04:33 And it's just like, if, you know, maybe if you're with a language that's not that different,

04:38 it's not that hard, but you know, if you're like Chinese or even Portuguese, it's, you know,

04:43 why do you have to program all these foreign words?

04:45 It just seems crazy to me that that's how it has been, right?

04:49 Yeah.

04:49 And also the resources even today with post-Google era or during the Google era, you can, if you

04:56 search for some sort of engineer problem in English or in Portuguese, I can guarantee you're

05:01 going to get a much bigger pool of answers and resources in English.

05:05 So yeah.

05:06 Yeah.

05:06 Yeah.

05:07 That was a little bit of a barrier.

05:08 In fact, what actually happened is I never really progressed and I just went on to other

05:12 things.

05:12 All right.

05:13 Maybe this program and things not for me.

05:14 Yeah.

05:15 I don't know.

05:16 I guess, yeah, I just kind of didn't really get it.

05:18 Never really clicked.

05:19 And then I moved on to other things and ended up pursuing a degree in architecture to talk

05:25 a little bit about it, but it was a little bit of kind of a gap.

05:28 And then I think it was just during my college years, I tried getting into a little bit of

05:33 web development, played around with action script, flash, or I think that's what it's called.

05:38 Right.

05:38 It was like JavaScript, like inside flash.

05:41 And then within architecture, I got a little bit into like visual programming, which

05:46 it's, I guess, a more sophisticated version of, you know, scratch, but similar to what

05:50 3ds Max uses to compose material.

05:52 You know, this idea that you can kind of connect flows into each other visually.

05:57 And that's used pretty extensively in architecture still.

06:00 And that was kind of like my gateway back into programming in some ways.

06:04 And then a couple of years later, I actually practiced architecture for, I think about five

06:08 or six years.

06:10 And at the time I was trying to figure out how I could change careers.

06:13 And I was just, I had this kind of itch.

06:16 I just really wanted to write code and I couldn't figure out how to kind of break it.

06:19 And I ended up doing this process of changing careers.

06:22 I actually took a year off and spent every kind of brief minute I had trying to learn how

06:28 to code.

06:28 Was that on your own or did you go to university?

06:31 Yeah, it was just on my own.

06:32 Yeah.

06:33 Literally like Google, what language should I learn first?

06:36 And this was like 2014, I think 15.

06:40 And I actually picked Ruby first.

06:42 This was Ruby on Rails.

06:44 Yeah.

06:44 Golden years, I guess.

06:45 And I started with Ruby and after a couple of weeks, I just didn't enjoy it that much.

06:51 I was getting confused with some of the basic kind of built-in blocks and I decided to try

06:56 Python and it was just kind of smooth sailing.

06:59 I mean, I guess as smooth as it can be learning by yourself.

07:02 Yeah, yeah, sure.

07:03 But, you know, I felt like even the basic grammar, it was just kind of stick.

07:07 I didn't have to keep going back and say, oh, how do you do a for loop again?

07:11 I found it was always a bit stickier with me, not having to think about where semicolons

07:16 would go, you know.

07:17 Yeah.

07:18 It was just easier and smoother and more enjoyable for me in general.

07:21 For sure.

07:22 Well, I gave VB a lot of positive praise a little bit ago.

07:27 I think also that language is a really interesting example of how to try to be like,

07:33 Python, but not do it well.

07:34 So, with JavaScript or C# or a lot of these languages, you have all these symbols

07:40 on the screen, especially the static languages.

07:42 C#, Java, C++, right?

07:44 Semicolons, angle brackets, you know, parentheses, all sorts of stuff all over the place.

07:49 And then there's languages like Python that say, you know, you don't need that.

07:52 You don't need all these symbols.

07:53 Let's just go and write it.

07:55 And, you know, VB is like that, right?

07:56 There's no semicolons.

07:57 There's not that many symbols.

07:58 But it's like everything is begin for, end for.

08:03 Like, it's just, it's the worst possible.

08:05 It's like they still need the closing curly braces and stuff like that, but they don't want to

08:09 put a curly brace.

08:10 So, they make you type like a huge long word, which is crazy.

08:13 And somehow Python struck that like smooth balance of not having all that stuff, but not giving

08:19 up too much as well.

08:20 Yeah, and also the boilerplate that's required.

08:23 I think I had tried doing some C# as well.

08:26 And when you open up the simplest example you can find, and it's class, void, public.

08:32 And you're like, wait, what is public?

08:34 You haven't gone to understand classes or access and things like that.

08:40 And it's really overwhelming.

08:41 And in Python, it's like, even the class takes a little bit when you're learning, but you can

08:46 just, here's a function that's inside of this object.

08:49 And it's much easier to understand, I think, as a beginner.

08:52 It's kind of ramp up.

08:53 I think it's a big testament that you can be really effective with Python with a super, like

08:59 a very partial understanding of what Python is or how it works, right?

09:02 You can not even be aware that half of the stuff exists and you can still get along just

09:06 fine.

09:06 So, that's pretty awesome.

09:08 So, let's dive into the main topic, buildings, architecture.

09:12 So, I've seen some of the presentations you've given, and it sounds to me like this is an industry

09:18 that's ripe for more programming, automation, empowerment.

09:23 You know, I always say that programming is a superpower for people who are not programmers,

09:28 right?

09:28 If you're an architect versus an architect who programs, the programming architect can do way

09:33 more, right?

09:34 And it sounds to me like this area is kind of open for more of that.

09:38 Yeah, absolutely.

09:39 Give us the background.

09:40 So, it starts with pictures and drawings and blueprints type things, right?

09:44 Yeah, yeah, exactly.

09:45 So, I mean, I guess I should just preface this with the fact that I've been outside the industry

09:49 for about four years now.

09:52 I'm just doing more traditional software development.

09:55 So, I may be a little bit out of the loop on some changes, but in general, the time I spend

10:00 in the industry, what you would see is that it's still a pretty kind of analog industry.

10:05 And there are parts that are improving.

10:07 There are parts that are very advanced.

10:08 I mean, we do still manage to build incredible buildings.

10:12 But there's this weird kind of tension where people are coming up with these design concepts

10:16 and figuring out what the building is going to look like, what spaces you're going to need.

10:20 And then kind of at the other end, you have people standing on their literally cutting material

10:27 and assembling things.

10:29 And then there's this big kind of gap in the middle of how you go from one thing to another.

10:33 And that's kind of the meat of architecture.

10:36 So, my experience was primarily medium and large buildings.

10:40 And it's actually just very labor-intensive labor as far as software, not the hands-on labor

10:47 for architects.

10:48 But there's just a lot of work that goes into designing a big building.

10:52 So, if you have a, I don't know, one of the office buildings I worked on, 150,000 square

10:58 feet, six-story or something.

10:59 And someone had come up with a design, okay, it's going to look like this.

11:04 And it was very conceptual design, kind of massive.

11:06 And then you have to turn into a real project with faucets that work and lights and sprinklers.

11:13 Exactly.

11:14 When you think, well, let me rephrase that.

11:16 When I think of architecture, I think of the overall feel of it, right?

11:21 Is it flowing?

11:22 Does it have sharp edges?

11:24 Does it feel modern, right?

11:26 And so on.

11:27 I have a picture here on the screen for us to look at that's this, you know, sort of

11:32 wood structure.

11:32 It's light and airy.

11:34 And sure, that's architecture.

11:36 But it sounds like, and so are the support beams.

11:39 So is the plumbing.

11:40 So is the light switch and where they go.

11:44 And just way more detail than just the general skeleton or structure.

11:49 Yeah, and like which part of the plywood is going to go in which direction, like on your

11:54 kitchen counter or something, like that level of detail.

11:57 But what you're showing here, it's kind of what you see in school and what you get really

12:01 excited about in school.

12:02 And then when you start working, you realize that there's only a few people that get to

12:06 do this type of work.

12:07 And the majority of the people are just kind of doing coordination and working on lots of

12:13 drawings and coordination between different trades.

12:16 But, you know, of course that does happen, but big chunk of the work is just figuring

12:20 out how to coordinate and assemble drawings.

12:22 So if you imagine a lot of this work is done on kind of traditional desktop applications.

12:28 So if you're familiar with Autodesk, the biggest ones in the US are AutoCAD, Revit.

12:34 Those are more, Revit is very like architecture kind of building focused.

12:38 AutoCAD is more kind of generic, I know, drawing and drafting.

12:42 And then you have other players like MacNeil, they do kind of 3D modeling and it's used all

12:48 the way from small jewelry design and boats all the way to buildings, but more at the conceptual

12:53 stage and Revit is kind of the big dog as far as like building documentation.

12:58 And there's this interesting process because at the same time you are coming up with the

13:01 building at large scale, right?

13:03 Like what do you see there?

13:04 That's kind of mass in.

13:05 You have to zoom in all the way to what is it going to look like?

13:09 Like cove in a bathroom, for example, and you might have to.

13:12 Cut a section through that in detail.

13:14 And there's this weird process we are still in where buildings are designed half in 3D

13:19 and half in 2D.

13:19 So you do some 3D and then you get sort of these views, but then you might zoom in and

13:25 actually.

13:26 Then you do a projection.

13:27 You're like, oh, we need to see just this wall.

13:29 Yeah.

13:29 Yes.

13:30 Or just the floor.

13:31 How it's going to look.

13:32 You can assemble the sketch work needs a drawing of like, what does it look like if I cut

13:35 through here?

13:35 And you literally draw in 2D and you have to assemble these big drawing sets that are references

13:40 that show the 3D and say, okay, if you were to cut through this, here's what you would see.

13:44 And oftentimes they're not even like the same model.

13:47 You're just trying to make this thing look coordinated.

13:50 How often does it go wrong?

13:52 Oh, pretty often.

13:53 Yeah.

13:53 Pretty often.

13:54 So one of the things that's done, usually there's a tool called Navisworks is one of the ones

13:58 that's used that's for clash detection.

14:00 So, cause not only have the architects, but you also have these trades coming together, right?

14:05 So you have separate models for the architecture, like walls and floors and things like that.

14:11 And then you have the structural engineer as a separate model with all the steel or concrete

14:17 structure.

14:17 And maybe the MEP, mechanical, electrical employment folks have a separate model and then they all

14:24 get linked.

14:25 And in the end you may have like a duck going through a life fixture or things kind of through

14:30 all.

14:31 And you actually have to do clash detections and trying to figure out places where the model

14:35 may not have a kind of a valid condition.

14:37 Yeah.

14:37 I can imagine.

14:38 So this Revit app is largely a .NET C# desktop application.

14:45 Is that right?

14:45 Yeah, correct.

14:46 Yeah.

14:47 And so if you want a programmer to work with it, what do you do?

14:50 Do you do that in C#?

14:51 Yeah.

14:52 So Revit's been around for a while and I'm not sure when it started.

14:56 I don't think it was from the very beginning, but at some point they released an API and without

15:01 this API, you can do everything through the UI, right?

15:04 So you can click around and you can basically achieve everything you need to.

15:08 And through the API, you can sort of automate everything that's visible and sometimes a

15:13 little bit more.

15:14 But the idea is that, for example, one of the first tasks I automated in Revit was I was working

15:20 in a really large office buildings and each room would get tagged with like the name of

15:24 the room.

15:25 Right.

15:25 And I would have to literally drag the stag on.

15:27 Right.

15:27 And then sometimes as the building moved, things would get kind of out of place and you

15:31 wanted the tags to be kind of centered nicely and you would literally have to go around and

15:35 move around these tags.

15:36 And one of the first.

15:37 For hundreds of rooms, right?

15:39 That sounds like not a fun, good use of your time.

15:42 Oh, no, definitely not at all.

15:43 Yeah.

15:44 And yeah, one of the first automations I built was this tool that would just go

15:48 automatically room by room and make sure the tag was in the center.

15:51 So I'm just going to figure out the delta between the center of the room and where the tag was and

15:55 like slide it.

15:56 Yeah.

15:56 And I actually had at the company that I worked at a time, I had a system that would measure the

16:01 use of tools and that tool would just get used like hundreds of times a day.

16:05 So imagine every time someone clicked that button, the amount of time you would see these architects

16:10 like going around and moving these packs to get them center and just little things like that.

16:15 Very kind of monotonous, boring, not very impressive automations, but actually a lot of time in the day

16:21 to day.

16:22 Yeah.

16:22 But you can easily apply code to those and really make people's lives better.

16:27 And it sounds like hundreds of people's lives better by, you know, not making them fiddle with

16:32 stupid labels all the time.

16:33 Oh yeah.

16:33 Push a button.

16:34 Right.

16:35 So while these can be programmed in C#, there's a Python angle, right?

16:40 Yeah.

16:40 There's a couple of different ways that Python comes in.

16:42 I think Revit itself does support some sort of Python automation, but it's again, it's a bit

16:48 bulky, difficult to use, difficult to debug.

16:50 So one of the main ways that it's used these days, there's this project and I've actually

16:55 become really good friends with the maintainer, but there's this project called PyRevit.

16:59 And the idea is that when you write Python, you get used to things being sort of Pythonic or more

17:05 elegant and it's easy to do, right?

17:08 So what he was trying to do is how can we have this kind of experience building automations within

17:13 Revit?

17:14 So instead of having to compile my C# add in, how can I kind of just pop up the script, click

17:21 a button and have it run my Python code.

17:24 And that's essentially, you know, what he built.

17:26 So initially it was using only Iron Python because that's the way it integrates within the Revit

17:32 environment.

17:32 Since it's .NET, you would essentially use an Iron Python.

17:36 You could interact directly with Revit through the common language runtime.

17:39 Right.

17:39 So tell us a bit about Iron Python.

17:41 I suspect many people do know about it.

17:43 This came originally out of a project at Microsoft.

17:48 I think, was this Dino Veland?

17:50 I can't remember.

17:51 Yeah, that's what I've heard.

17:52 I've interacted with the maintainers a couple of times over the last few years.

17:55 And the impression I've had is that there was one or two people kind of trying to get this

18:00 going, but it's not very active.

18:02 And I think the three release wasn't too late.

18:06 So it shows there it's still in alpha actually.

18:08 At the time when I was using it, it was still in 2.7.

18:11 It's been stuck there for a long time.

18:12 At least it's making progress.

18:14 I mean, here's a release in 2021 on it.

18:16 So that's good.

18:17 Yeah.

18:17 One of the things I'm not too familiar with it, but I remember hearing from the PyRevit

18:21 maintainer that they actually ended up using this other project called Python.net.

18:26 Yes.

18:27 And Iron Python is essentially a Python interpreter that was written in C#.

18:33 And Python.net does something kind of different.

18:35 It actually allows you to use CPython, but interact with the .NET side.

18:40 And I don't quite remember how he worked, but I know he got it to work and he was able

18:43 to get CPython applications running inside of Revit as well.

18:46 Right.

18:47 So Iron Python is a Python interpreter, but instead of having the interpreter implemented

18:54 in C the way that the one that we're all mostly familiar with is, it's implemented on top of .NET.

19:00 And yeah, that was Dino Vila in that double check.

19:03 So nice job on that, Dino.

19:05 And it's implemented on top of the .NET CLR runtime and it's kind of its own little thing in this thing called the dynamic language runtime,

19:11 which means integration with .NET is super easy because it's already running in .NET.

19:18 It's equivalent to saying integration with C is easy on CPython because it's already effectively running in C, right?

19:23 And I guess that's probably a pretty natural way to go because if you're trying to integrate with a C# .NET library,

19:30 you got to somehow get that thing in and do something with it, right?

19:34 Right.

19:34 So I could see why they would go with Iron Python first.

19:37 But yeah, I've sort of heard that Python.NET is, it seems a little bit more CPython friendly, I guess.

19:44 Yeah, I think one of the issues with the Iron Python project is that it's kind of impossible to maintain.

19:50 Like how do you keep up with all the changes and releases of CPython and like rebuild them from scratch in C#?

19:58 I would imagine it would take a huge amount of time and resources to keep that project like going in the same pace.

20:04 Yeah. So here looking at Python.NET, we've got, it supports 27, but also 35, 36, 37, and 38, which is not 39 and 310.

20:12 Yeah.

20:12 But it sure is better than alpha support for 3.4.

20:15 Yeah. Do you know how it actually, like what it actually does? How does it get to?

20:19 I have no, I have not learned enough about Python.NET to know how it works, but it's, yeah, it looks pretty neat though, doesn't it?

20:27 Yeah. But I think it's just, it's, you're able to operate in CPython, but kind of import common-legged

20:33 during time and talk to your .NET DLLs in the same way you would from Iron Python. So it's pretty interesting.

20:40 Yeah. You get very foreign looking code. Import CLR from system.winds.forms, import form,

20:46 which is something you would expect to see in a .NET project, not in a Python project.

20:50 Yeah. But there's actually, that's one interesting thing that I've seen happen quite a bit because

20:55 people within this industry ended up using Iron Python quite a bit. I know there's a few projects

21:01 out there for building UIs in Python, but I've actually seen quite a few projects with like desktop UIs

21:08 basically built using, you know, .NET because it has...

21:12 Oh, interesting.

21:12 What is it? Windforms? I forgot what the other one was.

21:15 Yeah. Windforms is the one that's like the modern-ish VB. I say modern-ish because I think they kind of

21:21 stopped advancing that in something like 2008, I think is when they stopped advancing it. So it's

21:28 not like super modern, but it's way more modern than VB6 was. So yeah, there's that and there's WPF.

21:34 And then some weird variants.

21:34 Oh yeah. WPF is the more current one, right?

21:37 Yeah. Also way harder to use, but yeah, more modern one.

21:41 This portion of Talk Python to me is brought to you by Shortcut, formerly known as clubhouse.io.

21:49 Happy with your project management tool? Most tools are either too simple for a growing

21:53 engineering team to manage everything or way too complex for anyone to want to use them without

21:58 constant prodding. Shortcut is different though, because it's worse. Wait, no, I mean, it's better.

22:03 Shortcut is project management built specifically for software teams.

22:07 It's fast, intuitive, flexible, powerful, and many other nice positive adjectives.

22:12 Key features include team-based workflows. Individual teams can use default workflows or

22:17 customize them to match the way they work. Org-wide goals and roadmaps. The work in these workflows

22:23 is automatically tied into larger company goals. It takes one click to move from a roadmap to a team's

22:29 work to individual updates and back. Type version control integration. Whether you use GitHub,

22:34 GitLab, or Bitbucket, clubhouse ties directly into them so you can update progress from the command line.

22:40 Keyboard-friendly interface. The rest of Shortcut is just as friendly as their power bar, allowing you to

22:46 do virtually anything without touching your mouse. Throw that thing in the trash.

22:50 Iteration planning. Set weekly priorities and let Shortcut run the schedule for you with accompanying

22:56 burndown charts and other reporting. Give it a try over at talkpython.fm/shortcut. Again, that's talkpython.fm/shortcut.

23:02 Choose Shortcut because you shouldn't have to project manage your project management.

23:10 So what you're saying is you've seen some people write Python code that then will do stuff like this

23:17 to put that kind of UI on the screen, right? Right.

23:21 Yeah. And even PyRevit itself had quite a few kind of UI components and they were all just using standard

23:26 .NET stuff, but writing in Python. And what's interesting too is in addition to PyRevit, there's

23:33 a few other projects. And one of them I had worked on that's called, it was called Revit Python Wrapper.

23:38 And there's another one called Revitron, which all have kind of similar idea, which is like,

23:44 I want to have the Python experience, but, you know, using this other kind of stack. So the idea

23:50 for Revit Python Wrapper is that the Revit API, it's this very bulky C# API. Yeah.

23:57 It's enormous. There's...

23:58 You can make it do its thing in Python, but you work with the type names and the function

24:04 names and stuff straight out of the .NET world, right? Which is clearly not Pythonic. They're

24:09 very different in the way of doing things. Yeah. So your code doesn't look or feel like Python. And

24:13 then the interfaces and kind of the APIs for the libraries are weird. So like, if I want to just

24:18 query, you know, this model for a wall, I would have to like build this object and this kind of like

24:23 builder pattern. And, you know, it's, it's very strange. Like it doesn't feel like Python. So when I

24:29 started writing that, I would build these little functions that would take the C# code and

24:34 give me like a Python-like column that I could make. And that's what this project came out from,

24:39 was this idea that I wanted to wrap everything that didn't feel Pythonic to make it like feel like I

24:44 was using it. So you wrote your own, like your PyRevit wrapper a little bit that would then make it

24:50 easier, right? And make it feel more natural. And then eventually you just decided... Yeah. So at the

24:55 time I was writing, I was writing Python code and the PyRevit, it was sort of, it was kind of the

25:00 environment. So the idea for PyRevit is you would, you could literally just save this .NET

25:04 file in a folder and put a PNG icon and it would sort of load it up that file and add it to the

25:10 Revit ribbon. So someone could click on it. And when he clicked, it would load your source code and feed

25:15 it into the Python engine. So it would just help you kind of establish this environment and you didn't

25:21 have to compile and add in, restart Revit. And then Revit Python wrapper was that every script that I had,

25:28 I would just import Revit Python wrapper and then just say collector type equals wall and it would

25:34 query for every wall of the model. And I stopped working on this project for a while. Then I recently

25:39 ran into this Revitron, which is a much more kind of sophisticated version, but essentially the same

25:44 idea. People wanted to write a very clean Python, but operate kind of on top of the Revit API without

25:51 having to deal with the non kind of Python look and feel. Interesting. Okay. Yeah. And even has its own

25:57 CLI. Oh yeah. Yeah. I guess it integrates with the PyRevit CLI, right? Yeah. So one of the things that's

26:04 interesting about this high Revit, which if I go further enough back, I'll find it, is that you can use

26:11 Python to build these little toolbar buttons or widgets, right? Yeah. And the way you do it is,

26:17 as you sort of described, there's this super convention of all of these directory, this directory

26:23 structure, right? Like if you put this file there and then the Python file in like some location that can,

26:29 it'll trigger the discovery that'll then create like a, some kind of icon and action in there, right? Maybe

26:36 tell us about that a bit. Yeah. And under the hood, if you were to write this in C#, there would be a

26:40 whole bunch of boilerplate that you would have to add for how those buttons get instantiated and loaded

26:45 into the UI. And one thing that I've sort of witnessed, like seeing PyRevit project grow, I was one of the

26:52 kind of early users, adopters. And it was this huge barrier for people who wanted to automate Revit because

26:59 you had to learn C# and the add-ins were difficult to build. And it was just this big time.

27:07 You probably had to learn interfaces and how to implement them and all that kind of stuff.

27:11 Yeah. And like you had to, you had to go around like the little, you know, the compile settings and

27:16 think around with it to get it to work. And you had to compile for different versions of Revit. And it was

27:20 really difficult, at least for me, maybe it's easier for some people, but with PyRevit, you could literally just

27:26 duplicate this folder and open a new Python file, start messing with it. And every time you click,

27:31 it would rerun. You wouldn't even have to reload anything because you would just read the source

27:35 code and feed it to the RnPython interpreter. So for the first time, I felt like I had this ability to

27:40 iterate quickly and explore and test things out. So it was a totally different experience.

27:46 Yeah, that's great. I'm looking at the code sample here for PyRevit, the create your first command

27:52 example. And I see exactly what you're talking about with this sort of C# abstractions leaking into the

27:58 Python world.

27:59 Yeah, there's definitely a little vision there.

28:01 Yeah, because it says, oh, look how easy it is to build this. You just drop this in this here and you put your

28:05 Python file in the folder that is like your button where it contains your icons. And then you write capital

28:12 db, capital F filtered, capital E element, capital collector. So filtered element collector of

28:19 da da da da, right? It's real similar to what you would expect from that language. That language's idioms

28:26 and not Python's idioms.

28:27 Yeah.

28:28 In the Revit Python wrapper, I started wrapping these classes. So for example, the filtered

28:32 element collector, I mean, that's a pretty long that I wouldn't give it to a Python class usually. So

28:38 I just called it the collector and I created a class that wrapped the filtered element collector. So

28:43 instead of writing something like this, you would say collector type equals wall. And you could write,

28:49 you know, wall as an enum and you would sort of basically output this code that you're seeing there.

28:54 But the problem is you can't really avoid it because even though you wrapped collector,

28:58 there are like 8,000 other like C# classes that I'm not going to wrap them individually.

29:04 So like eventually just kind of leaks. You just can't, you can't do the whole thing.

29:08 Yeah. Somewhere there's some function you can't get in front of and it returns one of these things.

29:13 And then, then there it is. Right. Exactly.

29:15 I tried at some point, I had these wrappers that would take the return and wrap those into some sort

29:20 of generic wrapper. And you would get so complicated and people that they couldn't

29:24 figure out what it was doing. So that's why that Revit Python project ended up

29:28 just kind of being abandoned at some point. And I wasn't as involved with it anymore.

29:32 So I just kind of sat there, but that was the idea. If you look at an example for that one,

29:36 you see that it looks a lot more, more Python-like.

29:39 Yeah, absolutely. I'm clearly seeing stuff that looks more like Python.

29:43 And that's fantastic. Right. Like, you know, variable names. Another thing that you spoke about that,

29:47 I don't even know what you were doing to solve this, but you said that you had to somehow adapt to things like

29:53 out parameters and ref parameters, which is a certain way to have a, instead of doing pass by value,

30:00 so you can actually modify the reference itself and the parameter. It's a little bit like

30:05 passing a pointer to a pointer in C or something like that, where you can change the pointer itself

30:11 inside the function. What did they do in Python to deal with that? That seems, I don't know how to

30:16 do that in Python.

30:17 Iron Python has a special, I don't remember because it's been a while, but Iron Python has a special construct.

30:22 Oh, okay. So in Iron Python, there's like an out or something. Okay.

30:25 Yeah. So you import some special Iron Python object, and that becomes your reference and pass that.

30:32 So, you know, Iron Python is this, is this weird kind of ways of handling those differences. What's

30:38 difficult is that it's a very niche thing. So when you run into a problem with, with those,

30:42 there's not a whole lot of people like trying to solve this. So it was always a little bit difficult

30:47 too.

30:48 I've had that sort of scenario before. And it's, it's not very often fun. And I remember

30:54 specifically one time there was something I was trying to do with this code and it just

30:59 was not responding in any way that I expected. And I was, I was at my wits and I'm like, I'm just going

31:06 to Google this. I'm just going to just find whatever I can. And the only answer I could find was a blog

31:10 post I wrote about it six months ago. I'm like, well, that's it. We're done. There's,

31:15 there's no hope for me now. Cause I'm sure I've tried. I can't do it. And I, the only thing I can

31:19 find is some dumb blog posts that didn't really answer the question I wrote about it. So here we go.

31:23 On Iron Python, a couple of times I had issues. My only resource was to go into the GitHub project

31:29 and actually post an issue. And I said, there's a stack over full question, no responses. I'm

31:34 completely at lost here.

31:36 Yeah. Well, that's such one of those, such a big challenge of using one of the

31:40 these sort of niche interpreters or runtimes, because when you need help, there's no one to

31:46 help you. And if it comes down to some little weird internal behavior, right, that behavior might be

31:51 different. And just because people, they'll tell you, well, that's how it works in CPython. You're

31:54 like, well, I know, but that's not how it works for me right now. Right. Can you help me? Like,

31:58 no, I don't know anything about that. Right. It's, it's a challenge.

32:01 Yeah. And if you're trying to post a reproducible example in Stack Overflow, and you have to have

32:06 Revit open, for example, to execute this, if you're trying to deal with some like,

32:10 lots of iron Python within this environment, it's really difficult.

32:14 Yeah. Oh my gosh. I can see why you would want to get away from it. I'm guessing that

32:17 Python.net makes this easier. Maybe it's still the same. I'm not entirely sure. I would like to learn

32:22 more about that one, but yeah.

32:23 Same here.

32:24 Yeah. Let's see. On the live stream, I just want to say, hey, Bhavani, that finally could catch up on the live stream here. Big fan of Python. And just,

32:33 you know, people listening, if you get the chance to be grateful to drop by the live stream we do on

32:37 YouTube, just go to talk python.fm/youtube. YouTube can be part of it. It's always fun to get

32:42 input from everyone out there. All right. Give us some examples of the types of things that you were

32:47 able to do with Python and automating Revit. There's a talk, I'll go ahead and link to the talk that you

32:52 gave at a meetup in San Francisco at Pine Silla. I'm saying that correctly. Yeah. And you talked about,

33:00 there's a lot of nice graphics and you talked a lot about what you've done at various projects and stuff.

33:05 Give us some concrete examples. Like it's all great in practice to say you could automate stuff,

33:09 but like, what did you actually do?

33:10 Yeah. So there was a lot of those kind of very boring, automating, moving tags type of thing.

33:16 Some of the other bigger projects I worked on at the time I was working at WeWork.

33:21 This is the fast growth time at WeWork as well, right?

33:23 Yeah, that's right. So when I joined WeWork, it was a relatively small team. I think the

33:29 built-in information, you know, modeling team, which is the team that I had joined, had just a handful,

33:34 like four, five people. And I think the company as a whole was maybe 800. And when I left four years

33:41 later, they were at around 10,000 employees. Oh my gosh. And then the building department,

33:46 or the design building and design department initially was open in one or two buildings a

33:51 month. And by the time I left, they were open in like 25 or 30. So all other kind of WeWork drama

33:58 side of what happened within the company, within the kind of design and architecture department,

34:03 it was just, it was really interesting to see. Yeah. Because traditionally,

34:07 companies build in buildings, they're doing that as a service. So they're an architecture office

34:11 that you hire. And WeWork was one of those examples where you had this kind of vertical integration.

34:16 They were the owners, they were the operators, they were the designers, they were the builders,

34:21 they even bought, they acquired a general contractor. So you had this huge opportunity to optimize and to

34:28 integrate. So some of the things that we did, like one of the projects I worked there was related to

34:33 integrating data from the earlier design process into everything that would happen kind of downstream.

34:39 So for example, as designers were working on buildings and trying to get them through the

34:44 approval process, as soon as this project was sort of starting to materialize, we wanted to get those

34:50 spaces fed into the kind of sales pipeline. So we would actually build Revit integrations that would extract

34:57 data from these models and feed them to other parts of the company. So one of them was related to

35:03 Oh, interesting.

35:04 Yeah. To figuring out how many offices are going to be in this building, how big are they,

35:08 how many desks are in each one, and essentially integrate that, for example, with Salesforce,

35:12 so that the sales team could start selling them. We did things with supply chain as well. So we have

35:20 logistics company that would be trying to orchestrate shipment of, for example, these chairs and couches

35:26 that you see in the photo, they would need to be placed at warehouses and then delivered to buildings

35:31 before opening. And they turned these buildings around really quickly. So it was really important

35:36 that they had kind of insight. So as people were designing these buildings, we could actually start

35:42 quantifying what was being used, what was going to be assigned, and then get the data sort of out of the

35:48 model, which is not very, it's essentially a file that sits there. And we would use Python, for example,

35:54 to quantify these things, pull the data out, and then send them on to other platforms. So it's a

35:59 little bit of kind of data wrangling.

36:00 Yeah. It's like JIT interior design, just in time, right? Like, we're going to need this here by

36:06 Tuesday. So we're going to automate it. So one of the things you have to do is you have to figure out

36:11 how, you know, maybe describe for, I'm sure not everyone's been inside of what we work before. Give

36:15 us a quick sense of like, what is the inside of what we work look like? Or any, a lot of these co-working

36:19 spaces, but we work is probably one of the bigger ones.

36:22 Yeah. So we work, it would take empty floor spaces and they would use sort of storefronts,

36:29 kind of glass their storefronts and subdivide them into small offices, as small as a single desk or

36:35 kind of cuticle. And they could be as big as a 15 or 20 person office. And they were really efficient

36:41 in how they kind of packed these desks. And they would do it in a way that it was very efficient for them.

36:46 They would pack these offices really close, but then they would create these really nice,

36:50 beautiful shared common spaces. So when you would walk into WeWork, you would often see these very

36:57 kind of slick hip spaces, well-designed music playing. So it was this kind of nice experience,

37:03 this cool kitchen and coffee area. And I think they were really good at it. I got to work out of WeWork

37:09 for many years and it was a really nice change for my previous kind of office environments. And even as a

37:15 a product, I actually really enjoyed what they were building.

37:18 Nice. Yeah. So one of the things you spoke about is setting up some automation to figure out, well,

37:22 how should we lay out these tables, either this open space, like just hangout area tables or

37:28 like the co-working desks, or there's some parts that have like glass, clear glass separators. So you

37:34 have some sort of quiet, but it's still, they've all got to be laid out, right? And you can say,

37:38 okay, if we adjust the walls like this or do that, then here's the arrangement, right?

37:42 Yeah. A couple of my coworkers were trying to figure out how to automate this so that

37:47 as architects are taking this kind of big floor plate and they're slicing it, they're generally

37:52 trying to figure out how the circulation is going to work. And then we build these kind of long blocks,

37:56 and then you're going to start subdividing them to offices. And then as you start subdividing them,

38:00 then you've got to figure out how the desks are going to work. And then you have columns. So actually

38:04 like laying them out and getting kind of an efficient algorithm can be kind of time consuming. So some folks from

38:11 the data and research team, they were writing algorithms. And the first one that I saw was actually written in Python.

38:17 And I think it was served like using a Flask API, but the idea is that you could pass it a polygon

38:23 and you would apply these rules about how you can lay out desks within this kind of polygon.

38:28 And you would say, the door is here, do your best to lay out desks. And you would, you would try to do that. It was

38:35 fairly straightforward math. It wasn't artificial intelligence or some sort of machine learning. It

38:40 was actually pretty straightforward kind of brute force, which I found laying these out along the

38:44 edges. But they were really interesting. They did some really interesting research on that.

38:48 Yeah. Cool. A lot of nice examples of what you can do with a little bit of Python, a little bit of

38:53 automation, even if you've got to somehow mash that together with a .NET or, you know, I guess if it

38:58 was a Java API, you could use Jython or some other thing like that, right?

39:02 Yeah. And this one specifically, the way we got around it is by actually building it as an API and

39:07 have a C# add in called API to do the calculation. So that way we're going to have to deal with it.

39:13 Nice. Yeah, that's perfect.

39:15 This portion of Talk Python to me is sponsored by Linode. Cut your cloud bills in half with Linode's

39:23 Linux virtual machines. Develop, deploy, and scale your modern applications faster and easier. Whether

39:29 you're developing a personal project or managing larger workloads, you deserve simple, affordable,

39:34 and accessible cloud computing solutions. Get started on Linode today with $100 in free credit

39:40 for listeners of Talk Python. You can find all the details over at talkpython.fm/linode.

39:46 Linode has data centers around the world with the same simple and consistent pricing, regardless of

39:52 location. Choose the data center that's nearest to you. You also receive 24/7/365.

39:59 human support with no tiers or handoffs, regardless of your plan size. Imagine that,

40:04 real human support for everyone. You can choose shared or dedicated compute instances,

40:09 or you can use your $100 in credit on S3 compatible object storage, managed Kubernetes clusters, and more.

40:16 If it runs on Linux, it runs on Linode. Visit talkpython.fm and click the create free account button

40:22 to get started. You can also find the link right in your podcast player show notes. Thank you to Linode for

40:28 supporting Talk Python. Let's talk about this other thing that you've been working on,

40:35 AEC.works, which is architectural engineering and construction works. And tell us a bit about this

40:41 project. This is a website you built for raising the visibility of cool companies in the space.

40:47 Yeah. This actually started when I was an engineer at WeWork and I was seeing a lot of really interesting

40:55 companies start to show up and try to build either software products or try to take a technology and

41:04 build new companies within AEC that were trying to use technology in some interesting way. And I started

41:10 keeping a list of it, Google sheet or your table form or something. And this list started growing.

41:16 And so it started with four and five and eventually I had 20 or 30 of them. And I would often share them

41:21 in different kind of community forums. And then I thought it would be interesting if I could somehow make

41:26 that available and maybe even so that people could contribute and edit them. So basically build this out.

41:33 It's a Django, a traditional, somewhat traditional Django app, except that on the front end, instead of

41:40 using templates, I just use Vue.js. So it's a front end, back end separation type project. And yeah,

41:47 the idea is that you can create these entries that represent these different companies or products.

41:52 And then it just, you know, it's kind of displays them. It's pretty simple, nothing really crazy.

41:56 Nice. Yeah. I will highlight a couple just to give people a sense, but there's a way to come here and say,

42:01 suggest a company that's doing like innovative work here, right? So if people are out there like,

42:05 why is my company out here? Well, there's a button, right?

42:07 Yeah, exactly.

42:08 All right. So I just briefly, let's talk about two of them that are maybe noteworthy.

42:13 This one right at the top of the moment that says it's called Speckle. And let's see, it says,

42:20 engineers, designers, and hackers, and the entire organization rely on us for interoperability

42:25 automation. So it's like source control collaboration, versioning notification for

42:30 architectural construction folks.

42:33 Yeah. It's a little bit like AC architecture, geoconstruction data wrangling on steroids, right?

42:40 So when you're in, and if you're working with software, you can pretty much always just like

42:45 make a JSON and pass it around. Right. And you can, as long as you can get, you know, at least some basic

42:50 data types. Now, if you have to pass around a wall, it's much more difficult than just passing around a

42:56 string. And what type of wall is it? Where is it located? How big it is? It's complicated. So you have

43:02 all these different desktop applications. And I've highlighted some that are used primarily within

43:06 architecture, like Revit, for example. But there's all these other applications for other disciplines

43:11 within the construction, you know, engineering industry.

43:13 Right. Some of the ones they highlight are like Unity, Civil, 3D, E-Tabs, Blender, Unreal,

43:19 that kind of stuff. Yeah.

43:21 Yeah.

43:21 There's Revit, yeah.

43:22 So yeah, the first time Speckle came around, I believe it was like an academic project came out of

43:28 Europe. And what they would do is they would build, like, for example, you know, an add-in for one of

43:32 these platforms. And they would output some sort of serialization of these objects. And then they would

43:39 build an add-in for another of these, you know, desktop apps that could read that JSON object.

43:44 And DC realized it back into this architectural or, you know, engineer whatever structural beam or

43:50 something. So it was about building all these connectors and would plug into these environments

43:54 that weren't very easy to interrupt data in and out. Right.

43:58 And on top of it, you would have a web platform. I think they call it like streams or something.

44:03 And that way you could take data from one thing and plug it into another, see them all online

44:08 together and share them, for example. So there's some, you know, really interesting ideas about

44:12 collaborating, tracking them. And that's only possible because you take them out of these desktop

44:17 apps, because a lot of them are not really built for this type of collaboration or this type of data

44:23 sharing. Yeah. That's a really interesting idea. Like these things do not support

44:26 any sort of interoperability, but if we can just get stuff in and out of any one of them,

44:31 we could be that middle ground. Right. Yeah. So I don't know a ton about this. I really basically

44:36 just skim the website and watch their explainer video, but it seems like some pretty cool open

44:41 source stuff for people in this space. So they could check that out. Right.

44:44 Yeah. And what I think what it's exciting about them is that they're actually open source too. So

44:48 a lot of software in AC is they're big companies and they're paid and there's not a lot of example of

44:55 successful open source companies essentially. They've actually been able to become a real company with

45:02 employees and raise money and they're open source. So it's really interesting to see them trying to

45:06 build a successful open source model within the industry. Yeah, absolutely.

45:10 Prad Vaughan out in the live stream says two double high fives for Django for your app at

45:18 AEC.works. All right. So that's Speckle, which is cool. And then also Ladybug, Ladybug tools.

45:23 Yeah. Ladybug is incredible too. Ladybug's been around for a while. I don't know how long,

45:28 but it was actually one of my first experiences, one of the first times I got exposed to open source

45:33 within AC industry as well. But it's essentially, it started, it was a bunch of Python tools that would help you

45:40 do kind of environmental analysis and they would basically use like weather data and some

45:46 existing products. I forgot that it's been a while since I used this, but they would essentially wrap

45:51 around these heavier duty programs that could actually do like daylight simulation or like solar analysis.

45:58 But they would, they would build an interface in Python that you could use within, or Revit wasn't too much

46:04 later, but right now when some of these other AC applications and the outcome within was that you

46:09 would basically would allow any kind of architect, you know, students to essentially take any type of

46:15 building that they were designing and actually run and see what does this building look like throughout

46:20 the year? What does sun hit or what does light look like inside and actually render these analytical

46:25 kind of drawings from it? So it was really interesting. It made all of that kind of accessible to a lot of

46:31 people that wouldn't have been able to otherwise. And I think it was entirely written in Python for a long time.

46:35 Yeah. It has a cross platform, Ladybug tools. It's written in Python, which can be run almost anywhere

46:41 and plugged into any geometry engine, which is great. And then it talks about having some visual aspects of

46:47 harnessing the capabilities of CAD to produce a variety of interactive 3D graphics, which producing cool interactive graphics in

46:54 Python is always fun. But yeah, this one's also free and open source.

46:56 Yep. That's right. I think they've received some grants from the public of energy or something like

47:01 that. They're pretty well supported.

47:03 Yeah. And it's 99.8% Python. That's still a lot of Python and 0.2% other.

47:09 It's probably marked down.

47:10 It's probably. I'm guessing it's the one shell script and the requirements.txt here.

47:15 Yeah, that's right.

47:16 Awesome. All right. So all that stuff is super neat. The work that you're doing here to shine a light on,

47:22 the different ways we can automate stuff. In architecture, we've got Revit and then the

47:26 PyRevit and the Python Revit wrapper and then Revtron, you said. And then also these open source

47:35 like connectors and interoperability platforms are all super neat. I do want to talk to you about

47:40 one other thing that doesn't have a super clear connection, but it's also, it sounds like it came

47:44 out of your time at WeWork, this stuff you did with Airtable. Is that right?

47:48 Yeah. Yeah, that's right.

47:49 Yeah. So Airtable is something that I've seen and I've had people tell me that, oh, you definitely have

47:54 to work with Airtable. It's amazing. It's like Sheets or Excel, but way nicer or things like that.

48:00 Tell us, you know, a couple people out there, Airtable is this commercial product, right? Tell us about

48:04 this and then we'll get to some Python side of things in a moment.

48:08 Yeah. I'm a huge fan of Airtable. Pretty much since the first time I sort of run into it,

48:13 I've been an user and I use it for everything personal projects work, but I define it as this

48:19 kind of Google Sheets meet relational database. And I think there are other products like it,

48:25 but I find Airtable just really kind of a joy to use.

48:28 Yeah. I also feel like there's a Trello Kanban board aspect of it as well, right?

48:34 Yeah. They've been adding, you know, quite a few kind of like views and tooling on top of the underlying data. So there's some interesting things you can do.

48:42 It's not as sort of pure of a kind of tracker as Trello is, but you can basically build a Trello-like

48:49 interface and there's a Kanban mode. So you can, whatever your roles are, if you have certain fields.

48:56 So for example, you could maybe have a table with like apartments you're enlisted, for example, and maybe

49:01 you have a column that is the status, whether you've visited them or not. And in Google Sheet, you would maybe

49:07 type it or do like a data validation. In Airtable, you can actually see this is a field that links to

49:12 this other table and you have the options that I want. And you can kind of create truly kind of relational

49:19 data and have these views be linked to each other and in some really interesting ways.

49:24 Yeah. Cool. Yeah. So it's, it's a little bit like spreadsheet meets relational database

49:30 that has relationships rather than just random stuff you type in Excel, right?

49:34 Yeah, that's right. Cool. All right. So that's Airtable. The Python side of things is you created

49:39 this thing called a PI Airtable, which is a Python client for the Airtable API, right? Tell people about

49:45 this. The initial version of this was through my time at WeWork as well, but we had all these Airtables

49:51 that would store, I think one of them was like a furniture database. So everywhere was a piece of

49:56 furniture and you had all this detail about these objects, maybe some data. And now you were to use

50:02 that in other places or you wanted to feed additional data in that, in that table. So Airtable

50:08 expose an API, but API, it's somewhat simple and minimal, but you know, it works as effective.

50:14 So this was originally called Airtable Python Wrapper and was recently renamed to PI Airtable, but it's just

50:21 a kind of a lightweight Python client around. It just, it adds a lot of the kind of nuances about the, the API

50:29 itself, some of the data types and just kind of a high level interface. So then you can just kind of

50:34 import it and you don't have to go spend too much time in the documentation, figuring out what all

50:39 the HTTP requests are. And it just wraps them up and handles a lot of the, a lot of the things and add

50:44 some, you know, nice high level abstractions to make it really easy to use. I've been working on this

50:49 project for probably maybe three years now. And it was really interesting because in the beginning it was

50:54 just me and I thought it was useful to have this and I just kind of put it out there. And it was really

51:00 fun to see like people coming into the repo and actually asking questions or opening bug tickets.

51:06 And in some cases, like I've had people just do lots of contributions. Like this one, this one person

51:13 came out of nowhere, would they, and just like rewrote a test suite for it. I had these, the initial

51:18 test suite, I guess I didn't know any better, would actually make calls to the API. And it was hard because

51:24 the state wasn't predictable. Tests were a bit slow. So I guess when I did that, I didn't know you should

51:30 sort of mock your requests and run your tests that way. And they literally came and like rewrote all

51:35 my test suites. And so it was really fun. And it's been kind of one of the longer running open source

51:41 projects that I've had. And over time I've just gotten better at kind of maintaining and added features.

51:46 And then more recently, I just kind of rebranded Aspire table, build new documentation. And it's been

51:52 really fun to see the project grow and it's got a decent user base. So I often see people coming up in

51:58 there and I searched GitHub every once in a while and I see it used in a lot of different places.

52:02 So it's really cool to see.

52:04 Yeah, that's fantastic. So you said it has 200,000 downloads a month and it's listed as the

52:10 official Python air table library, right? And the air table docs.

52:14 Yeah. I assume those 200,000, a lot of them are CI. I don't know how many are actual direct installs,

52:22 but you know, it does get used. Yeah. And then the air table documentation.

52:26 That's not nothing, right? So that's a lot, right? Even if it's a quarter,

52:29 Yeah. Yeah.

52:29 That's still a ton of people using the library.

52:31 Yeah. It's pretty exciting. And then recently, I think it was about a month ago or so,

52:35 they added to the official documentation as the community driven kind of Python client. And

52:41 they didn't have any others listed before that. So I think that's bringing more people.

52:46 Nice. And so you said it also has some ORM capabilities.

52:49 Yeah. So this was really fun. I would always use this library or whatever I needed to work with

52:54 their table, but I would oftentimes want to build classes for the models that I had. I was always,

53:00 I love using Django and these different types of ORMs. I think it's a really fun way of kind of working

53:05 with persistence. And I wanted to do something like that with air table. So I, in this recent release,

53:12 I basically kind of tried to build my little ORM and the idea is that I would define, for example,

53:18 if I had an air table that it was contact, name, first name, email or something, I could essentially,

53:24 you know, define a class called contact and then inherit from this air table base model and then

53:30 define the fields. And then I could just instantiate that class and say, not save. And you would fire the

53:37 request to basically save it. I could update an attribute and then just hit save and you would

53:42 update it or call it delete method. So it was really fun. I don't know how much that's used. It's kind of

53:47 a new feature, but I had tons of fun building it. And I got into descriptors, which I had never used

53:53 before. Yeah. Descriptors are wild. Yeah. They were really crazy. So you had to define, these are the

53:59 attributes this model should have, but when you actually instantiate, they behave very differently.

54:04 You want to get the actual value, but not the kind of the field type. So descriptors were

54:10 the natural answer, everything to it, but it was really fun building it.

54:13 Right. And you've got like text fields and email fields and even checkbox fields, which I don't

54:18 typically recall from the Django ORM or SQL. Yeah. That's an air table, a kind of native type.

54:24 Yeah. Yeah. Cool. Yeah. You even have links from one air table to another. Cool. Yeah. I didn't

54:30 realize it had this ORM aspect to it. This is very neat. Yeah. So when you fetch a record from air table,

54:36 if it's a link, you actually just get the ID. It doesn't actually like transverse the link. So

54:41 if you define it as a, as a link field, it actually takes that ID and fetches the next one. And then

54:47 actually gives you the object instead of the ID. Yeah. Perfect. Like a foreign key type of relationship

54:53 thing. Awesome. All right. Anything else you want to throw out there about higher table before we

54:57 wrap this thing up? No, that's it. Yeah. So if people are out there using air table and they want to

55:01 treat it like an ORM, I just want to talk to it. Yeah. Sounds like you should check this out.

55:06 Yeah. I actually have a blog post I wrote when I, maybe about a year ago, that was called using air

55:11 table as a backend on the medium. And it was an initial version of AC that works instead of having

55:18 a Django backend. I actually tried to build it with just an air table serving it. And it was interesting.

55:24 It's not, you won't have all the guarantees you have from a, from a proper database, but it's a really

55:29 easy way if you just want to put data somewhere and be able to fetch it. And you also get a free kind of

55:34 UI that you can see the data and change it. So yeah, it's kind of like the admin backend of Django,

55:40 but it's like this super rich thing in the form of air table, right? Yeah, exactly. Yeah. Very nice.

55:45 I mean, maybe it's not a full ACID transactional database, but at the same time, if that's where

55:51 people are putting the data, you don't want to put it into Postgres and then try to keep the thing in

55:55 sync or something like that. Doesn't sound fun either. Right. So use the one place that holds the data.

56:00 That's what you're doing. Yeah, exactly. You won't get, I mean, I think if you're doing this,

56:03 you're probably not, you won't be replacing Postgres, but it would maybe be replacing just

56:08 like a local file or something. Yeah. But yeah, you do get, you get some form of like revision.

56:13 It keeps track of every change. And so you get a lot for free. Yeah. Very nice. Yeah. People should

56:19 definitely check that out. All right. Well, we're about out of our time. So let me ask you the final

56:23 two questions here. If you're going to write some Python code, what editor do you use? I think these days

56:29 it's probably always VS Code, right? Or a big percentage of it.

56:33 Yeah. There's definitely a big chunk. Yeah. I had a little, like my first one was notepad

56:39 plus. Then I think I used add a sublime for a while and then add them and then end up in VS Code. And

56:45 these days I, I just, I love the Python integrations that the team that there has built. So I couldn't

56:51 really see myself moving away from it anytime soon. Yeah. That's cool.

56:55 Very invested in it.

56:55 Oh, there's a lot of action going around on with VS Code in general. And then also in the Python

57:02 aspect of it. Right. I do feel like this sublime to Adam to almost everyone who is on that path.

57:09 VS Code is the destination.

57:11 Yeah.

57:11 I agree.

57:12 Yeah.

57:12 It just kept getting easier.

57:14 Cool. All right. And notable IPI package. I mean, you've already given us

57:18 many different packages and things for people to check out, but something that, you know,

57:22 you ran across like, oh, this is cool. I really got to tell people about this one.

57:25 Yeah. This is not a secret package. I think it's a pretty well-known, but I, I've just

57:30 really come to enjoy using a Pydantic. It's one of those that I think I added on pretty much every

57:35 project I have. I think it's such a blast just to be able to define my classes and set the types.

57:41 I really enjoyed the way the project came together and it's sort of one of the standard ones that I

57:46 added everywhere now.

57:47 Yeah. If you have to parse data into your model or turn your model into something like JSON,

57:52 it really helps a lot, especially if you have a hierarchical model, right? I've got this thing

57:56 that contains a list of other Pydantic models, and then you've got to do type conversions to date

58:01 times or to numbers or stuff like that. Yeah. It's fantastic.

58:04 Yeah. And even on projects, you're collaborating with other people, you have a sort of my PY first

58:10 kind of approach, right? Where from the very beginning, your objects are kind of typed and

58:15 that just makes it a lot easier to collaborate with other people that will jump into your project. And

58:19 it's very clear what that object is and all the types. Yeah.

58:22 So that kind of helps make sure that you stick with it.

58:25 Absolutely. Good recommendation. I suspect people probably have heard of it as well, but it's

58:29 definitely a good one. Yeah. I've had Samuel on the show to talk about it. All right. Final call to

58:34 action. People, especially those out in architecture, engineering, construction, are excited about Python

58:40 and some of the tools. What do you tell them?

58:41 I think it's a, it's an exciting time for the construction industry. It's kind of really good

58:46 place to innovate. There's a lot of exciting technology products and companies being built.

58:52 So I think there's a lot of opportunities to do something in kind of a different space. And I think

58:57 they can really benefit from experience people that have been, you know, doing more traditional

59:02 software development to help them scale and build things. So yeah, it's interesting to see how

59:07 that those kinds of streams cross and to see architects go to build software and also seeing

59:12 engineers come to help make the architecture and construction industry better. Yeah. Fantastic.

59:18 All right. Well, thank you so much for being here. It's been great to have you on the show. And I'd love

59:24 to get these views into the different areas and communities where Python is making a difference.

59:29 So thanks for sharing it in the architecture space.

59:32 Nice. My pleasure.

59:33 Yeah, you bet. See you later.

59:34 Thanks, man.

59:35 This has been another episode of Talk Python to Me. Thank you to our sponsors. Be sure to check

59:42 out what they're offering. It really helps support the show. Choose Shortcut, formerly Clubhouse.io,

59:47 for tracking all of your projects work because you shouldn't have to project manage your project

59:51 management. Visit talkpython.fm/shortcut. Simplify your infrastructure and cut your cloud bills in

59:58 half with Linode's Linux virtual machines. Develop, deploy, and scale your modern applications faster and

01:00:03 easier. Visit talkpython.fm/linode and click the Create Free Account button to get started.

01:00:08 Do you need a great automatic speech-to-text API? Get human-level accuracy in just a few lines of code.

01:00:14 Visit talkpython.fm/assemblyai.

01:00:17 Want to level up your Python? We have one of the largest catalogs of Python video courses over at Talk Python. Our content ranges from

01:00:24 true beginners to deeply advanced topics like memory and async. And best of all, there's not a subscription in sight. Check it out for yourself at training.talkpython.fm.

01:00:32 Be sure to subscribe to the show, open your favorite podcast app, and search for Python. We should be right at the top. You can also find the iTunes feed at /itunes, the Google Play feed at /play, and the direct RSS feed at /rss on talkpython.fm.

01:00:49 We're live streaming most of our recordings these days. If you want to be part of the show and have your comments featured on the air, be sure to subscribe to our YouTube channel at talkpython.fm/youtube.

01:01:01 This is your host, Michael Kennedy. Thanks so much for listening. I really appreciate it. Now get out there and write some Python code.

01:01:07 I'll see you next time. I'll see you next time.

01:01:27 Thank you.

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