Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to
your earbuds. This is episode 169, recorded February 12th, 2020. I'm Michael Kennedy.
And I am Brian Okken.
And this episode is brought to you by Datadog. Check them out over at pythonbytes.fm slash
Datadog. Get a cool t-shirt for just giving a little trial, installing them and checking it out.
Brian, I love a good story. You got a tale to tell us?
Well, yeah, I've got a detail. So this was a suggestion on Twitter by, oh gosh, David Douglas
something? Maybe David Douglas Smith? How do you think you pronounce that?
David Douglas Smith. That's what I'm going with. If you can trust the Twitter name to be the real name.
Yeah, right. This is a little tool, which is pretty darn cool. Detail. This is a quote from their site.
A combination of a Flask backend and a React frontend to bring you an easy way to view and
analyze pandas data structures. It integrates seamlessly with IPython notebooks and Python
IPython terminals. Currently, this tool supports such pandas objects as data frames, series, multi-index,
date time index, and range index. Okay. So there's a live demo on the, in the linked from the readme.
And you can go to that and there's a little arrow on the top left. So you end up with something that
looks like a spreadsheet, whole thing. But in the demo, you, if you click on the little play button,
there's a whole bunch of different tools that pop up. One of them, like even just the describe button,
if you'd click that, you can select different columns and it gives you statistics and a little
graph of what the, what data is in there and top 100 values that are in there. That's even cool enough,
but that's just a start. This tool also gives you, you can filter your data, do correlations,
charts, heat maps, just all looking at a data frame through this user interface. It's pretty cool.
Yeah. That's super cool. When I first saw this, I wasn't sure what to make of it. And playing with
live demo really is the way to check it out, isn't it? Yeah. I mean, after playing at the
demo a little bit and then going back to the, the readme with all of the information, there's just so
much that you can do with this thing and it's all open source. So you can run it on your own servers
or whatever, but it's cool. I like the idea of having a live demo linkable.
Yeah. I do too. It's, it's makes it real and it's, it's a really cool,
smooth, interactive framework for visualizing data. I like it a lot. I really, I think it's like,
if I did more with Panda data frames, I'd be all over this. Yeah. Cool. Cool. Speaking of the data
science side of things, there's a pretty cool project that just came out called carnets. Have you
heard this?
Not until you listed it, but I'm pretty excited.
Oh man, it's pretty awesome. I actually learned about this at PyCascades. We were hanging out
there with some folks and somebody sent this in to me over emails that, Hey, check this out or over
Twitter or something like that. And yeah, everyone was uniformly impressed and thought this was quite
cool. So you probably heard of Pythonista and Pythonista is a, not a description of a person who
likes Python, but Pythonista being the app in the app store that is kind, lets you do like automation
and stuff with Python on your iOS device. Okay. Okay. So what was cool about that is like,
you can write and run Python on your iPhone or on your iPad natively, which is pretty awesome.
This is kind of like that, but in that it runs Python natively, but this is Jupyter notebooks
on your phone or maybe more importantly on your tablet, like on your iPad.
Yeah. This is pretty slick. I can't wait to try this out.
Yeah. And it's, it's super, super smooth. So what's obviously these days there's options
for running and writing Python through your iPad. If like that's like that differentiation
makes sense. We can use Visual Studio Code online, which will just basically put the front end
into a web browser and then it runs somewhere on Linux and Azure, or there's some other ones
like coder.com and whatnot. But this is no internet required running Jupyter notebooks locally. And it has
built in IPI packages, NumPy, MapPlotlib, SciPy, and Pandas, and it's Pandas already installed. So you
don't have to install them or anything. So it's not just, Oh, here's a thing you can run Python. Like
there's even some of these C based packages that you might need already installed, which is great.
Yeah. It really looks really clean too. Yeah, for sure. And it also has file sharing ability. So
you could like share your stuff through iCloud, right? So you save your notebooks there, edit them
somewhere else, pick them back up again over there. You can import IPYNB files or whatever the Jupyter
extension is. Yeah. So it's really quite neat. And it looks like a proper Jupyter app running over
there. I think it's great. I'm impressed. It also extends the keyboard on iPad to give you a couple
of actions, some hotkeys or like, sort of, I guess, like the Mac touch bar, sort of. That's pretty cool.
One different thing from Pythonista is Pythonista, I believe you have to pay for on the App Store.
This one is open source and free. So just go click install and you have it.
And you can pip install stuff. I don't even know how that works.
Yeah. It's amazing. It's awesome. There's a restriction on the pip install stuff. So with
Jupyter, you can say percent pip install a thing or whatever, issue that to the shell. But this one,
you can do that as long as the thing you're pip installing is pure Python. It doesn't have like a
C compiler or something like that in your phone. Well, that makes sense.
Yeah. Yeah. Isn't this cool though? Yeah. It's very neat. I got to try this out.
Yeah. I definitely want to put it on my iPad and check it out. And it has a separate dedicated iPad
app that's slightly different, which is nice. Honestly, like a lot of times you can kind of
get away with the both the same app or it's not really that big of a difference, but this is the
kind of thing where it's most relevant on iPad or like a larger device. And then it just happens to
also work on the phone is the way I would see it. I wouldn't really want to develop on my phone.
I don't know. Doesn't seem great. Right. Harder to hook an external keyboard to your phone and
whatnot as opposed to an iPad. But yeah, this is really cool. People should check this out and it's
open source. People can go download it and play with it and whatnot. Speaking of really cool,
Datadog is pretty cool. They're doing really good stuff, supporting the show as they have been for a
long time. So they're a cloud scale monitoring platform that unifies metrics, logs, and traces.
If you've ever wondered what's going on in your app, you know, you can watch one log or another or look
at the performance of one part or another, but it's hard to put that all together in an overall
request. Well, Datadog is what you want to put all those pieces together.
So you can trace requests across service boundaries and that sort of stuff. And they're
tracing client auto instruments, popular frameworks like Django, AsyncIO, and Flask. So you can quickly
see the health and performance of your Python app. Get started today with a 14-day free trial
and a complimentary free t-shirt with a cute little dog on it over at pythonbytes.fm/Datadog.
Wonderful. Thanks, Datadog. Yeah. Thank you, Datadog. Brian, you spent some time on a podium not long
ago, didn't you? Yeah, just this last Sunday. Or I mean like, you know, a Sunday ago,
depending on time travel. So yes, and this actually came from PyCascades. I got this suggestion from
Katie McLaughlin. I did my talk using, there's a lot of people that use HTML5-based presentation
frameworks. And that's what I was using. I was using remark.js. I chose it because I like Markdown.
And so I can write my slides in Markdown and then present it. But there was difficulty. So I,
in order to get this all to work, maybe some people know some other secrets to it, but I had to go in a
little early and then like go into the extended display mode so that I can drag the version of the
presentation that's going to be on the display. Drag that web browser window into the other window
that's on the display and then maximize it. But I'm not in front of it. So I got to like use the mouse to
try to go to the maximize button. And then on the other, my laptop display, I have my presenter notes
and timer and stuff. And it actually worked really good, but that setup was a little bit of a pain.
And so Katie McLaughlin told me about Podium, which is a Beware application. And I got to tell you,
I love the Beware stuff, but one, and they know it also is that the documentation, they need more help
with documentation because there's not much there. But this is cool. It's a native application. It
currently supports, there's builds for Linux and for macOS, which bummer for Windows people, but
it works for me for macOS. And it's a, since it's not a browser thing, it's a native app,
it can have control over going to different screens and stuff. So when you hit like command P,
it just goes into presentation mode. You've got your notes on your computer and the presentation on the
extended one, it's automatic. You don't have to fight it. They've also simplified the syntax of the
markdown. So remark.js has a bunch of boilerplate HTML stuff on the top and bottom,
but the Podium, Beware Podium has removed that. So your markdown file with all your slide content
is just content. It's not a bunch of other stuff. So I'm really happy about this.
Yeah, this looks nice. It's cool to not see it all just a bunch of JavaScript, right? And it's cool to
have a little bit more of a native app that can do more than just something in your browser.
Yeah. So this isn't specifically a Python related topic, but in watching other people's slides, I know a lot of
people are using remark because I recognize it when people do it. So I'm hoping this might help other
people too. Yeah, absolutely. If anyone wants to help out with the documentation, a little Giphy or
video or something of what this looks like and what it does would go a long way. Just like, you know,
the D type detail that you had before would be quite cool. So, or the car nets, right? Just the Beware
stuff is cool, but it's always, you know, it's just text usually talking about something visual. So
that would be great. Now, this one, I feel like this topic is cheating on you, Brian. I'm going to cover a
pytest thing. I love it.
So this is pytest mock resources. So this comes from Daniel Cardin and his company recently open
sourced some of their internal pytest tools to help them do more pytest goodness. And I think it's cool
that the team at the company put the effort into open source this project. So basically this is
something to help out with testing external resources. Now, testing external resources is one of the tricky,
challenging bits of testing code, right? I'm going to call the credit card API, but I don't really want
to charge it. I just want to simulate calling it and telling it and get the response back, or I'm going
to query the database. And I don't really want to hit the database. I just want to simulate getting this
data back. And that's already solved with mocks and patching and that kind of stuff, right?
Yeah.
But this is a way that you can test if you do need to actually get some data back from the database
or from some other service and just go like, I really need it to give me this data back to see
that the part that actually processes the query that is working correctly. So basically its job is to
set up Docker containers and manage the lifecycle of those around your tests. So it'll fire up a little
Postgres server or it'll fire up a MongoDB server inside of a Docker instance, get it set up for your tests,
let your test query against it, and then throw it away. Sometimes it makes sense to have tests that
are abstracting away or hiding or patching or mocking the dependencies. Like we described, that
probably makes sense most of the time, but there's a little slice where it really needs to interact
with those resources and you might want to test that, right? Like did my SQLAlchemy class get out
of shape with the way the database thinks it is? Well, I can mock that out all day, but the only way I'm
going to find out that doesn't work is try to do a query and have, you know, the relational database
throw an exception and say, this column that you're querying for doesn't exist. And then I'll find out,
right? So I think it's cool for testing that level. Oh, that's neat. What's your take on this?
It's not a domain that I'm in having to utilize, but the, I love that people that solve a problem
are willing, even in a company setting, are willing to open source it to other,
to let other people benefit as well. Yeah. Pretty cool. I can definitely see that using
this around the websites and stuff like that. There's certain parts where, you know, it really
would be easier if it just would generate the sitemap.xml correctly. So then I can use that
to poke back at some of the elements and whatnot. It, it seems pretty interesting. I haven't used it for
anything yet, but it looks, looks cool. Yeah. Nice. Let's keep rolling and testing, huh? Yeah. I guess
we got two testing things in a row. This is an article. I wrote the title as how James Bennett
is testing in 2020. The actual article title is how I'm testing in 2020, but it isn't how I'm testing.
So it's James Bennett because it's his article. So anyway, he wrote an article called, I forget
what it's called, but it's an article about testing Django applications in 2018. And so he's following it up
again to see, you know, kind of what changed. It sounds like he's testing more things than just
Django, but it still is. I'm going to go through a few of these, using, still using unit test over
py test. And I, I respect that there's a lot of people that just think in the X unit style and for
some reason have trouble thinking in py test and that's fine. We can both coexist. He's using,
talks to be able to test over multiple Django and Python versions and, using a talks Travis
plugin to aid the Travis side of that, which is cool. I like talks a lot. Use it almost every day.
We've talked about pyenv before for local Python installation management. And so he's using that.
And actually I think we've talked about this the other, not too long ago, that if you're using pyenv,
there is a pyenv dash virtual end plugin to help you with a virtual environments. I'm not using pyenv,
but, but that's neat. Yeah. Yeah. Yeah. Very cool. And, since you can't use py test,
he's not, well, he does use py test sometimes, but he also gave a list of his, run tests script to,
uh, just run everything. That's especially useful. You can have multiple. I like the idea of this in
any way you can have multiple of these for, let's say you've got a smoke test or suite or different
suites that run on Jenkins server or some other, or Travis server being able to have one entry point
is a good idea using coverage also. And he talks about some of his two extra tools. It's not just,
uh, functional tests, but things like including black and ice sort and flake. And I just appreciate
people being very open about their testing workflow. I think more people just write in really any
workflow. Just, I think it's interesting to find out what people are doing for different parts of
their workflows. Yeah. I find this interesting as well. It's kind of not quite a confessional,
but Mike, look, you're going to hear all these new, awesome ways of doing things. Are you going to
hear that you should use this and not that, or you have to do it this way. Here's what's working for me
really in a nice practical way. And I dig that. Yeah. It's not like, this is the best. It's just,
it's working for me. This is what I'm doing. Yeah. And there's some cool little extra commands,
like cleaning up a PyCache files and set up, install local files and pip upgrade. That stuff's nice.
In building that is, as a talks commands. That's something that I learned. I picked up from
somebody. I can't remember who, but I'm like, Oh yeah, you don't actually have to run,
do a complete thing. You can just have some of your utility stuff within, within talks. That's
nice. Absolutely. Have we talked about GUIs yet? I don't know. Probably not. Yeah. There's actually
some, interesting news about Remy and some people jumping in and contributing to that,
that I've seen flying by on Twitter. So that's super cool. But I want to talk about QT, pronounce
QT. So interesting project here. This is a, I want to talk sort of riff on, I guess is the right way to
put it. A article by Leo Danis Ramos over at realpython.com. And over there, there's an article
about Python and PyCute building a GUI desktop calculator. So if you're interested in getting
into QT, this is a really nice summary, not too long, you know, shorter than a quick little blog
post, but longer than a little quick little blog post, but shorter than a whole book. Right. But
you know, like, I think it's a good level that they've got going on over there. So I'm just going
to talk about a couple of interesting takeaways and basically the, the elements of a Qt application.
So if you're going to build them up to the Qt apps are made up of three or four different big ideas or
whatever, one of them are widgets, right? So if you're going to work with Qt, it's basically a wrapper
around the C++ API. And being that a lot of things are object oriented and whatnot. So if you work with
a widget, you derive from Q widget, or use something that's already written and driven from Q widget,
which are like buttons, text boxes, and so on. And a lot of examples you see will like take those
widgets and put them on the screen and say, this button goes at this XY location and this thing goes
there. But the other thing that's really interesting there are layout managers. So there's all these
different kinds of layout managers that you can use. So you could put in something, let me pull up a quick
little example. So you could put in the elements and it has like a horizontal layout where stuff goes,
left to right to right based on the size of it. Or you can have a vertical one, or you can have a grid
one, all these different layout managers you can employ to figure out how it will automatically adjust
its size as the elements are rearranged or, you know, the size of the windows change and whatnot.
So that's pretty cool. We got main windows, of course, which is like the essence of your app,
right? You're going to create a main window and put your layout manager in it and then load it with
widgets. And of course, you've got an app, Q application for a Qt app. And that's kind of
like the essence. And then finally, to bring it all together, there's signals and slots, which are
kind of like events, I guess, or callbacks. So all the widgets, like buttons and whatnot,
have these event catchers from the GUI system of your OS. And then they'll fire off events like,
hey, somebody clicked me, hey, somebody typed in me and things like that. So yeah, it's just a quick
way to get started with Qt that people might want to check out.
I think there's a really, they've done a really good job. It's pretty cool. The Qt demos and
tutorials, there are many around, but having it all just in one single page is pretty neat.
Exactly. I feel like there's a lot of stuff out there, but it's all kind of hit and miss.
And you're like, I don't feel like I quite have the whole story. And so that's why I wanted to bring
this up because Dan and crew, Leo Danis, they're doing a good job on this. Now, one caveat I do
want to throw out there before you spend a week getting this all up and running and find out stuff
about it. Either you need to have a lot of money to work on this, or you need to have it be open source
or internal not distributed projects. They can be used at your company, I believe, but they have to be
not distributed. I think that's the important thing. Oh, because of the Qt licensing? The Qt licensing is
it's like dual license, either GPL or LGPL, or it's commercial. And I'm pretty sure to use it on
commercial projects, you have to have a commercial license. And the commercial license is $5,500 per
year per developer. Okay. That's a lot. To me, that feels like a lot of money for a GUI framework.
Yeah. Right? When I could go use Java, I could use C++, I could use Windows Forms from .NET.
There's like a bunch of options that are solid. I don't know. It just, it seems...
All of those options sounded horrible to me, though.
I know.
Well...
That you just listed.
I know. I'm with you. But it's not like you pay $5,000 once or you pay $500 once. It's as long as you
care to own this application. It's $5,500 a year per developer. And that's just, that's
a lot. So anyway, it's not to say don't do it, right? If your company is like, hey, we
really want to go with this technology, we want to go that way, that makes sense and we can
totally justify it. But it's not something I... If I was like, hey, I'd like to create a
little app, maybe I'll create like a desktop version of the Talk Python player app that does
cool like offline support and stuff. Maybe I'll use Qt. Like, no, I wouldn't use Qt.
Okay.
Right? I mean, because I'm not going to pay, you know, $5,000, $10,000 a year for that because
it's just... I don't know. That's just the way it is. Anyway, I always want to throw that caveat
out there because it's not just like, oh, you got to pay a little bit for it. It's like, you
got to consider that that's a non-trivial amount of money to use it that way. So I just want
to throw that out there.
Well, yeah. And if we've gotten this story wrong, please somebody tell us.
Yep. I did poke around their site a lot and I was looking for the exact quote, but basically
if you're going to release it commercially, I believe that this is the case. But yeah, if we got
it wrong, someone tell us.
I believe you. I just don't want to believe you.
I know. I know. All right. Cool. Well, yeah. If somebody has more details than that on the
license, but that is... I spent probably 30 minutes trying to figure this out to make sure
I got it right. And that's what I took away from what's on their website.
Okay.
What about the extra stuff? The things that we're not quite covering, but we're still covering?
What do you got?
Well, we did mention PyCascades a couple of times. As of this recording, they don't have
the individual talks chopped up into videos yet. I don't know if they're going to, but the
live stream video of day one and day two. So everybody's talk, if you can kind of fast forward
through it, is available. That was available right away. Actually, they were pretty fast about
it, which is pretty cool. We're leaving a link to that. And I also just want to do a huge shout
out and thank you to all of the volunteers for PyCascades. It was a really fun event and
I appreciate everybody's time.
Yeah. PyCascades was great and it was really fun to be there and meet all the folks that
I did.
I had a moment of panic and anxiety shortly before my talk. And back in the green room,
Nita Zakarenko noticed and probably because I said, oh my God, I'm freaking out. And she helped
me through to calm down before the talk and I really appreciate that. So I wanted to thank
Nina on the show. How about you? Any extras?
Just a couple of quick things. I did a live webcast that I talked about like a month ago
on the show for Python for .NET developers. A bunch of people signed up. That was awesome.
That happened yesterday. And so now the recording is available. So I'll link to that in the show
notes. People can go listen to that or share it with their friends and whatnot, colleagues.
And also I've talked about this before, I'm pretty sure, but I sent out a message and a whole
bunch of people are like, oh, really? So I just want to throw it out that if you go to
the Talk Python training site and get one of our apps, those apps, you can download them for free.
And when you open up and log in, it'll give you a list of our free courses and you just tap them.
You can take a bunch free at the moment, probably more in the future of our free courses on your iPad
or Android tablet or whatever it is you want to take them on. So check that out if that sounds cool to you.
When you first released this, I didn't quite get the value, but I really appreciate the mobile app because
for me, bookmarking stuff on a, I bookmark stuff on my desktop all the time, but bookmarking stuff on my,
on my mobile phone, I don't really do that. So keeping track of which courses I've been partway through,
it's really handy to just have this right in the app. I like it.
Awesome. Yeah. Thanks. That's awesome.
And also there's a bunch of restrictions, especially around iOS. Like it won't autoplay the next video. So
you've constantly got to be going like play, play, play in the mobile app and you can't quite full
screen it as much because there's like a little, you know, the address bar on some browsers. Anyway.
Yeah. Thank you for that. It's awesome.
What? So the mobile app can't autoplay?
No, the mobile app does. But if, if it was alternative or to be to watch it with Safari or Chrome or something
on iOS, it's kind of restricted. Yeah. Right. Okay. Cool. How about a, how about a joke?
I would love a joke. All right. I'll take one. You take one. Cause I couldn't decide. I had three
and I chose two. They're both short. So I figured like that'll round it out. So here you go. Did you
know that programmers, they sometimes get confused about what holidays are? No. They do because
especially Halloween and Christmas. And there was, you know, like not a real good reason people
couldn't figure it out until someone realized that oct 31 is des 25.
This is so wacky that that's true. That's in plus it's funny.
Yeah. All right. What's the other one?
Okay. Let me read it first. Okay. Speed dating is useless. Five minutes is not enough to properly
explain the benefits of the Unix philosophy.
It might not be enough to explain the Unix philosophy, but if that's the start to a date,
it might still be effective in communicating what it's got to. Oh yeah. Oh boy. All right. Well,
that's pretty funny. So thanks again, as always. Great to be here with you. Thank you. Yep. Bye
everyone. Bye. Thank you for listening to Python Bytes. Follow the show on Twitter via at Python Bytes.
That's Python Bytes as in B-Y-T-E-S. And get the full show notes at Python Bytes.fm. If you have a news
item you want featured, just visit Python Bytes.fm and send it our way. We're always on the lookout for
sharing something cool. On behalf of myself and Brian Okken, this is Michael Kennedy. Thank you for
listening and sharing this podcast with your friends and colleagues.