Latest / Talk Python To Me / #138: Anvil: All web, all Python
Transcript
- 0:00Have you noticed that web development's kind of hard?
- 0:02If you've been doing it for a long time,
- 0:04this is actually easy to forget.
- 0:06It probably sounds simple enough to
- 0:08pick a server-side framework, Pyramid or Django,
- 0:11create a new project.
- 0:12Oh, do I use pcreate?
- 0:14Is that cookie cutter?
- 0:14Is that manage.py?
- 0:15Install some client-side dependencies with npm.
- 0:18Install some server-side dependencies with pip.
- 0:21Create a database.
- 0:22Well, first choose a database server,
- 0:23then create a database,
- 0:24maybe even set up and install the server,
- 0:28the process and maybe even another machine to do this.
- 0:30Connect the app to the database securely.
- 0:32Pick a front-end framework.
- 0:34Is that bootstrap or foundation?
- 0:36Integrate the front-end framework into it.
- 0:38Pick a theme.
- 0:39Now, finally, you get to write some code.
- 0:40Oh, now it's time to deploy.
- 0:42Wait, that doesn't sound that easy.
- 0:44Actually, even to me.
- 0:46What if the web were as easy as old-school VV6?
- 0:49You just open a UI,
- 0:50you drag and drop some widgets,
- 0:52you double-click on the things like buttons for events,
- 0:54but with Python code, of course.
- 0:56With Anvil, you'll see that it really is
- 0:58that quick and easy to get started.
- 1:00Meet Meredith Loof, who's here to tell us about Anvil.
- 1:02This is Talk Python To Me,
- 1:04episode 138, recorded November 6, 2017.
- 1:21Welcome to Talk Python To Me,
- 1:23a weekly podcast on Python,
- 1:25the language, the libraries, the ecosystem,
- 1:27and the personalities.
- 1:28This is your host, Michael Kennedy.
- 1:30Follow me on Twitter, where I'm @mkennedy.
- 1:32Keep up with the show and listen to past episodes
- 1:35at talkpython.fm,
- 1:36and follow the show on Twitter via at Talk Python.
- 1:39This episode is brought to you by Datadog
- 1:41and GoCD from ThoughtWorks.
- 1:43Please check out what they're offering during their segments.
- 1:46It really helps support the show.
- 1:47Meredith, welcome to Talk Python.
- 1:49Thank you very much.
- 1:50Thank you very much for having me.
- 1:51Yeah, you had some pretty interesting stuff going on
- 1:54at PyCon UK,
- 1:55and yeah, I'm super happy to bring it to a wider audience.
- 1:58Cool, thanks.
- 1:59Yeah, it was really great.
- 2:01That's actually been our first time sponsoring that conference,
- 2:04and it was really quite fun being deluged in people.
- 2:08Yeah, a whole bunch of stuff we weren't expecting.
- 2:10We went through a lot of throat sweeps
- 2:11in the evening after the conference,
- 2:12but it was really great to see the reaction out there,
- 2:14and I'm really pleased to be talking to you
- 2:17and your listeners, too.
- 2:17Yeah, that's awesome.
- 2:18So I'm super excited to talk about your project called Anvil,
- 2:22which is kind of trying to democratize the web again
- 2:25in like a really interesting and powerful way
- 2:27and using Python to do it,
- 2:28but before we get to that, let's just hear your story.
- 2:30How did you get into programming in Python?
- 2:32So programming, I started, I was very privileged.
- 2:35I started around the age of seven.
- 2:37I was introduced to QBasic,
- 2:38and for me, it was just this piece of magic
- 2:41because here I was sitting at this blue screen,
- 2:45and I could type something in,
- 2:46and it was nothing the seven-year-old's brain
- 2:50couldn't comprehend,
- 2:51and here was this program.
- 2:53It was drawing pictures on the screen.
- 2:55It was interacting with me,
- 2:56and I could make it do what I wanted,
- 2:58and this was magic made real sitting in front of me,
- 3:02and it was several years before that
- 3:03that I worked out that you could actually make a career
- 3:05doing this amazing thing that I discovered
- 3:07was the best hobby in the world.
- 3:08Actually, literally the reason we started Anvil
- 3:12was that that experience isn't there
- 3:16in much of the web these days,
- 3:18and as far as I'm concerned,
- 3:20that's borderline criminal negligence
- 3:21from our whole profession
- 3:23because that kind of magic that can capture a kid's eye
- 3:26is what we should be delivering.
- 3:28You're right.
- 3:29It absolutely is missing,
- 3:30and so I think you guys are going to bring some of that back.
- 3:33Yeah, that's awesome.
- 3:34So that's how you got into programming.
- 3:35How about Python?
- 3:36So Python itself actually,
- 3:38I mean, I've like dabbled, dipped into it bits and pieces,
- 3:43but honestly, like we started on Anvil first.
- 3:46It was very much, you know,
- 3:48we want to bring back this sort of instant access magic.
- 3:52We want to bring back what you had
- 3:54with like Visual Basic 6, these tools in the 1990s,
- 3:57and we were like, okay, but it's got to be modern.
- 4:00It's got to be an easy-to-use, accessible language.
- 4:05It's got to, you know, it's got to feel
- 4:07that kind of easy workability in your hands,
- 4:10and we like looked at it,
- 4:11and Python was so the obvious candidate.
- 4:13And so like I was, you know,
- 4:15I spoke Python as like, you know,
- 4:16fourth language up till then,
- 4:18and then I went, right, okay,
- 4:19this is clearly the right thing,
- 4:20and jumped into it, and I've been loving it.
- 4:23Yeah, that's awesome.
- 4:23And so you guys sponsored PyCon UK.
- 4:26It sounds like Anvil is something
- 4:28that you're focused on pretty much day-to-day.
- 4:30Is that right?
- 4:31Absolutely.
- 4:32So we originally started this a couple of years back now.
- 4:36It was like an evening and weekends project.
- 4:39It was, you know, we were on our way to a wedding,
- 4:40sitting there in the airport,
- 4:42Departures Lounge going, you know,
- 4:43why don't we have Visual Basic 6 for the web anymore?
- 4:47And that kind of turned into, you know,
- 4:49some evenings working on it,
- 4:51which eventually turned into like taking one day off a week
- 4:54to work on it.
- 4:55And then last summer, we just, honestly,
- 4:57we just stuck it on Reddit,
- 4:58and we saw the reaction, went,
- 5:00oh, okay, this is really a thing now.
- 5:02Okay, we could afford to go full-time on it.
- 5:03And so we worked our way up to it,
- 5:05but now, yeah, this is our thing.
- 5:07Yeah, that's a really great story,
- 5:08and I think a lot of people feel like the way
- 5:11you get to somewhere where you have, like,
- 5:13your own business or your own sort of thing
- 5:15that you can go do that's not part of your job,
- 5:17it's kind of like diving off a high diving board
- 5:20with your eyes closed,
- 5:21whereas I think in practice,
- 5:23a lot of these things, like you described,
- 5:24start as like, let's test the waters,
- 5:26let's do some proof of concept,
- 5:28let's slowly build up,
- 5:29and then once you see that it's like gaining traction,
- 5:31like, all right, if I could go
- 5:32and do eight or nine hours a day instead of one,
- 5:35think what would happen.
- 5:36Yeah, absolutely.
- 5:36It's very much sort of wading in from the shoreline
- 5:39rather than jumping up a diving board.
- 5:40That's great.
- 5:41All right, so we're definitely going to get into
- 5:44the details of what Anvil is,
- 5:46but maybe just give us a really,
- 5:48really high-level picture of what you built,
- 5:51and then let's talk about your thought
- 5:53that the web is not as accessible as it should be.
- 5:55Well, what we built was a tool
- 5:57for building full-stack web apps
- 5:59with nothing but Python.
- 6:00So you can design what your page is going to look like
- 6:03in a kind of drag-and-drop visual editor,
- 6:05but everything you place,
- 6:07every button, every checkbox,
- 6:09every piece of text is actually a Python object.
- 6:12And so even your client-side code
- 6:15that's running in the browser
- 6:16is actually just Python.
- 6:17We compile this JavaScript.
- 6:19We run it there.
- 6:20Your server-side code is just Python.
- 6:22We even have a built-in database
- 6:23that you can access with pure Python,
- 6:25no SQL,
- 6:26although obviously if you want to,
- 6:27you know,
- 6:28go and pull in a MySQL database,
- 6:30you know,
- 6:31we support everything that Python supports.
- 6:32But the idea is really
- 6:34that you should be able to build
- 6:35a fully functional web application
- 6:37and publish it
- 6:38knowing nothing but Python.
- 6:39I think you could build a fully functional web application
- 6:42with hardly knowing any programming.
- 6:44I mean,
- 6:44this could easily be built like a really functional web application
- 6:49for your first computer science or programming course
- 6:53in high school or something, right?
- 6:54We have people who've done that, right?
- 6:56You know,
- 6:56we've had schools
- 6:57who've just taught their computing curriculum
- 6:59with Anvil
- 7:00precisely because of that
- 7:02because, you know,
- 7:02for the kids,
- 7:03it comes back to what I was saying
- 7:05at the beginning.
- 7:05You know,
- 7:06you want that instant feedback.
- 7:07You want to have this feeling
- 7:08that I just learned this abstract concept
- 7:10of the if statement
- 7:11and now here it is
- 7:12in buttons of colors
- 7:13and images in front of me
- 7:14right away.
- 7:14Yeah.
- 7:15So let me see if I can just describe
- 7:16the experience of using this
- 7:18which, granted,
- 7:19my experience is like
- 7:20I've only built like one little test app
- 7:22and played with it for an hour or something
- 7:24but still,
- 7:25the idea is you go to your website,
- 7:27you create an account,
- 7:28you launch a cloud browser-based IDE
- 7:31which is really focused on
- 7:34the sort of UI design layer of,
- 7:37UI and data layer of your app.
- 7:40You have a design view and a code view.
- 7:42In the design view,
- 7:43you have a bunch of components and widgets
- 7:45that you can drag over,
- 7:46images, links, buttons,
- 7:47repeaters, columns,
- 7:49all sorts of stuff.
- 7:50You can give them names
- 7:51and then you access them in Python
- 7:53in the code side of your page, right?
- 7:56Yeah, that's exactly right.
- 7:57But look,
- 7:58it's not just on the code side of a page
- 8:01because you can also then
- 8:02pull up a server module
- 8:04and then you're writing,
- 8:05again,
- 8:06it's just a Python module
- 8:07but now it's running on our servers
- 8:09and you can just make function calls
- 8:11as just a decorator for,
- 8:13this is something that
- 8:14you should be able to call
- 8:15from your client code
- 8:16and so you can make Python calls
- 8:18straight from the Python code
- 8:20that runs when,
- 8:20say,
- 8:20when you click a button
- 8:21in that code view
- 8:23through to server module.
- 8:24Right.
- 8:24And I think one of the
- 8:26sort of making this
- 8:27more accessible aspects of it
- 8:28is like,
- 8:29I've been doing a lot of JavaScript lately
- 8:30and JavaScript is like
- 8:31an intense place these days, man.
- 8:34And it didn't used to be.
- 8:37even in the early days,
- 8:38though,
- 8:38like with things like Ajax and stuff,
- 8:40you still have this sort of callback
- 8:43indirect seesaw type of programming.
- 8:46So like with what you just described,
- 8:48like you write a function on the server
- 8:50and then you write some literally Python code
- 8:52that runs in the browser
- 8:53and then you just say,
- 8:56call that function on the server
- 8:58by saying something like
- 8:59anvil.server.name of thing you wrote,
- 9:01pass the parameters,
- 9:02and it's even a synchronous call.
- 9:03Like it blocks and then continues, right?
- 9:05That's something we really wanted to do
- 9:08because,
- 9:08I don't know,
- 9:09I mean,
- 9:10I'm going to confess some bias here.
- 9:11There's a talk I gave at PyCon US.
- 9:12If you Google it,
- 9:13you can find it,
- 9:14anvil PyCon Portland talk,
- 9:16which I entitled like,
- 9:18you want to make the world better,
- 9:19put a little bit less JavaScript in it,
- 9:21which is,
- 9:22you know,
- 9:22it's like the inflammatory title,
- 9:23but fundamentally,
- 9:25when you're doing stuff like that
- 9:27in JavaScript,
- 9:27even like the hello world,
- 9:29you have to understand
- 9:30asynchronous callbacks,
- 9:32which means you have to understand
- 9:33like closures
- 9:34and anonymous functions
- 9:35and even promises.
- 9:37Well,
- 9:37that's just an abstraction
- 9:38on top of them
- 9:38and you've got to understand
- 9:39that as well.
- 9:40And like the minimal set
- 9:41of what you need to do
- 9:43for,
- 9:44hey,
- 9:44what's your name?
- 9:45Let me stick that in a database
- 9:46and read it back to you
- 9:48is like a huge amount
- 9:50of computer science.
- 9:50And we really wanted to take that back
- 9:53to what you had,
- 9:54you know,
- 9:55what you get in a REPL
- 9:56or what you had with QBasic
- 9:57or what you had with Visual Basic
- 9:59or Delphi,
- 10:00where you could just go,
- 10:01well,
- 10:02okay,
- 10:02you click the button,
- 10:02what's the first thing I do?
- 10:03Well,
- 10:04I call this function
- 10:04that puts it in a database,
- 10:05what's the second thing I do?
- 10:06Well,
- 10:06I do something else
- 10:07with the value it's returned
- 10:08and you can reason about it
- 10:12in a very straightforward manner.
- 10:13And so we've put a lot of effort
- 10:14and a lot of like compiler hacking
- 10:15in the background
- 10:16to make that happen
- 10:17so that the user model
- 10:19is as simple as it can get.
- 10:20Yeah,
- 10:21and I think it's super,
- 10:22super approachable.
- 10:23So,
- 10:24you know,
- 10:24I sort of touched on it,
- 10:25you did as well,
- 10:26like working with JavaScript,
- 10:27working on the web these days,
- 10:28it's really tricky.
- 10:29if you're not going to use JavaScript
- 10:30and you want something interesting,
- 10:31you're probably talking Django,
- 10:34Flask,
- 10:35or something else,
- 10:36Ruby on Rails,
- 10:37ASP.NET,
- 10:38but none of those are super like
- 10:40walk up and just,
- 10:40oh yeah,
- 10:42I just push the button
- 10:43and go, right?
- 10:43There's actually quite a bit of work
- 10:45to make those things
- 10:45all fit together.
- 10:46and kind of the worst of it
- 10:48is you need to do
- 10:48all of the above,
- 10:49right?
- 10:50Because if you're building
- 10:51a web application today,
- 10:53you're going to need
- 10:54at least five different
- 10:56programming languages.
- 10:56You need to write the HTML,
- 10:58you need to write the CSS
- 10:59to make it look
- 10:59how you want it,
- 11:00you need to write the JavaScript
- 11:01for it to behave
- 11:03in the browser,
- 11:03you need a server-side language
- 11:05like Python
- 11:06on,
- 11:07running on the server
- 11:08for the browser
- 11:09to talk to,
- 11:10you need to be talking SQL
- 11:11to your database
- 11:12and then you need
- 11:13a framework for the JavaScript,
- 11:15a framework for your CSS
- 11:17like Bootstrap,
- 11:17another framework
- 11:18for the JavaScript
- 11:19if you're doing this
- 11:20React plus Redux thing,
- 11:21a framework for the server-side
- 11:23language like Django,
- 11:24probably a framework
- 11:25for the database
- 11:26like SQLAlchemy.
- 11:27I mean,
- 11:28I count these on my fingers,
- 11:29I've literally just run out
- 11:30and that is a completely
- 11:32unfair bar
- 11:34to set for,
- 11:35you know,
- 11:35you must be this tall
- 11:36to ride this ride.
- 11:37This ride is the web,
- 11:39it's the greatest
- 11:39application delivery platform
- 11:41that humanity has invented
- 11:42and we make you learn
- 11:44all this stuff
- 11:45before you can basically
- 11:46do hello world
- 11:47and it's kind of interesting
- 11:49how that happened as well
- 11:50because...
- 11:51How do you think
- 11:51we got here?
- 11:52The web as a platform
- 11:54is this kind of
- 11:55Frankensteinian creation.
- 11:56It grew up in the 1990s
- 11:59and there were people
- 11:59who could see
- 12:00the, you know,
- 12:01the potential for this.
- 12:03You know,
- 12:03JavaScript itself
- 12:04was kind of dashed off
- 12:05extra famously
- 12:06constructed by Brendan Eich
- 12:08in two weeks
- 12:08but as the web
- 12:11sort of grew
- 12:11and it could be seen
- 12:12as a platform,
- 12:13Microsoft,
- 12:13who are then
- 12:14the dominant incumbent,
- 12:15put a lot of effort
- 12:17into kind of
- 12:18corralling that power.
- 12:19You know,
- 12:20you had the Internet Explorer
- 12:21Netscape,
- 12:22Monopoly Wars of the 1990s
- 12:24and you had this kind of
- 12:26semi-deliberate crippling
- 12:28of the platform.
- 12:29You know,
- 12:29how,
- 12:29if people remember,
- 12:30gosh,
- 12:31I mean,
- 12:31I realize that this makes me
- 12:33old for some people.
- 12:34if you remember
- 12:35the pain
- 12:36of trying to make
- 12:37something work
- 12:37at Internet Explorer 4
- 12:39or 5
- 12:39as a web application,
- 12:40it was really hard work
- 12:41and that was not accidental.
- 12:42Yeah,
- 12:42and then they kind of
- 12:43fixed it in Internet Explorer 6
- 12:45and then the web
- 12:46kind of suffered
- 12:46from a couple years
- 12:48of stagnation.
- 12:48It was years of stagnation.
- 12:50I think that the couple
- 12:50of years of stagnation
- 12:51is,
- 12:52that was actually
- 12:53arguably
- 12:54one of the periods
- 12:55of greatest innovation
- 12:56where it just became
- 12:57obvious how tight
- 12:58the constraints
- 12:59and limits
- 13:00that had been put
- 13:00on it were.
- 13:01because what actually
- 13:02happened is this wonderful,
- 13:03it's almost a Greek tragedy.
- 13:04You get Microsoft
- 13:06trying desperately
- 13:07to hold back
- 13:08this tide of web innovation
- 13:10so it doesn't become
- 13:11the platform of the future
- 13:12and then this,
- 13:14you know,
- 13:14around the turn
- 13:16of the millennium
- 13:16and this is like famously
- 13:18product groups
- 13:18in Microsoft
- 13:19not very well connected,
- 13:21the Outlook
- 13:21web access team,
- 13:22they go,
- 13:23well,
- 13:23wouldn't it be great
- 13:24if you could have
- 13:24like Outlook,
- 13:25an email client
- 13:26in a web browser
- 13:26and they kind of
- 13:27put enough pressure on
- 13:28to make the Internet Explorer
- 13:29team implement
- 13:30this weird,
- 13:32janky interface
- 13:33for doing like
- 13:34real-time calls
- 13:35to the server
- 13:35called XMLRPC request
- 13:37and then that
- 13:39gets released
- 13:39in like what,
- 13:412002,
- 13:412003
- 13:42and within a year
- 13:43you've got Gmail
- 13:44and Google Maps.
- 13:44Yeah,
- 13:45that just totally
- 13:46broke the dam free,
- 13:47right?
- 13:47That was when
- 13:48the whole Web2O
- 13:48sort of thing
- 13:49kicked in,
- 13:50right?
- 13:50Yeah.
- 13:51Thing happened,
- 13:51yeah,
- 13:52and so the Internet Explorer
- 13:53stick-6 stagnation
- 13:54was a bunch of people
- 13:55kind of,
- 13:56it was a belated
- 13:57putting on of the brakes
- 13:58when the dam
- 13:59had already broken.
- 14:00but the fun thing
- 14:02about this is
- 14:02what it means is
- 14:03the whole Web platform,
- 14:04the whole structure
- 14:05of the Web platform
- 14:06is built on the rubble
- 14:08of a platform war
- 14:10of the early 2000s
- 14:12and so that's why
- 14:13the ground underneath
- 14:14your feet
- 14:15is so rough,
- 14:16I would argue,
- 14:18because we're still
- 14:20trying to build
- 14:21a functional application
- 14:22platform on top
- 14:23of a system
- 14:25that was originally
- 14:25documents
- 14:26and then evolved
- 14:27against really
- 14:29like active opposition
- 14:31into an application
- 14:32platform
- 14:32and what's left
- 14:34is this Frankensteinian
- 14:35monster
- 14:35of so many
- 14:37different languages
- 14:38and frameworks
- 14:39having to work together
- 14:40to make something
- 14:40happen
- 14:41that you end up
- 14:43with this huge barrier
- 14:43to entry.
- 14:44Yeah, you do
- 14:44and I feel like
- 14:45a lot of the Web
- 14:46is like,
- 14:46well,
- 14:47we could probably
- 14:47do this better
- 14:48but this is working
- 14:50everywhere
- 14:50and that's more
- 14:51important than anything
- 14:52else.
- 14:53It's the ultimate
- 14:53path dependence.
- 14:54It's how we,
- 14:54you know,
- 14:55we got here this way
- 14:56and that's,
- 14:57so that determines
- 14:58the way things are.
- 14:58Well,
- 14:59so that probably means
- 15:00writing Python
- 15:00in the browser
- 15:01is not really
- 15:02going to be a thing,
- 15:03right?
- 15:03It's all JavaScript.
- 15:04Absolutely.
- 15:04Also,
- 15:05and this is,
- 15:05this is one of the
- 15:07things we set out
- 15:07to tackle.
- 15:08We actually use
- 15:09an open source
- 15:10Python to JavaScript
- 15:11compiler called Sculpt
- 15:12and so that's
- 15:14what enables us
- 15:15to take your Python
- 15:16code that you've
- 15:17written in this,
- 15:18you know,
- 15:18design code,
- 15:18your view thing
- 15:19and run it right
- 15:20there in the browser.
- 15:22that project
- 15:22already existed
- 15:23and there are a
- 15:24couple other
- 15:24kind of like it
- 15:25but there was a lot
- 15:27that of work
- 15:28that needed doing
- 15:28to it.
- 15:29I jumped in,
- 15:29I'm now one of
- 15:30the maintainers,
- 15:30I did the big change
- 15:32that enabled that
- 15:32blocking code you
- 15:33were talking about
- 15:34earlier,
- 15:34that was,
- 15:35that was a big
- 15:35change.
- 15:36But yeah,
- 15:37it's really quite fun
- 15:38because not often
- 15:39you get to do like
- 15:40deep compiler hacking
- 15:41and then say,
- 15:42actually,
- 15:42this is,
- 15:43you know,
- 15:43you can draw a
- 15:44direct line from
- 15:45this weird piece
- 15:47of object code
- 15:48transformation I'm
- 15:48doing to like
- 15:50I'm improving
- 15:51usability for
- 15:51seven-year-olds.
- 15:52And I mean,
- 15:53and indeed,
- 15:53I should say this,
- 15:54for developers
- 15:56of all strikes,
- 15:56right,
- 15:57for your data scientist
- 15:58who knows how to
- 15:58draw a graph
- 15:59and needs to do
- 15:59a web map.
- 16:00what I think is
- 16:01really interesting
- 16:01there is like
- 16:02you open that
- 16:03statement with
- 16:03we're improving
- 16:04sort of the
- 16:05accessibility of the
- 16:06web for seven-year-olds,
- 16:07which I think,
- 16:08as you pointed out,
- 16:09kind of downplays
- 16:10the significance of it.
- 16:11But when you get
- 16:12something that kids
- 16:13like that can start
- 16:14to use,
- 16:15what that really
- 16:16means is
- 16:16non-programmer,
- 16:17you like crack open
- 16:19like a whole new
- 16:20aspect of the web
- 16:20for non-programmers.
- 16:21People who like,
- 16:22hey,
- 16:22I could totally
- 16:23program Excel
- 16:24and I could like
- 16:26set up these functions
- 16:27and maybe an if statement
- 16:28that'll make
- 16:28like this Excel go,
- 16:29but I'm not a programmer,
- 16:30right?
- 16:31All of a sudden
- 16:31that person can become
- 16:32like they could build
- 16:34a web app
- 16:34totally with those skills.
- 16:35So this is something
- 16:36that's quite interesting
- 16:36and it's a philosophical thing.
- 16:38A lot of people
- 16:39are interested in making
- 16:40tools for non-programmers
- 16:41and actually,
- 16:42if you want tools
- 16:43for building a web app
- 16:44for non-programmers,
- 16:45there's actually
- 16:46quite a lot out there
- 16:47and it's probably
- 16:48better optimized
- 16:49for non-programmers
- 16:50than Anvil is.
- 16:51We actually take
- 16:52a different approach.
- 16:53We say,
- 16:54programming's not
- 16:55actually that hard,
- 16:57right?
- 16:58increasingly,
- 16:58people teach themselves
- 17:00to code from websites.
- 17:01They get taught in school.
- 17:03It is something
- 17:04that people think
- 17:05it's reasonable
- 17:06to teach middle schoolers
- 17:07and a whole bunch
- 17:08of people
- 17:09have learned themselves
- 17:10and I would argue
- 17:13kind of one of the
- 17:14big reasons
- 17:15we have this big
- 17:16mental block
- 17:17around,
- 17:17oh,
- 17:18programming's so hard,
- 17:19we have to make it
- 17:19accessible to non-programmers
- 17:21is that when we think
- 17:22of programming,
- 17:23we think of
- 17:25the modern
- 17:2610-layer
- 17:27web application
- 17:28stack.
- 17:28Whereas,
- 17:29actually,
- 17:29writing code
- 17:31is the best way
- 17:32to tell a computer
- 17:33how to do something
- 17:34and Python
- 17:35is one of the best
- 17:36ways to get from
- 17:38I'm learning
- 17:39these concepts
- 17:39to cool,
- 17:40I can write some
- 17:41code that gets
- 17:41some stuff done
- 17:42and that should
- 17:43be all you need.
- 17:44So,
- 17:45we're kind of
- 17:45not aiming
- 17:46at non-programmers,
- 17:47we're aiming at
- 17:49I can do a little
- 17:50bit of code
- 17:51and that should
- 17:51be enough.
- 17:52Yeah,
- 17:52I guess that's what
- 17:53I was thinking of
- 17:53as well.
- 17:54It's like people
- 17:54who are like,
- 17:55I'll take a
- 17:55two-hour or
- 17:56five-hour course
- 17:57on Python
- 17:58and put a little
- 17:59effort into learning
- 18:00to code,
- 18:00but I'm not going
- 18:01to take computer
- 18:02science four-year
- 18:03program, right?
- 18:04Like that kind of
- 18:05group.
- 18:05And you shouldn't
- 18:06need it, right?
- 18:06It's when people
- 18:07talk about coding
- 18:08as digital literacy,
- 18:09this is what
- 18:09they're talking
- 18:10about.
- 18:10You shouldn't
- 18:11actually need
- 18:11to be that
- 18:12kind of expert
- 18:13before you can
- 18:13at least participate
- 18:14in this world.
- 18:15So, funny story,
- 18:16I'm actually
- 18:17taking this
- 18:18interview from
- 18:19borrowed offices
- 18:20of a customer
- 18:21who started
- 18:23with a single
- 18:25data scientist
- 18:26and, you know,
- 18:28she had the
- 18:29stats knowledge,
- 18:30the marketing
- 18:31understanding
- 18:31for an ad tech
- 18:33product she wanted
- 18:33to build.
- 18:34As far as she
- 18:35was concerned,
- 18:35she was, you know,
- 18:36she was not a
- 18:37developer.
- 18:37She couldn't
- 18:38build the web
- 18:39app that this
- 18:39so clearly needed
- 18:40and was, you know,
- 18:42talking to agencies
- 18:43and so on.
- 18:44And then she
- 18:45found Anvil
- 18:46and suddenly
- 18:47actually she
- 18:48realized she was
- 18:49a developer.
- 18:50It's just that
- 18:51what she could do
- 18:51was, you know,
- 18:52the Python she'd
- 18:53learned in the
- 18:53course of data
- 18:54science.
- 18:54And that's kind
- 18:56of moving the
- 18:57goalposts that
- 18:58actually a lot
- 18:59more people can
- 19:00and do know
- 19:01how to code.
- 19:01They just don't
- 19:02think of themselves
- 19:02as being able
- 19:03to build stuff
- 19:04primarily because
- 19:05of the quality
- 19:06of today's tools
- 19:07rather than
- 19:08because they
- 19:09actually don't
- 19:10know how to
- 19:10program.
- 19:11And the world's
- 19:12full of people
- 19:12like that, right?
- 19:13People who can
- 19:13write a little
- 19:14bit of code,
- 19:14as you said,
- 19:15like people
- 19:16who'd in
- 19:17previous decades
- 19:19would have
- 19:20graduated from
- 19:21Excel to
- 19:22Visual Basic
- 19:22are now like
- 19:24they're the
- 19:24people who are
- 19:25writing Python
- 19:27analysis,
- 19:27you're doing a
- 19:28little bit of
- 19:28Python notebooking
- 19:29and we're trying
- 19:31to graduate them
- 19:32onto, you know,
- 19:33you can take that
- 19:33and you can build
- 19:34something real
- 19:35that in this case
- 19:36handles, you know,
- 19:37terrifying amounts
- 19:38of advertising money.
- 19:39That's awesome.
- 19:41I do feel like
- 19:42that people are
- 19:44expected to
- 19:44start software
- 19:46as they're
- 19:48compared to
- 19:49places like,
- 19:49well, this is
- 19:50how Instagram
- 19:51works with Django
- 19:52and this is how
- 19:53they use
- 19:53microservices
- 19:54and this is how
- 19:55they've written
- 19:55it to be testable
- 19:56and scalable.
- 19:57People look at
- 19:58that and they go,
- 19:59well, I can't do
- 20:00that, so I can't
- 20:01start, right?
- 20:01And I feel like
- 20:02sometimes the most
- 20:04important thing is
- 20:04just to get started.
- 20:05like, I think
- 20:06Microsoft Access
- 20:07was like one of
- 20:09the most used
- 20:10small business
- 20:11sort of things
- 20:12for basically
- 20:13forms over data,
- 20:14build something to
- 20:15work to make my
- 20:16dentistry run
- 20:18or make my little
- 20:19business run.
- 20:19I'm not a programmer
- 20:20but I can like drag
- 20:21this stuff around
- 20:21until I can get
- 20:22what I need
- 20:22and that's kind
- 20:23of gone away,
- 20:24right?
- 20:24I'm not a programmer
- 20:25but I can use
- 20:26Access to put this
- 20:27together.
- 20:27I'm not a programmer
- 20:28but I can create
- 20:30a visual basic form
- 20:31to do this one
- 20:31thing that's
- 20:32application specific.
- 20:33I'm not a programmer
- 20:34but I've now
- 20:35created this line
- 20:36of business
- 20:37application that
- 20:38runs my business
- 20:39and Microsoft
- 20:40have basically
- 20:41taken one look
- 20:41at this and
- 20:42realized that they
- 20:42had to guarantee
- 20:43support for
- 20:44applications written
- 20:45in Visual Basic 6
- 20:45out to like the
- 20:472030s or something
- 20:48because you give
- 20:49people this ability
- 20:50to like slide
- 20:51into building code
- 20:53and you know
- 20:54you give people
- 20:54this power and
- 20:55amazing things
- 20:55happen.
- 20:56Although, yeah,
- 20:57something we've
- 20:58been working on
- 20:59quite a lot with
- 21:00Anvil is to
- 21:01support that whole
- 21:01journey because I
- 21:02don't want to
- 21:03like pretend
- 21:04that good
- 21:06architecture and
- 21:07testing and all
- 21:07these things aren't
- 21:09important and so
- 21:10a real, the big
- 21:13design goal for us
- 21:14with Anvil is to
- 21:16have something you
- 21:16can get started
- 21:18with without this
- 21:20huge barrier to
- 21:20entry but is not
- 21:22going to stop you
- 21:23achieving mastery
- 21:25and proper design
- 21:27and scaling your
- 21:28app and scaling
- 21:29your code.
- 21:30Right.
- 21:30You don't want to
- 21:31set a really low
- 21:31ceiling.
- 21:32Yes, exactly.
- 21:33don't want to
- 21:33set a really high
- 21:34barrier to entry.
- 21:35Yeah, and we're
- 21:36convinced that this
- 21:37is possible and we
- 21:38think that, you
- 21:39know, we are well
- 21:40on the way if not
- 21:41already there for
- 21:41most people's use
- 21:42cases and I think
- 21:44that there's a bit
- 21:46of a sense that
- 21:48the floor is so
- 21:49high on the
- 21:50traditional tools
- 21:50anything with a
- 21:51lower floor must
- 21:52have a much lower
- 21:53ceiling and I just
- 21:54don't think that's
- 21:54true.
- 21:54I think that's
- 21:55awesome.
- 21:55So maybe now is a
- 21:56good time to like
- 21:57start actually getting
- 21:58into the details of
- 21:59Anvil.
- 21:59People can check it
- 22:00out at
- 22:00Anvil.works,
- 22:01right?
- 22:01You can go there.
- 22:02There's some actually
- 22:02really nice videos and
- 22:04some really intriguing
- 22:05things but it
- 22:06basically starts, you
- 22:07say, create a new
- 22:08project.
- 22:08It happens on your
- 22:10web IDE and it
- 22:12drops you basically,
- 22:13well, why don't you
- 22:14walk us through it?
- 22:14So it doesn't just
- 22:15drop you into a blank
- 22:16page necessarily,
- 22:17right?
- 22:18if you sign up at
- 22:18Anvil.works, it is
- 22:19free to sign up.
- 22:20You end up in this
- 22:23IDE and you can choose
- 22:24some of our sample
- 22:25apps and see what
- 22:25we've done before but
- 22:26if you just create a
- 22:27new app, you start
- 22:28with selecting a
- 22:29visual theme and you
- 22:31create a new form
- 22:32which is like a page
- 22:34in your site.
- 22:35You've then got this
- 22:37form.
- 22:37It's not fully blank.
- 22:38It's already got like
- 22:39the visual structure in
- 22:41there and for this
- 22:44point you have a
- 22:45toolbox of stuff on the
- 22:46right that you can
- 22:47just drag on and
- 22:49visually create your
- 22:50page and everything
- 22:52you drag on is a
- 22:54Python object and if
- 22:55you sort of scroll
- 22:56down on the right you
- 22:57can have, you can see
- 22:58its properties like for
- 23:00example if you put some
- 23:00text on there's, you
- 23:02know, the font size of
- 23:03the text, there's the
- 23:04string that's what the
- 23:04text actually is, there
- 23:06is, you know, there's
- 23:07which font, there's
- 23:08which color, all that
- 23:09kind of stuff and you
- 23:12may or may not realize
- 23:13it at this point but
- 23:13you're actually just
- 23:14editing attributes of a
- 23:15Python object that is
- 23:16going to be created at
- 23:17runtime.
- 23:18Hey everyone, this is
- 23:20Michael.
- 23:20Let me tell you about
- 23:21Datadog.
- 23:21They're sponsoring this
- 23:22episode.
- 23:22Performance and
- 23:24bottlenecks don't exist
- 23:25just in your application
- 23:26code.
- 23:26Modern applications are
- 23:28systems built upon
- 23:29systems and Datadog
- 23:30lets you view the
- 23:31system as a whole.
- 23:32Let's say you have a
- 23:33Python web app running
- 23:34Flask.
- 23:35It's built upon MongoDB
- 23:36and hosted and scaled
- 23:37out on a set of Ubuntu
- 23:38servers running Nginx and
- 23:39uWSGI.
- 23:40Add Datadog and you can
- 23:42view and monitor and
- 23:43even get alerts across
- 23:44all of these systems.
- 23:45Datadog has a great
- 23:47getting started tutorial
- 23:48that takes just a few
- 23:49moments and if you
- 23:49complete it, they'll send
- 23:50you a sweet Datadog t-shirt
- 23:52for free.
- 23:52Don't hesitate.
- 23:53Visit talkpython.fm
- 23:55slash Datadog and see
- 23:57what you've been missing.
- 23:58That's talkpython.fm
- 23:59slash Datadog.
- 24:01Yeah, like you said, you
- 24:02may or may not know, but
- 24:03it has this very Visual
- 24:04Basic 6 designer feel,
- 24:06right?
- 24:06Like you see it, you drag
- 24:08the stuff on there, you
- 24:10have a properties pane, you
- 24:12change the name, and then
- 24:13maybe if there's like a
- 24:14button, you have these
- 24:15events, right?
- 24:15So there's various things
- 24:16that might have events.
- 24:17Like if you double click a
- 24:18button, it drops you into
- 24:20like this code behind type
- 24:22thing, which is a Python.
- 24:24Yeah, tell us about that
- 24:25back there.
- 24:26If you double click a
- 24:26button, you're immediately
- 24:27dumped into a function that
- 24:29runs and that button gets
- 24:30clicked, and it's actually
- 24:32a method of a class that
- 24:33represents the whole page.
- 24:34All of this is Python,
- 24:35right?
- 24:36Absolutely, all Python.
- 24:37And all those things you
- 24:38dragged onto the page are
- 24:41in fact accessible as
- 24:42instance variables, so
- 24:43you know, self.label1 or
- 24:45whatever, in that Python
- 24:47code.
- 24:47So it's a very natural
- 24:49thing.
- 24:50I mean, you said Visual
- 24:51Basic 6 and Delphi, and
- 24:53no two ways about it.
- 24:54Anvil owes a huge debt to
- 24:56those rapid application
- 24:57tools of the 1990s, because
- 24:59that was a really good way
- 25:01to work.
- 25:01They were hugely successful
- 25:03in building quick little
- 25:04applications rather than
- 25:06hiring like a big dev team,
- 25:07but they ran on Windows
- 25:0995, not on the internet.
- 25:11You'll spend most of your
- 25:12time, if you're editing an
- 25:14Anvil app, switching between
- 25:15the visual design to put
- 25:18some visual component on and
- 25:20the code that runs when you
- 25:23interact with these
- 25:23components.
- 25:24everything there will be
- 25:26compiled to JavaScript and
- 25:28will run in the user's
- 25:29browser.
- 25:29You'll then, of course, if
- 25:31you're writing most non-trivial
- 25:33web apps are going to
- 25:34require a server component, so
- 25:36you can add a server module to
- 25:37your app.
- 25:37And that's a Python module that
- 25:40runs on our servers, original
- 25:42naming, right?
- 25:42And you can put whatever you
- 25:45like into that module.
- 25:45It's just a Python module.
- 25:46But any functions that you
- 25:48annotate with at
- 25:49anvil.server.callable,
- 25:50just a decorator, those
- 25:52functions you can then call
- 25:54from your client code.
- 25:56Right.
- 25:56Much like writing like a
- 25:57Pyramid or Flask web method.
- 26:00You just put a decorator on it
- 26:01and then it's accessible.
- 26:03But somehow there's a kind of
- 26:05a really nice link both through
- 26:07the autocomplete
- 26:08IntelliSense side of things as
- 26:10well as the calling side with
- 26:12the Python that is the code
- 26:14behind for your page that
- 26:15actually runs in the browser
- 26:16and the Python that you write
- 26:17that actually lives in the
- 26:19server, right?
- 26:19Not knocking Flask because
- 26:21Flask is excellent for
- 26:22building REST APIs, but
- 26:24having to squeeze all of
- 26:26your app state through this
- 26:28choke point of it must be
- 26:30representable as a REST API
- 26:32and as JSON is one of those
- 26:34things that makes the web
- 26:35unnecessarily difficult and
- 26:36we explicitly avoid that.
- 26:38So when you mark a
- 26:39function as callable in a
- 26:41server module in Anvil and
- 26:42then you call it from your
- 26:44client code, as well as being
- 26:46autocompleted right through
- 26:47and, you know, if you get an
- 26:48exception, there'll be a
- 26:49stack trace that shows the
- 26:51call going from the service
- 26:52of the client exactly where
- 26:53it blew up, which is very
- 26:55hard to do over something
- 26:56like REST.
- 26:56You can also pass in or
- 26:59return much richer data
- 27:00structures.
- 27:01I mean, you can pass in or
- 27:02return anything that could be
- 27:03JSONs, so, you know, lists,
- 27:05dictionaries, strings, numbers,
- 27:07none, etc.
- 27:07But you can also do things like
- 27:10returning a row from a
- 27:12database.
- 27:13Actually, I'll just explain
- 27:14what that is.
- 27:15So a lot of apps will
- 27:17require some app-specific
- 27:18storage.
- 27:19And because it's just Python,
- 27:21if you already have a
- 27:22database, you can just, you
- 27:23know, import PyMySQL, import
- 27:25Psycopegee, connect to a
- 27:27database and go on.
- 27:28You know, many people do.
- 27:29But a lot of the time you'll
- 27:31require something apps, some
- 27:32app-specific storage.
- 27:33And Anvil has a built-in
- 27:35database we call the data
- 27:36tables for that.
- 27:37That's based on Postgres,
- 27:38right?
- 27:39Yes.
- 27:39So it's backed by Postgres
- 27:40and the tables themselves
- 27:42have a directly Pythonic API.
- 27:44So you don't actually write
- 27:46SQL to interact with them.
- 27:47You can if you've got a
- 27:48dedicated instance and you
- 27:50have your own database and
- 27:51we don't mind you writing
- 27:52Towers of Hanoi in SQL.
- 27:54But this means that the data
- 27:57table itself is a Python
- 27:59object.
- 28:00So if I create a data table
- 28:02to store all the visitors to
- 28:03my form, I entitle it
- 28:04visitors.
- 28:05I've then got app tables
- 28:06dot visitors accessible as
- 28:07an identifier in my code,
- 28:09just like those components
- 28:10are accessible as Python
- 28:11objects in my code.
- 28:12And I could return that.
- 28:15I could search for a set of
- 28:17rows and those rows will
- 28:18become live objects.
- 28:20You can access them like
- 28:21dictionaries to, you know,
- 28:22get the column values out
- 28:23or you can update them by
- 28:24going, you know, row,
- 28:25bracket quote, name,
- 28:27bracket is Meredith.
- 28:28Okay.
- 28:29So I think there's some
- 28:30really interesting stuff
- 28:31happening here in that you
- 28:32have Python that looks like
- 28:35it's just regular Python,
- 28:35but actually runs and
- 28:36sculpt in the browser and
- 28:37you've got Python that runs
- 28:38on the server.
- 28:39Where can I access this
- 28:41database?
- 28:41Because it could be like,
- 28:43do I have to do it only on
- 28:44the server or can I put it
- 28:46in my like button click?
- 28:47Not necessarily should,
- 28:48but that I could.
- 28:49Absolutely.
- 28:49So the thing I was leading
- 28:52up to, we were talking
- 28:53about the client server
- 28:54calls.
- 28:54The reason that we benefit
- 28:56from not squeezing
- 28:57everything through this
- 28:58choke point of a REST API
- 28:59is you can return a row
- 29:03from a database as a
- 29:03Python object.
- 29:05from this server code
- 29:06and it will pop out of
- 29:08your, the call as a
- 29:09return value in the
- 29:10client code.
- 29:11And this means you can
- 29:13absolutely just directly
- 29:14access this in client
- 29:17code.
- 29:17I mean, in fact, for any
- 29:18data table, you can set
- 29:19its permissions.
- 29:20You can say, actually,
- 29:21this table should be
- 29:22completely readable from
- 29:23client code.
- 29:23And then in your form
- 29:25code, in the stuff that
- 29:26gets compiled to JavaScript,
- 29:27you can go iterate through
- 29:29all the rows of the table
- 29:29if it's readable from the
- 29:30client.
- 29:31Why shouldn't you be able
- 29:32to?
- 29:32Yeah, that's cool.
- 29:32And you also get like a
- 29:33visual designer type thing
- 29:35for the databases and the
- 29:36relationships and stuff.
- 29:37Yeah.
- 29:37So yeah, if you're, you can
- 29:39say, oh, there's, here's a
- 29:40bunch of components.
- 29:41I'm repeating it for every
- 29:43element of list.
- 29:45And again, like this is
- 29:46something we gain from
- 29:47everything being Python
- 29:48because that list is just a
- 29:51list of Python objects and
- 29:53you can give it a hint or the
- 29:54autocompleter can work out
- 29:56what type the Python objects
- 29:57were.
- 29:58And if, for example, it
- 30:00knows that you've given it a
- 30:01list of rows from such and
- 30:03such a database, then when
- 30:05you, when you were in the
- 30:06visual designer and you pull
- 30:07up the data bindings and you
- 30:08say, I want the text on this
- 30:10label to be the name column
- 30:13from this row in the
- 30:14database, it could
- 30:15autocomplete that for you
- 30:16because it's all using the
- 30:18same object model.
- 30:19It's all using the same
- 30:19language and it knows, for
- 30:21example, what options are
- 30:23available for column lookup
- 30:25on that row.
- 30:25And that I think is a really
- 30:27powerful thing for making
- 30:28this stuff a lot faster.
- 30:29I think also that that's a
- 30:31super important component for
- 30:33people who are getting
- 30:34started.
- 30:34They, they look at code and
- 30:36they're like, I don't know
- 30:36what to type.
- 30:37Right.
- 30:38But if you type dot and
- 30:39like, here's a list, like,
- 30:39oh, it says text.
- 30:40Okay, cool.
- 30:41That must mean like that's the
- 30:42value that's in the input
- 30:43box or I type dot customer
- 30:46dot name.
- 30:46Oh, that's the name of the
- 30:47customer, right?
- 30:48That's super helpful.
- 30:49So there's a talk that I, a
- 30:51lightning talk I just gave at
- 30:52Python UK.
- 30:53So last Sunday, that will be
- 30:55going up on our website soon,
- 30:56possibly by the time this
- 30:57podcast gets published,
- 30:59where I talk about the
- 31:01autocompleter and how we
- 31:02built it.
- 31:02But actually I spent about
- 31:03half the talk talking about
- 31:04how no really autocomplete is
- 31:06just terribly important.
- 31:08And seriously, listeners out
- 31:10there, if you spend all your
- 31:11days in Vim or Emacs and you
- 31:14don't use an autocompleter, I
- 31:16would just recommend just try
- 31:18for a week, install the Jedi
- 31:20plugin for Vim or Emacs and
- 31:22experience what using autocomplete
- 31:25is like for your code creation
- 31:26because you're faster, you know
- 31:29what you're doing, you can
- 31:30eliminate whole classes of bugs
- 31:31without ever even hitting the
- 31:33run button.
- 31:33And you get this, you know, you
- 31:36get to stay in flow rather than
- 31:37going out to check the document,
- 31:38documentation every five
- 31:40seconds.
- 31:41Yeah, I use PyCharm a lot and
- 31:42that's one of the main things
- 31:44that I find it super helpful
- 31:45for.
- 31:45You do the editor question at
- 31:46the end, but yes, absolutely.
- 31:48And I have to say we spent a
- 31:49while thinking that we could do
- 31:51without autocompletion and
- 31:53create a application development
- 31:55environment that was fun to use
- 31:56and we were just wrong.
- 31:57You need it.
- 31:58You need that reassurance.
- 32:00Yeah, what I think is really
- 32:01interesting is you actually span
- 32:02like client server with
- 32:03autocomplete and stuff as well.
- 32:05Yeah, well, no, this is
- 32:06honestly the biggest thing.
- 32:07It's when one of the reasons
- 32:09that a lot of people, again,
- 32:11when back in the 1990s, your
- 32:13standard tools all had
- 32:14autocomplete, why people have
- 32:16kind of lost it now is because
- 32:18the tools don't know about, oh,
- 32:20well, what's on the other end of
- 32:22this rest call I'm making?
- 32:24What options will be available on
- 32:25the thing that comes back?
- 32:26And actually, because it's all in
- 32:28the same system, it's all in the
- 32:29same language, the autocomplete
- 32:31goes, well, you know, I passed the
- 32:32return statement that will give me
- 32:34this value five seconds ago.
- 32:35I know exactly what it's
- 32:36returning and I'm going to
- 32:37autocomplete the columns available
- 32:39on this database, right?
- 32:39That's actually really, really
- 32:41nice.
- 32:41And we preserve that.
- 32:43And again, because we have this
- 32:45rich interface that's not
- 32:47squeezed over a rest connection,
- 32:48we can do things like we have a
- 32:51built-in capability security
- 32:53model, which is a fancy word for
- 32:55a thing that you most of the
- 32:56time just don't need to think
- 32:57about, which is if you've got
- 32:58one of these rich objects and you
- 33:00return it from a server function,
- 33:01that was you giving the client
- 33:03access to that object.
- 33:05So if there's a data table that
- 33:07the server can access and the
- 33:08client can't, but there's some
- 33:09server function that says, well,
- 33:11okay, I will give you the rows
- 33:12that belong to your user.
- 33:13As it's returned to those, you've
- 33:15now got read access to those rows
- 33:17that belong to your user.
- 33:18And so you can use them directly
- 33:20in client code.
- 33:20That's cool.
- 33:21How much ability do you have to
- 33:23structure things other than this
- 33:25like page code behind thing in
- 33:28Python?
- 33:29Like, can I create like classes and
- 33:31helper modules and stuff in Python
- 33:32that actually run and sculpt?
- 33:34So we've got server side modules
- 33:36that run purely on the server and
- 33:37that's code that the client never
- 33:39sees and is trustworthy.
- 33:40And then we've also got like
- 33:41utility modules, which can be
- 33:43imported from client and server.
- 33:44And again, they're just Python
- 33:46modules you can import.
- 33:47So, you know, common code that'll
- 33:49be between lots of your pages.
- 33:51We've also got a system where you
- 33:53can take your whole app and kind of
- 33:56package that up as well as a Python
- 33:58package that other apps can depend
- 33:59on.
- 34:00So you could say, you know, oh, I've
- 34:02built a form for, I don't know, for
- 34:05displaying a progress bar.
- 34:06This is something that actually one of
- 34:08our users did in the forum recently.
- 34:09I built a progress bar form and I'm
- 34:12going to export this as a package that
- 34:15somebody else can import.
- 34:17So you can also structure your code in
- 34:18that kind of reusable libraries way.
- 34:20Right.
- 34:20That's a really cool bit.
- 34:21Like, I can't remember the last time
- 34:24in the web that I had like a sort of a
- 34:26drag and drop reusable visual component
- 34:29that had both a visual aspect and a
- 34:32functional aspect.
- 34:32But you guys have that, right?
- 34:34You can create these like sub element
- 34:36controls and like drop them.
- 34:37I mean, it's been probably 10 years
- 34:40since I've worked in a web framework
- 34:41that had that.
- 34:41Yes.
- 34:42This is the thing, right?
- 34:43People say, oh, it's been 10 years.
- 34:44What happened to progress?
- 34:45Why did we go backwards in those 10
- 34:47years?
- 34:47Yes, absolutely.
- 34:49So when you import one of these, if
- 34:50you, when you import a dependency
- 34:52that's got some of this stuff in, as
- 34:55well as being able to like import the
- 34:56utility modules, you know, just like
- 34:58you'd import Python modules.
- 34:59And of course they ought to complete
- 35:00and blah, blah, blah.
- 35:01You've also got this server side code
- 35:03you can bring in.
- 35:04So you can make, you've brought in the
- 35:06client side code, you've brought in the
- 35:07server side behavior and you've brought
- 35:10in the visual design all at once.
- 35:12So you can create these reusable
- 35:14components that will abstract away a
- 35:17lot of the fuss people.
- 35:19people currently have to re-implement
- 35:2110 times.
- 35:21There could be actually almost a
- 35:24marketplace for people to create
- 35:26really powerful little controls.
- 35:28Tell me about it.
- 35:29That's definitely on our radar.
- 35:31I don't have anything to talk about
- 35:32yet, but yes, you would not be the
- 35:34first person to ask for that.
- 35:35Yeah.
- 35:36I mean, definitely in like the Windows
- 35:38forums, VB space, there were companies
- 35:40that like just, they built these
- 35:42components that you could buy.
- 35:43Like I need a really cool graphing
- 35:45component or I need like a, I don't
- 35:47know, like a login component or
- 35:48something and you just drop them in
- 35:49there.
- 35:50Yeah.
- 35:50And I feel like we've already kind of
- 35:51proved out that model with the
- 35:54components and services we already
- 35:56provide within Anvil.
- 35:57So as well as like forms and modules
- 36:00and server modules, in an Anvil app, you
- 36:02just hit a plus button next to the word
- 36:04services and you get the option of
- 36:06adding a bunch of pre-built
- 36:09interfaces to various external services.
- 36:13So, I mean, the data tables is one I've
- 36:14already talked about, but you could, for
- 36:16example, you know, add the Google API
- 36:17service and that's just a bunch of
- 36:19packaged up functions for dealing with
- 36:22files in Google Drive, accessing Google
- 36:26Sheets documents, authenticating people
- 36:29with their Google accounts.
- 36:30So maybe some company that runs on Excel
- 36:33could take all of their Excel documents,
- 36:35drop them into Google Docs, and then you
- 36:38could access them and convert them, access
- 36:40them as Google Sheets and use them as
- 36:42companies that do that have done that
- 36:45with Anvil.
- 36:45Okay.
- 36:45Yeah, for exactly that reason.
- 36:47And that's enabled by the fact that there
- 36:49is this drop-in, you know, client and
- 36:51server and UI service that provides the
- 36:56things you will need if you want to
- 36:58interact with the Google API.
- 37:00And similarly, you know, we have something
- 37:02equivalent for Facebook and a couple of
- 37:04other things.
- 37:05Yeah, you guys have Stripe, like a super
- 37:07simple integration with Stripe.
- 37:08Oh, yes, absolutely.
- 37:09So if you want to get money, again, just a
- 37:12Stripe integration just off the shelf.
- 37:14Yeah, that's awesome.
- 37:15You have email, you have user management.
- 37:17Those are both pretty impressive.
- 37:18Yes.
- 37:19Well, user management was what I really
- 37:20wanted to talk about.
- 37:21It's the perfect example.
- 37:22The user management service is implemented.
- 37:24I don't think there's any, no, there is no
- 37:27JavaScript in the entire thing.
- 37:29It's all implemented using the standard
- 37:31API.
- 37:32So user service is a perfect example of
- 37:34something that you could have written
- 37:35yourself.
- 37:36In fact, people, of course, people did.
- 37:37People did before we had it implemented.
- 37:39But it's just a data table with, you know,
- 37:43a column for email, a column for your
- 37:44bcrypt hash password.
- 37:45Oh, you guys are using bcrypt?
- 37:47That's awesome.
- 37:47You know, a server function that you pass
- 37:50in a username and password and it looks up
- 37:52the user and says, does it match?
- 37:53And if so, it stores something into the
- 37:55session.
- 37:56And, you know, you can use the Google API
- 37:58service to say, oh, who's, you know, log this
- 38:00user in with Google, who's logged in.
- 38:02Right.
- 38:02You got the OAuth 2 stuff.
- 38:03It's all something you could build, but you
- 38:04don't want to have to every time you want to
- 38:07build a web application.
- 38:08I'm working on a project right now and I spent
- 38:10like literally a full day just working on
- 38:13user management.
- 38:13And I'm like, yep, this is just like the
- 38:15stuff I wrote six months ago.
- 38:16And it's also going to be probably what I
- 38:18write six months from now.
- 38:19So I feel like I'm always reinventing user
- 38:22management.
- 38:23So that's cool that that's kind of a plug
- 38:25and play thing.
- 38:25We've tried to pick off some like low hanging
- 38:27fruit, the things that people reinvent a lot.
- 38:29And user management was, I mean, pretty much
- 38:31top of that list.
- 38:32Yeah.
- 38:32How many times have you written an email
- 38:35validation link processor thing?
- 38:38Too many.
- 38:39I want my life back.
- 38:40Exactly.
- 38:40But really, that's just the low hanging fruit
- 38:45because there's tons of stuff out there that
- 38:47people implement every day and shouldn't have
- 38:51to, they should, they should be able to
- 38:52create reusable libraries.
- 38:53And we're really excited to have that kind
- 38:57of ease of use come to other domains in
- 39:00that.
- 39:00So if you're Esri and you're like a company
- 39:02that creates the company that creates ArcGIS,
- 39:05you wanted people to access your stuff.
- 39:07Maybe you could just drop in like, here's
- 39:09how you just plug into our web service and
- 39:11just get to your like cloud GIS stuff.
- 39:13Right.
- 39:13Or things like this.
- 39:14Yeah.
- 39:15That's beautiful.
- 39:15This portion of Talk Python To Me was brought
- 39:19to you by GoCD.
- 39:20GoCD is an on-premise, open source, continuous
- 39:24delivery tool to help you get better visibility
- 39:26into and control of your team's deployments.
- 39:29With GoCD's comprehensive pipeline modeling,
- 39:31you can model complex workflows for multiple teams
- 39:34with ease.
- 39:35And GoCD's value stream map lets you track changes
- 39:39from commit to deploy at a glance.
- 39:41Say goodbye to deployment panic and hello to
- 39:43consistent, predictable deliveries.
- 39:45We all know that continuous integration is super
- 39:47important to the code quality of your applications.
- 39:49Choose the open source local CI server, GoCD.
- 39:53Learn more at talkpython.fm/gocd.
- 39:57That's talkpython.fm/gocd.
- 40:00And I mean, Anvil already, again, all of this stuff is stuff you could do yourself.
- 40:04We have a bunch of really cool stuff for interacting with web services.
- 40:07I mean, if you're a client of a web service, you probably just want the requests library
- 40:11and then you're off.
- 40:12But making that easy and simple and tab completing their whole API is a kind of thing that companies will want.
- 40:22And it's something we've talked to with companies before.
- 40:25And we're really excited about bringing that kind of,
- 40:27oh, OK, I want to do telephony.
- 40:29Fine.
- 40:30Yeah, that's one import and autocomplete.
- 40:32Exactly.
- 40:32Exactly.
- 40:33Drop in the Twilio module or whatever, whoever it is, right?
- 40:35So this is all super interesting.
- 40:38And these component type things are super cool.
- 40:40But one, I guess the thing that probably was most impressive to me that showed like,
- 40:45OK, you have this thing that runs in your environment and is hosted.
- 40:49And I want to talk about like what that means.
- 40:51Before we talk about that, though, let's talk about Uplink, your final service.
- 40:55Oh, yeah.
- 40:55Well, so Uplink isn't really service.
- 40:57The Uplink is yet another example of a pattern that we do right the way throughout Ambil.
- 41:04Everything's built in abstractions, right?
- 41:06You know, you can solve every problem in computer science with another layer of abstraction,
- 41:10except the problem with too many layers.
- 41:11Right.
- 41:12If it doesn't work, you add one more, yeah.
- 41:13Yeah.
- 41:14And Ambil is an abstraction over the web.
- 41:15And of course, every abstraction has its limits.
- 41:18Every abstraction leaks, to quote that famous essay.
- 41:22And the question is, how does your abstraction handle it when you hit the edge?
- 41:26And I mean, JavaScript frameworks basically handle it by letting it all hang out.
- 41:30But, you know, you can't use these JavaScript frameworks without understanding quite a lot
- 41:34about how they work underneath anyway.
- 41:35So you can just, you know, pull away bits of the foundation and edit it yourself if you need to.
- 41:39Some abstractions, like if you're writing a Windows desktop application and you need it to run on the web,
- 41:45you're kind of stuck.
- 41:47You know, you're going to have to do some serious rewriting or interfacing.
- 41:50But the pattern I most like is kind of, I should say, there's also this kind of ejection pattern.
- 41:57There's a tool called Create React App, if you're familiar with it.
- 42:01I forgive you if you're not.
- 42:02But the idea is it simplifies a bunch of the creation of, you know, the front-end build process.
- 42:09So I want to take my source code and compile it to another form of JavaScript,
- 42:12compile it to another form of JavaScript, minify it and deliver it as one asset.
- 42:15And it takes a lot of that kind of pain away from you.
- 42:17But of course, it's going to be limited and it's going to be an abstraction that won't let you do absolutely everything your platform requires.
- 42:24And if you hit this limit, there's a handle you can pull like eject.
- 42:28And then it will say, well, you're done here.
- 42:30I will dump out all like the high complexity stuff for you and say, well, right, you can edit it.
- 42:37You know, you can edit a webpack configuration now.
- 42:39Oh, goody.
- 42:40And like if Anvil had something similar, it would be like, oh, this thing is now a horrendously complicated JavaScript app using this Python JavaScript compiler you have no familiarity with.
- 42:49Have fun.
- 42:50And that's actually slightly, I mean, it's more user-friendly than like making the user go down with a ship.
- 42:55But it's still quite high complexity.
- 42:59And what we try to do is instead of an ejector seat, we've got escape hatches.
- 43:03So you want to do some specific visual design on your web page.
- 43:08Well, that's fine.
- 43:09If you want to, you can drop down and edit the HTML and CSS that makes up the template into which these Anvil components are dropped.
- 43:16And you can create your own house style and, you know, bring in assets from a professional designer and use that.
- 43:22If you have some, you know, you want to build something like WebRTC was a request I got recently.
- 43:27You know, we don't support that yet.
- 43:29We will one day.
- 43:29We don't yet.
- 43:30I want to use this advanced feature of the browser platform.
- 43:33Well, that's okay.
- 43:34I can write some JavaScript.
- 43:36Some JavaScript.
- 43:37And then I can call it from Python.
- 43:39It can call into my Python.
- 43:40And then I can package all of that up as one of these custom components.
- 43:43Make a library so other people can just say import my code.
- 43:46And now you have WebRTC support.
- 43:47It's all auto-completed.
- 43:49It's all nice.
- 43:49It's all in Python.
- 43:50You don't have to worry about it.
- 43:52And the server-side version of this is the uplink.
- 43:54So the uplink, it's a library you can pip install from anywhere in the world.
- 44:00And when you enable it for your app, you get an authentication key.
- 44:03And you do anvil.server.connect and you give it this authentication key.
- 44:08And now your Python code, wherever it's running in the world, is connected to your Anvil app.
- 44:12It makes a secure WebSocket connection in.
- 44:14It's really quite impressive.
- 44:16I think maybe give us the example that you have on your website with the Raspberry Pi.
- 44:20Because I think that really highlights how flexible this is.
- 44:22So if you've got a Python code, if you've got Python code running somewhere in the world,
- 44:26and you Anvil server-connect in, all those things you can do on the server module,
- 44:29you can do from your Python code, wherever it is.
- 44:32And there's an example tutorial video on our site of me doing this with a Raspberry Pi.
- 44:38So I take a Raspberry Pi.
- 44:39I write, like, with two lines of code.
- 44:42If you've ever used a Raspberry Pi, you can get something called a SenseHat for it,
- 44:45which is an LED array.
- 44:46And it's, like, really super simple to display some text scrolling across that LED array.
- 44:51It's very nice.
- 44:52And I write a function that takes a piece of text, displays it on that.
- 44:57Because I've got the uplink, all I do is I mark that at Anvil.server.callable,
- 45:01just like I would in a server module.
- 45:02And all of a sudden, I can call it from my web app.
- 45:05Just to be clear, this is a function running on the Raspberry Pi.
- 45:08It's being called by your Anvil app.
- 45:11Absolutely.
- 45:12There's a function running on the Raspberry Pi.
- 45:13It's crazy.
- 45:13Called from a web browser.
- 45:16Why shouldn't you be able to do that, right?
- 45:17Yeah, it's beautiful.
- 45:18It's one call.
- 45:19We don't even use a server module.
- 45:20We call it straight from the browser.
- 45:22Yeah, that's really incredible.
- 45:23And it even goes straight through firewalls and stuff.
- 45:26You don't even have to open a port because it's an outbound connection to establish that socket, right?
- 45:30And so you can drive code.
- 45:32I mean, obviously, the Raspberry Pi is a slightly educational, possibly slightly facetious example.
- 45:37But, you know, we've got people driving big, like, machine learning jobs that need to run on some dedicated server somewhere with, like, 20 GPUs in.
- 45:46And, like, you know, if they tried to do that inside our server modules, they'd hit their CPU quota pretty quickly.
- 45:51And that would be the end of that.
- 45:52But because there's a route to plug your code into Android wherever it is, they just import the uplink module, you know, mark some control functions callable.
- 46:02And they can drive this big GPU rig from our hosted web stuff just as easily as you could drive this Raspberry Pi on your desk to display something just as easily as you could be driving a server function.
- 46:15This is a really cool feature.
- 46:16I really like it.
- 46:17So maybe this is a good time to talk about, like, what it means to publish your code, where is it hosted, things like that.
- 46:23So tell me about where I can put this code.
- 46:25When I hit publish on your site, what does that mean?
- 46:28It's hosted on our infrastructure.
- 46:29We were talking earlier about this hugely deep web stack you need to understand all of.
- 46:33And you need to understand all of before you can do, like, even Hello World on the web.
- 46:38And we didn't talk about the layers lower on the stack, right?
- 46:41Also, if I want to deploy a Hello World on the web, I'm going to need to understand, like, you know, AWS, spin up a server.
- 46:46I'm going to have to understand how to administer a Linux computer usually.
- 46:50I'm going to have to publish that.
- 46:52I'm going to have to keep it up to date with security updates because I don't want to be the next Equifax being popped by, you know, months old known vulnerability.
- 46:59And that, too, is a barrier to entry.
- 47:02And tools like Heroku can help.
- 47:04But what Anvil does is we do the whole package.
- 47:07So you write your code in Anvil, and it's hosted on our platform as well.
- 47:10So you hit the publish button from the Anvil editor, even if you, you know, just signed up 30 seconds ago.
- 47:16You hit the publish button, and you've got a URL that is your app on the web already.
- 47:21By default, obviously, it's a private URL.
- 47:24It's like one of those Google Apps sharing links.
- 47:26So, you know, Google Docs, if I send you this link, you can open it.
- 47:30But if you don't have it, you can't get it.
- 47:32And this is really powerful because it means that your turnaround time is really low.
- 47:38You can get something onto the web very quickly.
- 47:40And you're not worrying about all that ongoing maintenance burden of, ooh, have I updated the server this week?
- 47:45Yeah, I think that's really cool.
- 47:47And where's your infrastructure actually running?
- 47:48Is it AWS or somewhere else?
- 47:50We run in AWS.
- 47:51Okay.
- 47:51But, I mean, we also run on-site stuff.
- 47:53Go on.
- 47:53Sure.
- 47:54And you guys have an option to let it, to basically have an on-prem version, right?
- 47:57Absolutely, yeah.
- 47:58And, of course, that is just, you know, a few Docker containers, one Docker-compose command,
- 48:02and you've got a local version of Anvil running on your own machine.
- 48:05Yeah, that's cool.
- 48:06So our code runs in Docker on some Linux machine in AWS, basically, when we run it, the server code?
- 48:11Absolutely, yes.
- 48:12Okay.
- 48:12It's a little bit more tightly locked down than that, but yes.
- 48:15Yeah, sure.
- 48:15And do I get to pick the data center?
- 48:19Not at the moment.
- 48:20You will want one of, there's a business-dedicated hosting plan that says, essentially, we will put the VM wherever you like, and you can have it to yourselves.
- 48:27Okay.
- 48:27Yeah, that's pretty cool.
- 48:28So I think what you guys have built really is quite interesting, and definitely for proof-of-concept apps, for people who don't really consider themselves web developers, but they feel like they can learn enough to solve their problem.
- 48:41Like, this is awesome.
- 48:42Yeah, I think it's not just for those people.
- 48:45I mean, it is for those people.
- 48:46It's not just for those people.
- 48:49Something that we do observe quite a bit, for example, is people going, oh, well, I'll just use this to throw together like a visual mock-up.
- 48:56Oh, wait.
- 48:56Well, I can add a little bit of behavior to it.
- 48:58Oh, well, I can add a bit more behavior to it.
- 49:00Oh, okay.
- 49:01Well, I've got this first version of my app.
- 49:03I might as well launch it as a prototype, right?
- 49:04Oh, well, it's in production.
- 49:06It's scaling.
- 49:07Okay, then.
- 49:08Yeah, exactly.
- 49:09So the point is that we should be able to grow with you from that proof-of-concept prototype up to a deployed application, and we have many people who've done that with us.
- 49:17It sounds definitely doable looking at what you guys have built there.
- 49:20So one thing I do want to sort of touch on with you is what about the escape patches?
- 49:25Like, so if I want to use a different editor that's external, if I want to do, like, unit testing, if I decide I actually want to take that code and put it somewhere else, is there a way to, like, move out?
- 49:37I've talked to you before about, like, the server hosting environment and some of the really quite critical usability stuff we can do because we're not squeezing everything through this REST API checkpoint.
- 49:49A corollary of that is it kind of needs to be hosted on our platform to work because standardized platforms that let you just return a database row from the server to the client and have that give you implicit permissions are kind of thin on the ground.
- 50:01So if you want to run an Anvil app on-premises on your own hardware, you are going to need an on-premises license.
- 50:08If you do want to migrate out, obviously, you know, we'd be sad to see you go.
- 50:13But because of these escape patches I talked about earlier, it's actually a fairly straightforward process, right?
- 50:18You could change your server modules into REST endpoints.
- 50:21So, I mean, even if you're not moving out, right, you have, for example, a native iOS app that wants to talk to the same backend as the web app you've already created.
- 50:28Well, that's fine because although by default we don't go through this REST API layer, you can decorate functions in your server modules to make them REST endpoints.
- 50:40And say, this is very Flask-like.
- 50:42Oh, well, this function is available at this URL.
- 50:44And that lets you expand outside the Anvil hosted web client.
- 50:50And equally, you can use different backends from an Anvil hosted client.
- 50:55So, yeah, we don't think that you're kind of stuck there.
- 50:58But there are tools of our platform that you kind of need the whole thing to use.
- 51:03Yeah, that makes sense.
- 51:04I do understand.
- 51:05Like, you guys are doing a lot of magic to wire this stuff together.
- 51:08And without the sort of orchestration behind the scenes, then I can see how that's not so easy to do.
- 51:15I have a love-hate relationship with the word magic.
- 51:17I mean, obviously, magic is a word that people use when they see, you know, something like Anvil working.
- 51:22Oh, my goodness, that's magic.
- 51:23And it's the word I used earlier to describe my first experiences with something like QBasic.
- 51:28Oh, my goodness, this is magic.
- 51:29But there's good magic and bad magic, right?
- 51:32There is bad magic as in this is an Angular app and I'm not really sure what it does underneath to make this lever I pull over here connect to that thing over there that just wiggled.
- 51:41And then there's kind of good magic which is comprehensible.
- 51:45You could see exactly how it worked.
- 51:48It just saved you some work.
- 51:50Like, for example, the client server calls in Anvil.
- 51:53There are an example of what I would argue good magic.
- 51:56You can see, you know, it's just a function call.
- 51:58You can see how it worked.
- 52:00You see how you could implement it with REST endpoints if you wanted to.
- 52:03But you're kind of glad you don't have to.
- 52:05I mostly meant that in the positive sense, the magic you guys are doing.
- 52:08But just that it's hard to replicate outside the environment, right?
- 52:13So you have a business model for this that is more or less like a freemium.
- 52:19Like there's a basic version.
- 52:21But if you want your own domain, then you've got to pay some amount.
- 52:25It seems pretty reasonable to me.
- 52:27But one of the things that came up is like, what if I'm working on an open source project and I'd like to have like some kind of open web app hosted with you guys that a bunch of people can come and contribute to?
- 52:37Like, what would that look like?
- 52:39Or is that possible?
- 52:39It totally would.
- 52:40I mean, even if you have an open source web app, you know, somebody's usually paying for hosting somewhere.
- 52:45But the good news about, the good thing about Anvil is that all of your apps are in fact Git repositories.
- 52:52So it is totally a thing you can do to pull your apps Git repository out of Anvil.
- 52:58You could stick it on GitHub.
- 52:58You could collaborate.
- 53:00If you asked earlier about, oh, I want to use my own editor.
- 53:03Oh, I'm an Emacs fiend.
- 53:04I absolutely must edit this module in Emacs.
- 53:05That's fine.
- 53:06Get checkout.
- 53:07Get pulled.
- 53:07Have fun.
- 53:08Get pushed when you're done.
- 53:10But also that means that you're open to collaboration tools like GitHub.
- 53:14So you could totally run an open source app that's based on Anvil.
- 53:17You could have multiple instances that people pay to host or host on our free version.
- 53:23Yeah, that sounds good.
- 53:24The Git integration is pretty nice.
- 53:26And I guess you can create multiple upstreams in Git and make one of those be your GitHub repo, right?
- 53:32That's something that we do all the time.
- 53:35I mean, you can even do like a continuous integration, continuous deployment, because everything you can do in the Anvil editor is reflected in this Git repository, obviously.
- 53:44So you could do things like, oh, well, this is my staging deployment and it's got access to some staging data.
- 53:51And then I pull that Git commit and I push it up to somewhere else.
- 53:55And that's my deployed app.
- 53:57Indeed, we actually have a miniature version of this within Anvil itself.
- 54:00So you can choose a version of your app.
- 54:02If you go into view history, you can see like the full Git history of your app.
- 54:05And you can select a version that's the published version.
- 54:10And so if somebody comes to your shared URL externally, that's what they get.
- 54:15And so you can carry on hacking and you've got this dev versus production thing already kind of built in.
- 54:20But the thing about Git is that, of course, you can extend that.
- 54:22I think that's really nice.
- 54:23And so basically of this UI that says, here's your Git history.
- 54:26That means like you went and pressed save, like save a state here.
- 54:29But you can actually mark like this one right here right now is production and continue working on it and then push production on down the line once you have it sort of tested.
- 54:38Also kind of in production.
- 54:39And I think that's pretty powerful.
- 54:40Yeah.
- 54:41And actually, if you use that Git interface, you'll discover that's just a branching Git.
- 54:45And this is kind of what I mean about good magic versus bad magic.
- 54:48That's kind of magical.
- 54:49But how we do it is very much open and you can play with it, too, if you want to do something more advanced.
- 54:55But yeah, the normal user experience is like one click.
- 54:57Okay, that's production now.
- 54:58Done.
- 54:58All right.
- 54:59So we don't have much time left.
- 55:00This is so much cool stuff to talk about.
- 55:02I guess one last question is like you have your data tables as a service there.
- 55:07How do I back up my data?
- 55:08So if you're using the data tables within Anvil, the first thing to say is we do take regular and properly encrypted and stored backups of those.
- 55:18So you should not have to worry about the data loss.
- 55:21But if you want to copy on your own system, then there's a ton of ways to get it out.
- 55:25I mean, every data table in the editor, there's like a download a CSV button, which is the very straightforward way of getting this stuff out.
- 55:33But earlier we talked about the uplink.
- 55:35And, of course, from the uplink, you can do anything you could do in those server modules.
- 55:40It's not just a matter of saying, oh, well, here's a function that displays some text on my Raspberry Pi and it's callable from the web.
- 55:46That script can also reach in and say, oh, I would like to iterate over all the rows in this table.
- 55:52And that's totally legit from an uplink.
- 55:54Sync that with some local DB, something like that.
- 55:57Yes.
- 55:57So if you had your own representation of data you wanted to synchronize with or import, export, that is really straightforward to do.
- 56:05And again, if what you actually want is something in Amazon Redshift, if that's where you want to sync your data to and that's where you want all your data to live,
- 56:13you could just access it there from Anvil as well because we've got all those Python modules ready for you to use.
- 56:20There's nothing forcing you to use the data table service.
- 56:22It's just something that makes your life more convenient in a lot of cases.
- 56:25Right.
- 56:26Knowing the Docker containers are running AWS, you can basically crack out and get to most of the other AWS stuff, right?
- 56:32That would be accessible.
- 56:33That would be possible even if we weren't running in AWS, right?
- 56:36Right.
- 56:36Lower latency inside AWS.
- 56:38Yeah.
- 56:38Does run quite well.
- 56:39Nice.
- 56:39All right.
- 56:40Well, I think, you know, there's a bunch of other stuff we could dig into.
- 56:42I think we should probably leave it here just for time's sake.
- 56:45So let me ask you the two questions.
- 56:47We talked a lot about editors, actually.
- 56:49So let's start with your favorite editor.
- 56:52Favorite because it's my baby and also I spend a lot of time in it is, of course, the Anvil editor.
- 56:57It's got a full autocomplete.
- 57:00It can do full stack development and it's plugged into full version control on the backend.
- 57:04So I spend a lot of my time obviously working in that.
- 57:06For building the Anvil backend itself, I actually use IntelliJ and I really love the JetBrains tools.
- 57:13IntelliJ, PyCharm are fantastic.
- 57:15Again, the autocompletion is top notch.
- 57:18Cool.
- 57:19All right.
- 57:19That sounds awesome.
- 57:20Yeah.
- 57:20The editor you built is really, really nice.
- 57:22I definitely like it.
- 57:23Yeah.
- 57:23Check out our PyCon UK lightning talk.
- 57:25Yeah.
- 57:25You send me the link.
- 57:26I'll put it in the show notes.
- 57:27And notable PyPI package.
- 57:29The selfish answer here is the Anvil uplink because it is on PyPI and it is remarkably cool
- 57:35in its ability to plug your own code into the cloud.
- 57:37If I weren't counting that, then it's got to be Pandas.
- 57:40The things you can do in like three lines of code that I recall using janky libraries to
- 57:47pull that data out of Excel files and process it or worse using R.
- 57:51Yeah.
- 57:52Incredible.
- 57:52So yeah, Pandas wins.
- 57:53Cool.
- 57:54Yeah, that's definitely a big one.
- 57:55All right.
- 57:56Final call to action.
- 57:57People want to check out Anvil.
- 57:59What do they do?
- 58:00Oh, they go to anvil.works and they sign up for a free account.
- 58:04We've got tons of walkthrough videos and tutorials.
- 58:07There's a user forum that's really quite active and friendly.
- 58:10And you can sign up for an account for free and start building.
- 58:13And I would really encourage you to do so.
- 58:15And I would look forward to seeing you there.
- 58:16Awesome.
- 58:17Well, congrats on building this.
- 58:18It's definitely pushing Python in a direction that I haven't really seen it pushed successfully
- 58:24in quite a while.
- 58:26So it's awesome.
- 58:27Nice work.
- 58:27Thank you very much.
- 58:28It's been great talking to you.
- 58:30This has been another episode of Talk Python To Me.
- 58:33Today's guest was Meredith Loof.
- 58:36And this episode has been brought to you by Datadog and ThoughtWorks.
- 58:39Datadog gives you visibility into the whole system running your code.
- 58:43Visit talkpython.fm/datadog and see what you've been missing.
- 58:47Don't even throw in a free t-shirt for doing the tutorial.
- 58:50GoCD is the on-premise, open-source, continuous delivery server.
- 58:54Want to improve your deployment workflow but keep your code and builds in-house?
- 58:58Check out GoCD at talkpython.fm/gocd and take control over your process.
- 59:05Are you or a colleague trying to learn Python?
- 59:08Have you tried books and videos that just left you bored by covering topics point by point?
- 59:12Well, check out my online course, Python Jumpstart, by building 10 apps at talkpython.fm/course
- 59:18to experience a more engaging way to learn Python.
- 59:21And if you're looking for something a little more advanced,
- 59:24try my Write Pythonic Code course at talkpython.fm/pythonic.
- 59:28Be sure to subscribe to the show.
- 59:31Open your favorite podcatcher and search for Python.
- 59:33We should be right at the top.
- 59:34You can also find the iTunes feed at /itunes,
- 59:38Google Play feed at /play,
- 59:40and direct RSS feed at /rss.
- 59:42on talkpython.fm.
- 59:44This is your host, Michael Kennedy.
- 59:45Thanks so much for listening.
- 59:47I really appreciate it.
- 59:48Now get out there and write some Python code.
- 59:50I'll see you next time.
- 59:50Bye.
- 59:51Bye.
- 59:51Bye.
- 59:51Bye.
- 59:51Bye.
- 59:52Bye.
- 59:52Bye.
- 59:52Bye.
- 59:52Bye.
- 59:52Bye.
- 59:52Bye.
- 59:53Bye.
- 59:53Bye.
- 59:53Bye.
- 59:53Bye.
- 59:53Bye.
- 59:53Bye.
- 59:53Bye.
- 59:54Bye.
- 59:54Bye.
- 59:54Bye.
- 59:54Bye.
- 59:54Bye.
- 59:54Bye.
- 59:54Bye.
- 59:54Bye.
- 59:54Bye.
- 59:54Bye.
- 59:54Bye.
- 59:54Bye.
- 59:54Bye.
- 59:54Bye.
- 59:55Bye.
- 59:55Bye.
- 59:55Bye.
- 59:55Bye.
- 59:55Bye.
- 59:56Bye.
- 59:56Bye.
- 59:56Bye.
- 59:57Bye.
- 59:58Bye.
- 59:59Bye.
- 59:59Bye.
- 1:00:00Bye.
- 1:00:01Bye.
- 1:00:02Bye.
- 1:00:03Bye.
- 1:00:04Bye.
- 1:00:04Bye.
- 1:00:05Bye.
- 1:00:06Bye.
- 1:00:07you
- 1:00:07you
- 1:00:08you
- 1:00:08Thank you.
- 1:00:09Thank you.