Jupyter is an amazing environment for exploring data and generating executable reports with Python.
But there are many external tools, extensions, and libraries to make it so much better and to make you more productive.
On this episode, we're going to cover a ton of them.
We have Marcus Shanta, the maintainer of the awesome Jupyter list on the show,
and we'll highlight a bunch of Jupyter gems.
This is Talk Python to Me, episode 394, recorded December 1st, 2022.
Welcome to Talk Python to Me, a weekly podcast on Python.
This is your host, Michael Kennedy.
Follow me on Mastodon, where I'm @mkennedy, and follow the podcast using @talkpython, both on fosstodon.org.
Be careful with impersonating accounts on other instances.
There are many.
Keep up with the show and listen to over seven years of past episodes at talkpython.fm.
We've started streaming most of our episodes live on YouTube.
Subscribe to our YouTube channel over at talkpython.fm/youtube to get notified about upcoming shows and be part of that episode.
This episode is sponsored by the AWS Insiders podcast.
AWS is changing fast.
Listen in to keep up over at talkpython.fm/AWS Insiders.
And it's brought to you by Sentry.
Don't let those errors go unnoticed.
Use Sentry.
Get started at talkpython.fm/sentry.
Transcripts for this episode are sponsored by Assembly AI, the API platform for state-of-the-art AI models that automatically transcribe and understand audio data at a large scale.
To learn more, visit talkpython.fm/assemblyai.
Marcus, welcome to Talk Python to me.
Hi, Michael.
Thanks for having me.
This is going to be a very broad, not necessarily super deep episode, but we're going to talk about a ton of cool little extensions and widgets and libraries that you can plug into your Jupyter work and make it awesome.
I really like talking about these topics where it's like, oh, that's only a 10-minute commitment to see if it's going to help me out or not, right?
And not like some huge framework you got to learn.
And there's going to be a lot for people to take away if they do anything at all with notebooks, I think.
Yeah, and I think one of the nice things about notebooks is they're very easy to use.
I think the barrier to entry to you just being able to do something tangible with them is very low, much more so than maybe a lot of other things.
Yeah, they're very, very welcoming environments, especially if someone set them up for you, if it's one of the hosted ones, or if you're not in there trying to configure a kernel with a special virtual environment, like, how do I get to the right installs?
And why is this thing not there?
Or a whole super-nature hub running on Kubernetes.
Yes, exactly.
But once you're kind of beyond that shell and many people have that set up for them, then it's ready to roll.
All right, so going to be tons of fun to talk about these things.
But before we get to them, let's start with your story.
How did you get into programming in Python?
How did I get into programming?
I think it sort of started when my parents decided to buy a computer when I was eight years old, back in the 90s.
And then sort of at 12, I started to realize, oh, you can program these things.
And some well-intentioned adult, like, bought me a book on C and, you know, like 12-year-olds and pointers.
It doesn't mix.
C, the easy parts.
Yeah, exactly.
Just void, star, star.
Come on, kids.
Get with it.
Yeah.
That was just, like, conceptual a bit too much for a 12-year-old.
But then luckily, like, once I got into high school, they actually taught us Boral and Delphi.
I don't know if she ever came across that.
It was a very safe, easy-to-use, like, GUI-driven way to get into programming.
And you could do a lot of things even that, like, a 14-year-old would find exciting, right?
Just, like, C-style, hello world, and I can create numbers in a loop, but actually, like, fun GUI-like stuff.
You know, I never used that, but I used Visual Basic and some Windows Forms and other stuff.
And I really think, even today, that style development, it's kind of withered and it's too bad, right?
It used to be so amazing.
You would just go over there, you know, button, text box.
I click on this thing.
Here's what it calls.
The interaction was so simple.
And now you're doing, you know, maybe you're doing the web, and it's like, I'm going to do Webpack.
And then, you know, bring in all these things, and I'm doing TypeScript, and then it's all CSS and HTML.
And I'm not bemoaning that style of development, but it's like, that's kind of replaced this.
Just give me a visual of what it looks like, and let me build something simple.
It has been replaced with...
I feel like it was a very good pedagogical tool to teach programming and GUI development.
Like, I remember we did find things like rectangles on the screen that just chased each other around, right?
Yes.
That was a fun way into programming.
Yeah.
And I think there's some bits like that still around, isn't it?
What's the, like, programming learning language?
Something with an animal?
Is it small talk?
Or the thing with a turtle?
Yeah, yeah.
The turtle where you can do some drawing.
There's that.
Yeah, yeah.
There's Anvil, actually, which is a Python sort of front-end and back-end web framework that has this.
It's really, really similar.
My daughter used that to play with it a lot.
But yeah, I would love to see like a Visual Basic Pi or something, you know?
Something like that would be so amazing.
Maybe it exists, yeah.
But that's where I really started developing or programming on my own.
Then I went to university.
That was in the early 2000s.
And they taught us mostly Java, but also sort of a weird mix of like logic-oriented programming, functional programming.
And I really only ever got in touch with Python when I did my master's in the States during some courses.
And then professionally, I learned proper Python when I was working in London.
And that was a company, Man Group, with a lot of really good Python developers.
And there I picked up like proper Python.
Yeah.
And stuck with it ever since.
If I have a choice, I will stick to it.
It's interesting that we come from, you know, my background was not that different than yours in some ways.
I did like C++ in the early days.
And you think as you advance in your career and you get more technically capable and stuff, you would think, well, you're going to be doing more intense stuff and more like deep dive.
Like now you're writing like kernel drivers.
Like it's for me at least, and it sounds like you a little, quite the opposite.
Like more towards some of these higher level languages that let you build really amazing things.
But you're not juggling like pointers to pointers and like all this crazy aspects, right?
I think the first thing, like your expectation that you're describing is maybe a function of sort of technical expertise.
In the second development, what actually what you end up doing, right, is a function of age, right?
That you like, as you become older, you focus more on the high levels things.
You just want to get stuff done.
You don't care about showing off.
Exactly.
You can make this compile, right?
What's the shortest way for me to be?
And very often that's Python.
Absolutely it is.
All right.
So some real-time follow-ups.
The audience has helped us out here.
Don says, Delphi is a wonderful way back into Pascal from the college days.
Indeed.
And some of those languages, Logo was one of these visual building ones, as well as the one with the cat is Scratch, which, what an amazing name.
I haven't really used Scratch, but.
I think the cats or animals in general seem to be good metaphors for teaching programming.
Yes, they do.
And the O'Reilly publishers, the publisher O'Reilly, has built their entire book series on unique animals and programming.
All right.
Well, how about now?
What are you doing these days?
Right now, I am a founding partner at Blue Balance Capital.
We are a small, independent, alternative asset management firm based in Vienna, Austria.
I started this company three years ago with my partners.
Before that, I worked at an asset management firm in London.
Yet before that, I worked at Goldman Sachs as a quantitative analyst.
And so basically, during my professional career, I was always more a sort of data analyst rather than a systems developer.
So everything or most of the things I use Python for are more from the perspective of here's a piece of data.
And I want to sort of analyze that data set to better understand, like, I don't know, a company or an economic trend or an industry or a particular trade.
So I was always interested in Python in the context of, like, some data set and some insight that you can glean from analyzing that data set.
How much of that was taking a block of historical data, like, here's the last quarters and, you know, reports or whatever, versus trying to make predictions, you know, like real-time trading or other types of real-time information?
So I think sort of the starting point is almost always some kind of like time series.
And then the asset management firm, Mancobura, they were actually developing automated trading systems.
So it was like very much the first thing you described, where you have an input that is a time series, you apply some transformation, and then a computer actually produces trades on the back of that.
Whereas at other times, more like what I do now is you think about it, you get some insight from the data, but then there's also some other real-world considerations or exogenous factors that you think about as a human person and then make your decision.
So I think for me, it was the whole gamut of sort of the product is a direct trade that the machine puts on or trade that you put on or maybe just some advice that you give to a company.
Right, right. We're thinking that tech, generally, that the tech indexes are going down over the next three months versus buy today and sell tomorrow, yeah?
Or buy now, sell tomorrow.
Predictions are hard, especially about the future.
Yeah, well, especially now with COVID and wars and like...
I have been in finance for more than 10 years now, but I've never seen anything like the last two years.
Yeah, that's nuts.
I think much more happened in the last two years than in the 10 years before.
It is living through some history, isn't it?
Yeah.
One more question on this background side of things.
You did a lot of work for these other companies like Goldman, and now you're founding a smaller company.
How do you feel that your programming and data science background has suited you to be more of leading this new company?
I think I have a great sort of education from both Goldman as well as Man Group.
They're both very technically capable organizations with a lot of very smart people.
And as I was starting out together with my partners as a very small team, one of the things that gave me comfort is that I have this stack of things that I know work together.
I understand how they work together and how to sort of apply them to do useful things.
So having that sort of under your tool belt or ready to go and not having to figure out sort of how they go together.
But just on day one, here's an AWS instance or EC2 instance.
Spin it up, get a notebook running and produce some nice charts.
That was something very valuable for me to just be able to do very quickly.
Cool.
That's what I would think.
And I feel even if you have these skills, even if you're not the one writing, if you hire a team or you find a consultant, being able to speak with them and understand like, yeah, no, no, I have a recommendation.
And I think actually this, you know, like, let me tell you, that tool is good, but this one is better and it would fit because X, Y.
I think just that's super valuable.
So I just wanted to kind of check in with you on that.
Yeah, like I tried and test a stack of tools and every once in a while you get to branch off and try some new shiny and see if it works, see if it sticks.
But having this trusted thing that you know and how it works is valuable.
Yes.
Like if you're doing JavaScript, you want to have a really trusted tool that's been around for at least a month.
Yeah.
I mean, just kidding.
Luckily, we don't have it quite that bad in Python.
It's a lot more stability there.
Okay.
Well, let's talk about this list, which is why we got together and I invited you here.
Is this awesome Jupyter list.
You know, what is it?
Where did it come from?
I mean, most people are familiar with awesome lists, but maybe what's the philosophy of yours?
Yes.
So awesome lists, they're just like curated lists with resources that are useful or pertinent to some particular topic.
And then in this case, it's Jupyter notebooks.
So this is really a list of things that I started with 20 entries and then just put it up on GitHub.
And then over time, just more people added to that list of things they find useful and have some relationship with Jupyter.
And I think that up to this point, I think more than 100 people have collaborated on other things that they find useful to this list.
So it's just like living, breathing thing of whatever people find useful that has a relationship to Jupyter.
I still find these very valuable, even though a good part of my job is like to track what is new, what's interesting, what's trending.
Still, I find so many things that are new here.
And when I first got to Python, I was like, wow, look, it just keeps going.
I just thought there was three web frameworks.
There's one way to talk to a database.
Look how many there are.
It's so amazing.
And it's always delightful.
You probably remember like back in the old days of the internet, you had directories, right?
I mean, that was Yahoo.
That was the first search engines, right?
Yes.
You had these like catalogs of things.
And here's a website that is about cats.
And here's one about dogs.
And in some ways, it feels like in this day and age, we have come back to like you actually have a person who is keeping some kind of like directory of things that are useful or pertinent to a particular topic.
It's kind of funny that way.
And what's quite interesting for me is sort of one of the benefits that I have from doing this is that I see like what other people find useful.
And so for myself, I just know, hey, these are the things that people are using.
And so I've got a pretty good radar of the whole Jupyter and Notebook ecosystem just because I'm sort of curating this thing.
Yeah.
You probably have had people recommend things and you're like, no idea what that is, but that looks awesome.
So it belongs on awesome Jupyter.
I try to be very inclusionist to this.
So when people include things on this list, more often than not, I exclude them.
And even in the cases where I'm like, I don't see myself using that, but I'm sure there's some category of people who might find that useful.
And it just goes on the list.
Yeah.
You don't want to over-index on your specific use of Jupyter and your vertical, right?
Because we've got astronomers who are using this stuff.
We've got economists.
We've got biologists.
We've got students, right?
It's publishers.
All sorts of folks.
Yeah.
People who care more about, I don't know, like keeping, turning their computation on a cluster.
Other people are more into visualization.
You name it, you have it.
Yeah.
Right.
Like ML folks might have one concern over others.
A lot of people who use it in education, that's actually one of the sections in there is a whole section dedicated to education, people teaching courses using notebooks and what the best tools around that is for it.
Like, I don't know.
It may be even grading homework assignments that you distribute to people in the form of notebooks.
Yeah.
I definitely want to highlight that because my, I haven't talked about it very much, but I was a graduate TA.
So, boy, I graded a lot of, a lot of calculus, a lot of linear algebra and various other applied calculating type things like MATLAB type of stuff and automating.
Oh, it would have been good.
Okay.
So.
You just replace yourself with a regression test.
Exactly.
Submit your calculus test to the continuous integration.
We'll see how you did.
This portion of Talk Python is brought to you by the AWS Insiders podcast.
When was the last time you ordered a physical server to host your functions as a service, your latest API, or your most recent web app?
I remember the last time I did.
That was around the year 2001.
And yes, it was quite the odyssey.
Of course, we don't do that anymore.
We run our code in the cloud with near instant provisioning and unparalleled data centers.
And the most popular cloud provider is AWS.
But for all the ways that AWS has made our lives easier, it has also opened a massive box of choices.
Should you choose platform as a service?
Or maybe it's still VMs with IaaS.
What about your database?
Maybe you should choose a managed service like RDS with Postgres.
Or is DynamoDB better?
Maybe Aurora?
No, wait.
I hear good things about Amazon DocumentDB too.
And that's where the AWS Insider podcast comes in.
This podcast helps technology leaders stay ahead of Amazon's constant pace of change and innovation.
Some relevant recent episodes include Storage Wars Database Edition, Microservices or Macro Disaster,
and Exploring Computer Vision at the Edge with AWS Panorama.
They bring on guests to debate the options and the episodes are vibrant and fun.
So if you want to have fun and make sense of AWS, head on over to talkpython.fm/AWS Insiders.
Yes, I know you probably already have a podcast player and you can just search for it there.
But please use the link so that they know you came from us.
Thank you to the AWS Insider podcast for keeping this podcast going strong.
So there's a couple of sections that I'm not sure I really want to dive into because I think,
I don't know, they're not exactly the notebook ones.
But one is this collaboration education stuff.
So maybe we could start there.
And let me just set the stage by saying if a little while ago I met with Sam Lau and talked with him.
He and Philip Guo, they did a research project where they studied 60 different network environments,
not just Jupyter, but like Google CoLab and 58 others.
And so just kind of putting it out there, like you might think just Jupyter versus JupyterLab is the discussion,
but there's a whole lot of different places where you can do notebooks, right?
Yeah, and some of them, like you can run on your own machine.
That's sort of what I have in this runtime slash environment section.
Those things tend to go in there.
And there's a separate category of, I call them in the list, hosted notebook solutions.
Those are things that you don't really run on your own machine, but they run somewhere in the cloud.
So I think basically that is one way you can break them down into categories.
It's just do you run them yourself or do they run in the cloud somewhere else?
One thing that I didn't see on the list, but maybe would be kind of its own special.
Open a pull request.
Yeah, right.
Here we go.
Is the JupyterLab desktop app.
Have you seen this?
Not sure I've seen that.
Yeah.
So what it is, is it's an ElectronJS app that bundles the runtime environment to be JupyterLab.
And it comes with its own Python and everything.
So it's a thing you can hand to somebody that runs locally that lets them do notebook stuff
without them having to have Python installed and set up the environments.
And it just kind of has a little wizard to get it started, which is, I'm not sure I would
use it personally, but it's pretty interesting.
It sounds like a very low barrier to entry notebook environment.
Yeah.
I think it could be good for, you know, like in a school environment where you're like,
all right, kids, just take this and run it.
I don't want to have to debug why you can't install Python 3.10, but you need 3.7, you know, whatever.
Lots of different people have different kinds of Jupyter or notebook setups.
Mine personally tends to be, I've got to, I actually run mine in the cloud because I find it convenient
to be able to access it from different machines.
So like I access it from work and then I can access it from my notebook.
Even like when I'm at a friend's place or something, all I need is a browser to access it.
And I can just like continue where I left off on the other machine.
Other people prefer.
You can probably be closer to the data, right?
Exactly.
Right.
Yeah.
And you've got a lot faster pipe and you're not that dependent on what your own network
situation looks like wherever you are.
Yeah.
You're just shipping the answer, not the gig of data required.
Exactly.
I get the answer.
Exactly.
Right.
And you've got a pretty easy machine on the other end that can deal with all the calculations.
Yeah.
So I find that pretty cool.
At some point I overdid it and even dockerized the whole thing.
And then I felt like that was getting more in the way of it than being helpful.
Yeah.
You're like, I gave myself a DevOps job.
Why did I do that?
Yeah, exactly.
I only maintain one of these installations.
Why do I dockerize them?
Yeah.
That's actually a really good point.
I have the same philosophy on web apps.
It's like, well, if there's just going to be one of them and it's just me, how much flexibility
does this thing really need?
Okay.
Yeah.
So there's a whole section on these with honestly many places I haven't heard of and ways
to run it.
But let's talk about two things in this collaboration education section.
Three actually, but two are kind of in my mind, put them together.
One is NB grader, like real quick.
Like this is a pretty cool project.
Tell people about this.
This is pretty much what I described before in the abstract.
Right.
If you are a person in education and you teach a course and you want to want your students
to do a particular assignment and then they send in their submissions, you don't want to
hand grade them one by one.
What you can do is formalize basically what you want the answers to look like in a form
of regression tests.
And that is basically what NB grader is.
So like you get one notebook and you define what you want the answers to look like.
And then it just does the rest of it for you.
That's pretty interesting.
I've never used it myself because I'm not working in academia.
Yeah.
Like the value prop is obviously obvious with that one.
Well, I think there's two values here.
Obviously the less effort on the instructor.
There's also a little bit of more fairness.
Yeah, sure.
There's an interesting angle.
Like I'm sure that this is true for grading.
You know, is it morning and you're rested and patient or is it late and you're in a rush
and you're frustrated?
I don't know which affects which in terms of how the grades go, but it's got to have an
effect, right?
I was talking to some folks who did machine learning for discovering planets on Talk Python and they
said after the afternoon coffee and cake or cookies or whatever it was they had at this
university, more exoplanets to be discovered than in the morning.
Okay.
I was always told to like call people after lunch.
That's when they are usually most contained and most open to.
Exactly.
And so there's probably a thing about grading.
So the fact that this doesn't care, it doesn't get coffee.
It gets electrons.
That's good.
And I think there's also like a social science paper on like jury verdicts and sort of the
harsh use of jury verdicts over time of date.
Right.
That's a little bit, that's a little bit harsh to think about, isn't it?
Like I got an extra year in prison because they were grumpy, right?
That's not how justice should work.
Yeah.
They didn't have their coffee yet.
So the other angle that I think is interesting with this is if you're a student, you get
to know whether or not you passed that question.
Right.
A lot of times when you're doing complicated things, it's like, I think this is right.
But if it's not just really straightforward, like a calculus, here's what the formula derivative
is.
Right.
But it's a slightly more nuanced.
It's hard to know what the right answer is.
And so here you're like, well, the test passed.
So we're good to go.
I like that.
I had a course like that at university once where you could do multiple submissions and
the system would tell you like how many points you scored.
And it actually sort of was very motivating to sort of keep going until you score a perfect
answer.
I think having something like that in a course would be super cool.
I totally agree.
Before we move on real quick in the audience, David says, I use NB Grader for my teaching.
It's super helpful.
NB Grader identifies wrong answers and then you can go in and assign partial credit.
Yeah.
I love it.
That's actually really neat.
Really neat.
Okay.
The other one that's more of a educational demonstration or exploration is NB Tutor here.
So NB Tutor lets you go in.
Will you tell people about it if you're familiar with this one?
No, I haven't used it lately, but it looks like we're dancing.
I mentioned Philip Guo and Sam Lau.
They did Python Tutor, which lets you go and write some Python code.
And it shows you basically how it executes and how variables are related with pointers and
stuff.
And this is inspired by that.
So what it lets you, not this one, it lets you basically run a, what is it?
A magic command with a percent?
Cell magic.
You run some cell magic to turn it on.
And then to the right of the cell.
It starts showing the pointers and how things are relating.
So if you're trying to understand computer science and things, I think this would be cool for teaching.
And you have your code and all you have to stick on to get the visualization is this one short cell magic and you get the rest for free.
That's pretty cool.
Yeah, it's really cool.
They give credit right here to OnlinePythonTutor.
There's some other ones.
The Jupyter Drive one to integrate Google Drive looks pretty neat.
I think it's a little bit expired when I opened it.
It is definitely more of the experimental flavor.
Yeah.
And I imagine sort of whoever develops this is also on the mercy of Google Drive keeping their API stable.
Absolutely.
I think that is one way or it's in general, it's a non-trivial question figuring out how to best store your notebooks.
I mean, if you're just one person, you can probably stick them into Google Drive.
Yeah.
But as soon as you have more than a handful of people working on the same set of notebooks, you probably want a solution that is a bit more sophisticated than that.
I totally agree.
One of those solutions might be a proper Git story, right?
And some of the tools we'll talk about are going to cover that, right?
Yes, exactly.
The other one could be a collaborative, like a Google CoLab or some other, one of these other environments where it's like Google Docs.
There's hosted environments that sort of have that as a built-in or you basically, the other way is you roll your own and make it Git-based and both have their advantages and disadvantages.
I think with Git, you always know a little bit better what you have and what it does.
Whereas with the other one, that might come with some other fringe benefits like being able to comment on it or having versions of the notebook very nicely integrated with your GUI.
Yeah.
And it's like whatever you prepare for sure.
Like both work.
Yeah.
The online ones often have like infrastructure that comes with them too, right?
When the ability to press go and run it on a GPU if you're willing to pay or whatever.
Yeah.
Cool.
Okay.
Let's, I think that probably is the interesting ones that jumped out at me from there.
And then next one is visualization.
I mean, this is at the heart of the value of notebooks in the first place.
So Altair, tell us about that one.
I'm biased, even though I certainly, I'm not a developer of Altair.
I think what that team has developed is pretty amazing.
I use it for most of the things, for most of my visualization needs or almost exclusively.
What's neat about Altair is that it is declarative and it is built on top of a technology, on top of another package, which is called Vega.
And Vega is a platform agnostic visualization framework.
So basically what you have to do is if you want to have a chart like that, you just write some JSON declaration of basically, here's your data set.
This is the URL to the data set.
It's a tabular format.
The variable that I want on the X axis is called Foo.
The variable that I want on the Y axis is called Bar.
And I want a scatter plot.
And please make origin in this example here.
Please make that the color of the dots.
And you just specify that in a declarative format.
And then you can, what that allows you to do is you can create this declaration from Python.
But it might just as well be JavaScript or even like a handwritten JSON, right?
Right.
There's some kind of JSON data definition that goes to Vega and that drives the picture.
So basically Altair generates that data set that goes down to the next layer, right?
Exactly.
So like Altair is the Python binding on top of Vega.
And I think sort of declarative systems, most of the time they have a higher level of abstraction.
They have more concise notation.
And the way I always explain this to people when they ask about it is Vega and Altair is to visualization what SQL is to data query, right?
Your SQL query, you can execute that from within Python.
You can execute it from within a GUI.
It's sort of a language agnostic specification of what data you want to query.
And this is basically the same thing for visualizations.
Yeah.
It looks really great.
There's a beautiful picture of a scatterplot with a legend and multiple colors kind of pulling out some nuance in the data.
And it's like, I don't know how many lines of code you put that in.
Maybe four if you didn't multi-line one of them.
I mean, it's really.
You can probably golf it together in four lines if you're.
Without semicolons.
So if you did semicolons, you could do it one, but that would be wrong.
But like four reasonable lines, you could do this beautiful picture here, including the important.
And that already gives you a reason.
They're quite impressive visualization.
I think it has some nice defaults.
Like it knows how to nicely space the labels of the axes and stuff like that.
And then what it still allows you to do is build pretty complex visualizations too.
So there is this one example where you basically have a scatterplot on top.
And then on the bottom, you have something like a histogram and you can select the range in the histogram at the bottom.
And there you go.
And then you get this beautiful interactive animation and you don't actually have to write any imperative code.
You just specify what you want and Altair and Vega kind of like do the rest for you.
So I write some JavaScript, but years ago, I used to see these like really nice and beautiful animations that were built of D3.
And I'm like, I want to do cool stuff like that.
That's really pretty.
But I don't know any JavaScript.
And I feel like this is like leveling the playing field a little bit more.
And it allows you to do similar things from within Python.
It's really nice.
One of the things that I think is a little ironic is for the people who create these tools, like the people who created Altair, they have to write so much JavaScript.
And not that much Python, right?
Because they're building these interactive, beautiful experiences on the front end for us.
We get to write the Python and there's like a lot of that complex JavaScript is encapsulated into these tools that we don't have to think about, but we get to use, which is great.
It's a dirty job, but somebody's got to do it.
And I have a lot of appreciation what those folks are doing for the rest of us.
I do too.
All right.
So Altair is number one, right?
On the visualization.
I mean, it doesn't hurt that it starts with A, but also maybe one of the best ones.
Some of the other shout out.
In all fairness, like these things are sort of usually alphabetized.
These every once in a while, like things in the wrong place.
And by now I even built myself a linter that keeps the lists nicely alphabetized.
I'm sure that makes a lot of sense.
Yeah.
So Bokeh is one that's out there.
That's pretty well known.
People use a lot.
Yeah.
There's a lot of them, right?
There are.
And I think when you talk about visualization, the other very popular ones are probably MatBlootlib,
which probably was one of the first plotting engines for our backends for Python.
And then Seaborn, which kind of like builds on top of that.
Yeah, absolutely.
Seaborn is nice.
One that I've seen just recently on notebooks is TQDM.
I've always used this from CLI applications.
And TQDM is a way to just take a for loop and whatever you're going to loop over, you just
put that in TQDM, bracket that thing, and it becomes this live animated progress bar, which
is really neat.
But I've only thought of this as a terminal CLI type of thing.
But it works in notebooks too, I just learned, right?
Yes, it does.
TQDM is one of those, like, does exactly what it says on the team kind of things.
It does one thing and it does it very, very well.
Yeah, it's not an incredible output.
But at the same time, it's like, you know what?
I want to have a little bit of feedback for the users or for myself.
And you're like, OK, it's just literally wrap your iterator in TQDM and it's good to go.
It's a very natural thing to want.
Just imagine you've got like some long running computation over a loop, right?
And you just don't want to stare at a blank screen for two minutes.
Yes.
You can kind of see how maybe the idea developed from there.
I've got a lot of those type of things.
This portion of Talk Python to me is brought to you by Sentry.
How would you like to remove a little stress from your life?
Do you worry that users may be encountering errors, slowdowns, or crashes with your app right
now?
Would you even know it until they sent you that support email?
How much better would it be to have the error or performance details immediately sent to
you, including the call stack and values of local variables and the active user recorded
in the report?
With Sentry, this is not only possible, it's simple.
In fact, we use Sentry on all the Talk Python web properties.
We've actually fixed a bug triggered by a user and had the upgrade ready to roll out as we
got the support email.
That was a great email to write back.
Hey, we already saw your error and have already rolled out the fix.
Imagine their surprise.
Surprise and delight your users.
Create your Sentry account at talkpython.fm/sentry.
And if you sign up with the code talkpython, all one word, it's good for two free months
of Sentry's business plan, which will give you up to 20 times as many monthly events as
well as other features.
Create better software, delight your users, and support the podcast.
Visit talkpython.fm/sentry and use the coupon code talkpython.
Brian out in the audience says, HV plot, hollow views, bokeh, and panel are all awesome and
tightly interconnected.
Yeah.
And those are really nice.
All right.
So next one is the publishing.
This might be also a little bit at the very heart of notebooks.
The original idea of the notebook was, I want to have some explanation and then some executable
code and then some visualization.
Almost like I want to tell the story of a research project or something like that.
Right.
And so this section, it's right there, isn't it?
Yeah, exactly.
I think it's sort of less clear cut what this category is as compared to some of the others.
But it is basically anything in sort of that space of how do you run it?
How do you tell a story with a notebook?
How do you point out little things inside those notebooks?
One of the entries in there that I find quite interesting and useful, and it's also pretty
awesome from a technical perspective, is binder.
So what binder allows you to do is you can basically take any GitHub or even GitLab or
other hosted Git solution URL and put it in there.
And then what binder does is it builds a Docker image that has all the dependencies of those notebooks
and builds that image, finds an executable node somewhere in the cloud in their infrastructure,
and then points you to a Jupyter instance that has that notebook running.
So what it allows you to do is you see a notebook of GitHub and you're like,
geez, what if I want to poke around with this thing?
You just go on binder, put in the URL, and you can play around with a notebook interactively.
It's really cool.
So if people have seen the launch binder, a little tag or whatever you call that on like
a GitHub repo or somewhere else, I guess it could even be in an article that then just
points back over to one of these.
If you click it, just as you said, it's going to create an executable environment with the
right dependencies and let you run your code there, which is kind of impressive that that's
available to the world openly, publicly without authentication, right?
It's an incredible engineering feat, right?
Yeah.
Just all the considerations of like finding a node that has like sufficient sort of resources
available to be able to do that.
Assembling.
Basically, you don't know what people are going to throw at you in those repos, right?
Doing a pretty good job at sort of making a whole lot of notebooks executable.
I had Carol Willing, among others on the show recently to talk about Mastodon.
And we talked about like the federated storing.
You know, there's a bunch of people who are creating servers and allowing others to use it,
sort of volunteering to add a little bit of resources.
And she said, you know, a lot of what she sees over there actually was there's some parallels
over in the binder space about how certain universities and other places are like, we'll set up the
ability to run some of these binders to, you know, add a little bit of compute and resource
to the world.
And yeah, it's similar.
It's pretty amazing.
Like from what I can see, like what goes on behind the scenes, there is some of this,
I think is the execution is run on Google hardware.
So like, and then beyond Google, they have three other hardware providers.
So not only do they manage to sort of make all those code notebooks executable, but they
even run them on four different sets of infrastructure, which is pretty amazing.
Very cool.
Okay.
So a couple of others.
Another one here that really jumps out at me is Jupyter Book over.
Let me pull up there.
So build beautiful publication quality books and documents from computational content.
Now, really nice, huh?
I think there's a couple of sort of projects that try and do similar things, which is basically
you create a set of notebooks and then you either get a webpage or you get a book.
And two of the things that these are useful are, well, one, you're trying to write a book
about some subject matter, a machine learning book or something like that.
And the other, the other case where it's really useful is documentation, right?
If you are a developer or a maintainer of a software package and you want to document your
API, something like that can be very useful.
So what this gives you is not only the ability to write documentation, but also to include
code in that documentation.
And then in some cases, if you have the binder link, you can even set it up so that you've
got a piece of code in there and people by clicking a tab next to it can even try out
what that code does, fiddle with it a little bit, and then see what that does.
That's it allows you to do some pretty cool stuff.
That's a pretty interesting way to bring it back around.
Like we've taken this computational thing, got it going, turned it into a static book that
you have.
But if you click this button, you can go back and kind of.
What we just talked about also sounds very much like NBDIV, which is actually a project
that I use in, has a very similar flavor where it's specifically geared towards people who
write software packages.
And the idea there is that you take your code and you define your classes inside of
a notebook.
And then people can, so you can both actually have your code lives inside that notebook.
You can also define your tests in that notebook.
And then some added benefits that you get from that is you can run your tests from a notebook.
And these things don't live in seven different places, like your code base and then your test
base and then your documentation repo.
But they all live together in one space.
And if you make a change that influences or has an impact on all three of them, you don't
need to do it in three places, but you can just do it in the notebook where it's all together.
Of all the things that plug into Jupyter, I think I'm most impressed with NBDIV.
It's pretty nuts.
Yeah.
I think this is Donald Newt, right?
He called this a literate programming environment.
And I feel like this is the kind of stuff he envisaged where he back in like 83, when he
wrote his book around about literate programming, right?
This is really what he had in mind.
It took a while to get there.
Yeah.
The tools he was working with, they weren't like these.
Yeah.
So with NBDIV, you can have your documentation, you can publish, you can take your notebook
and export it or convert it into or build it into a Python package or a Conda package.
You can publish it to PyPI and Conda.
You can have tests, you can have continuous integration.
Then also you can, if you've got complicated code that you need to integrate in other ways,
you can sync it to Python files and then back.
I think that two-way integration is pretty cool.
Yeah.
For this, I really need to get this out of the notebook into Python directly, but then
don't just carve it off, like keep them sort of connected, right?
Exactly.
That's one of the key points there is that NBDIV allows you to do all of these things
in the same place, right?
Sure, you can do all of these things separately and a lot of people do them separately, but then
having them all in one place is just so much easier when you say make an API change.
Yeah.
Another one which wasn't really even shouted out there in that highlights that they have
is NBclean, which if you're doing, and we talked about the two possible ways for collaboration,
if you're doing the Git way, you know, these notebooks, their files contain the output,
which could completely vary from run to run.
So like every time you save it or rerun it, it's a merge conflict, right?
And so this will strip out that kind of information to avoid merge conflicts.
So it can be a real good way to sort of prepare it.
I suspect that could be a Git pre-commit hook.
I'm not sure of it, probably.
That's one way to do it.
And sort of, I think sort of the fact that the notebook format contains the cell output
and also some many information.
It's a bit of a blessing and a curse at the same time.
On one hand, it sort of, when you have a notebook file, you can load it up and you immediately
see the output without having to run the cells, right?
So imagine someone sends you a notebook file and you cannot run it on your machine.
You still get the benefit of seeing what their output was when they generated it.
So it's nice for that.
It's also nice for the fact that if you put it up on GitHub, GitHub can render this notebook
file with the output in a very nice and sensible way.
You immediately see what the output was.
But the disadvantage of doing that is that whenever you rerun it, sort of the contents of that file
change and it doesn't produce clean diffs.
For example, if you just change one line and then that line produces a block, your diff might
be a couple of kilobytes long, right?
If you don't want that.
And one of the tools that sort of deals with that is something we had on the list, ChupyText.
So ChupyText is basically, so ChupyText deals with this problem by basically giving you paired
notebooks.
So you have an IPNB file and you tell your Jupyter IDE.
In addition to that IPNB file, I also want a markdown file or a PY file that contains just
the input cells.
And then what you can do is if you want to version your notebook is just check in that
clean or stripped PY file or markdown file and rather ignore the IPNB.
So that is what we actually do in our company.
We have a couple of notebooks that serve as reports and we edit them collaboratively.
And the way we version them is by stripping out the output via ChupyText.
And so you really get nice, clean diffs.
And when someone makes a change, you can tell what they changed in a reasonable way.
That's super valuable.
Do you want to go back to the MB dev for just one second?
Because there's a big, long list here that you would get if you just ran MB dev help.
And so many of these are like, as a standalone command, they'd be like, oh my gosh, what
an amazing tool.
Like another one I just saw is MB dev changelog, which will create a changelog.md file just from
like your closed and labeled GitHub issues.
And, you know, like that's a cool feature on its own.
I could see installing that and never even using a notebook and just running that on my
Git repo, which is, you know, so there's a bunch of, bunch of neat things here.
You look at the list and what MB dev does for more than five minutes and it makes you want
to build a software package.
Yes, it does.
Which you could do with MB dev, by the way.
So that's, that's kind of meta.
Yeah.
Another one around there is NB convert.
NB convert is, I mean, it's, it's almost there in the name, right?
Basically one thing it gives you is a command line command where you can do NB convert for
dot IP and B and say, like, I want to convert this notebook to HTML.
So you can script the conversion of notebook on a command line level.
And then beyond that, what you can do with NB convert is it's also accessible as a Python package.
So you can control that notebook conversion from within your Python code.
And that is useful for a number of things when you really want fine grained control over how you
execute or convert your notebook.
So one of the things that I have built with that is basically a way to convert notebooks
without the input cells.
So if you want to build a report out of a notebook and you have a non-technical audience and you
want to get the code out of their way and you really want to just show them the output,
that is something you can build with NB convert.
That's really cool.
I hadn't realized it did that.
So here's what I want to show you.
And if you actually want to see the code, click on this binder version or view it statically
on GitHub.
But for most people, they just want to see here's the description and here's the figures.
It's still potentially accessible at least.
Totally.
And I think notebooks are actually quite a nice way to design a report, right?
Because what you have is building blocks.
And my report is I want the total number of orders for the last week and I want to chart.
And then I want like the number of orders by zip code or whatever.
And you build that in a notebook and then you just like NB convert it with the input stripped
out and you get an HTML file that you can serve on a web server and have something like a dashboard
for your team.
Very good.
So it's super cool for building things like that.
Yeah.
Very neat.
One more in this section before we move on.
There's a bunch, but I think Paper Mill is pretty unique.
You want to tell people about Paper Mill?
I haven't.
To be honest, I haven't used it that much.
I haven't either, but I did read this Netflix Paper Mill article about what they were doing.
And they were basically using...
Ah, Kyle Kelly.
Yeah.
They were doing some work to take notebooks and use those as like building blocks for managing
their infrastructure.
So there were a lot of interesting benefits and Paper Mill will let you basically turn the
variables at the top of the notebook into inputs.
And then the variables at the end of the notebook as outputs.
And you could treat it like a function.
So they're chaining these together for all sorts of crazy DevOps-y type things, I believe.
It basically sounds like something I once rolled my own of where basically what I just described
that I'm doing with NB Convert, I once built a version where sort of you could in the first
cell have a variable and serve that like a function input.
And it sounds like they probably did a much better job of sort of imagining you have a
dashboard and then you've got one for the US and you want one for international orders,
right?
Or for Canadian or what have you country, right?
You can basically do that out of the same notebook file, but just say, hey, these are two separate
versions.
One for the US, one for Canada, one for Mexico, whatever.
Exactly.
One of the benefits that they said they were getting was if something goes wrong, like if
a step crashes, because as you described the notebook, as it executes, it stores the exact
output and the inputs.
It's a snapshot in time of what happened when it went wrong.
So instead of just having a log message of it went wrong and here was the input, it's like,
well, here are all the steps and you can see the variables and the output coming.
And then here's the crash.
You're like, oh, look, these are the three inputs.
And here's how this one got.
And actually gives you nice diagnostics.
Yeah.
It's like a report of what went wrong.
It's almost like a, you know, you have these parametrized tests, right?
It is.
Yes.
Parametrized tests with some diagnostic output about what went wrong during that execution.
That's pretty cool.
It's unique.
I think worth a shout out, I suppose, there.
How about the version control side?
Anything you want to give a shout out to there?
That is a section that is a bit more sort of well-defined and clear what goes in there.
It's basically all sorts of tools for diffing, merging, code reviewing, changes in notebooks.
NB Dime is probably one of the more well-known packages in that category that looks very well-built.
Right.
The diff and merge tools.
Yeah.
So imagine you have an image, right, in an IPMB file, you would usually get like a horrendously large diff if one of the things in that image changes.
And it just displays that that diff not has 50 lines that change, but just like a neat, here is something that changed one line and doesn't mess up your whole diff.
Right.
This plot change, not these 700 lines of plot definition change.
Yeah.
Very cool.
And merging as well, which is neat.
Yeah.
All right.
We're getting a little short on time.
Let's see.
I want to, I know you want to give a shout out to Deep Note, both because you like them, but also they're a sponsor of the...
They support the list.
Yes.
They support the list.
Yeah.
So maybe tell us about them.
Deep Note is basically one of these hosted notebook solutions.
We already mentioned Binder.
We already mentioned Colab.
And they have built one that is a bit more centered around collaboration of teams.
You also get an execution environment with different sets of hardware from them.
And they really emphasize collaboration.
So you can comment and have discussions about individual cells in your notebook.
You can very nicely see what changes other people did to your notebook and all of that in a very well done, very dense GUI that makes a lot of things very easy for you.
If you're not already using one of these environments and you have a team that is maybe also not particularly technically focused on where it runs, how it runs.
This is a very turnkey solution.
Less DevOps, more Google Docs type of style.
They solve a lot of those problems for you.
It looks really neat.
The collaboration seems very, very nice.
I think that's a pretty unique thing to do in a polished way.
Yeah, and they also have nice integrations for a lot of data sources.
So you can directly query SQL from their GUI and pipe SQL results into a data frame, right?
So you have one cell where you write your SQL and that goes directly into the data frame that you can then visualize in the next cell.
So the ergonomics of Deep Note are probably better than many other notebook solutions.
That's pretty neat.
And so like you said, it's worth pointing out they're a sponsor of your list, not of our show, but they are a commercial thing, but they are a commercial venture, but they do have a free version.
There's something for me where I feel like it's, I kind of like to support companies that are purpose built, right?
Like Deep Note is built for running notebooks and collaboration, whereas a lot of these big tech things, it's like, well, I know Facebook's a social media company, but I could also do this other thing that runs on, or I could run this on Google.
And there's something about like, okay, there's a company whose only job is to do this versus like, I'm not sure I could ever get support.
Like if I had a problem with my Gmail, I don't know that I could ever get help, ever, right?
Whereas like, you know, if I went to an email company and got email from them, they would help me with email because it's their thing, right?
I think where it shows is that they spent a lot of time thinking about how people use notebooks and what they want to do with those notebooks.
They think a bit beyond just sort of the Jupyter technical, but more the ergonomics of how you actually use a notebook within a team.
And I think sort of, you can definitely tell that they know how to use notebooks and have thought about all the ways in which people use notebooks and how to make that better.
Nice.
Well, I've never used them, but if I have the need, I'll check it out.
Sounds good.
All right.
What else?
Maybe we've got time for one more.
Is there one we haven't talked about yet that you're like, oh, we really got to cover this one?
Let's do cell magics, right?
Okay.
If you maybe just Google for IPython cell magics.
I'll kaggy for it.
Yeah.
They are not strictly a Jupyter thing, but I think they're a not so well-known thing that is super neat.
And they are, since Jupyter itself started in, from, was born out of IPython, these are things that are also built into IPython.
So one of them is, for example, a percent debug.
So when you have a notebook open and you get an exception and your code gives you an error message, you can then, in a cell directly below that, type Terset debug.
And that will open up a debugger session that takes you directly to the point where your code fail.
Right?
So if you write something like, I don't know, I accessed true, the array true at an index position of five, right?
And that's where your code fails.
You can do percent debug and look at, well, at that point in the execution, what was actually stored in the list full?
Right.
And did it actually have five elements or did I run out of bounds?
So, like, whenever I get an error during an execution of a notebook and it's not obvious, I like to use percent debug to find out what's going wrong with my code.
Very nice.
Another one that is very useful is percent time, which is, have you used that?
No, but I often want to answer this question of, like, is this getting a little bit faster, a little bit slower?
And I don't really want to go into a profiler and I don't want to go to, like, write the date time or timestamp code to, like, print it out myself.
It's just, like, yeah.
I use it a lot in those situations where, like, I've got, I've got way A to do something and way B to do something, right?
And then I wonder, is this actually faster or is this actually performance-wise worse than doing it the other way?
And this gives you just a very quick and dirty answer to, like, orders of magnitude.
Is this the same level or should I be doing things differently?
It's very useful for that.
Yeah.
Percent time and some function call and see what it takes.
It's brilliant.
And then another one I want to mention is just exclamation point and then the shell command.
Yeah.
It's very useful for, I think it's also available as %sx.
Yeah.
So it's basically a shorthand.
So you can do exclamation point LS to get to a directory listing just to see what is in the directory.
Or you can do, like, I don't know, who am I to see what user you're running something as.
Or you can do ping a machine to see if it's up directly from your notebook.
So this is a quick and dirty way of running command line commands without having to leave your notebook.
It's really cool.
You know, if you wouldn't just interact with the file system or you see what files are available to me or all these things, right?
Yeah.
You wouldn't know because this hasn't published yet.
But in the sequence of when these shows come out, I just talked to, or you're ruined from data science at the command line.
Wait, have you seen this book?
No.
Yeah.
So it's got a bunch of interesting things that you can do on the command line for, like, querying data or running things in parallel.
And a whole bunch of these, these sort of ideas of, like, how do I do really cool stuff with the shell?
Just use your bang command and they become integrated into your notebook, right?
Which is, I think that's super cool.
You can even take it to do things like you do an LS and then your Python session gets past the contents of that directory as a list.
And you can then use it as a variable and assign that list of variable.
So it's like, that is a really, like, easy, but also, like, very shoddy way of listing the directory contents very quickly.
Yeah.
I mean, you should probably use pass a little bit or something.
We shouldn't even mention that.
We should not encourage that.
But if there's, like, really interesting stuff that's happening on the shell you want to use, like, for example,
there's this symbol that says total lines equals.
That's a brilliant one.
Yeah.
Which is a Jupyter level command.
And this says bang arrow to redirect input of some text file word count dash L.
And that tells you how many lines are there.
Like, yeah, maybe you want to make this all Python so it doesn't, it's not platform dependent, right?
Sure.
If you want to package this up, right?
In that package.
But if you only end up doing it once and you just want to know how many lines there are, that's a way to do it.
Right.
You're in, like, an exploratory situation, right?
And you just generated this file and now you want to know.
I don't know.
So there's, that's a really powerful one.
I'm glad you brought that up.
And then just the last one from there is, because it definitely saved me in a couple of very hairy situations, is percent history.
So that basically gives you a history of the 20, 10, or however many last commands you executed in a Python session.
Why it's sometimes useful is just imagine you accidentally delete a cell in a notebook.
I mean, you can always undo that, right?
But every once in a while, your undo history is so horribly messed up that you somehow sort of lost that cell forever.
And there was, like, a lot of finely tuned code in that.
So you can go back to that with percent history and get your deleted cells from beyond the grave.
Yeah.
And you can do percent history dash in five.
Just show me the last five changes.
Yeah.
Yeah, it's really nice.
Cool.
All right, Marcus.
I think we might be out of time, but, you know, what a cool project this awesome list is.
We've got a lot of people listening in.
I'm sure there's a lot more awesome packages, tools, resources that could and should go on this list.
So if whoever is watching or listening to this has a package that they feel should be mentioned there, it's just as easy as doing a pull request and adding your favorite tool or resource to that list.
We're very inclusionist on the list, right?
And we like to include people's suggestions.
Yeah, fantastic.
There's a couple that I could see showing up there, like a few comments in the live stream that those could be PR.
So have at it.
That'd be awesome.
Yeah.
Awesome.
All right.
Final two questions before I let you out of here, though.
If you're going to write some Python code, what editor do you use these days?
Jupyter.
Of course.
I overuse it.
Beautiful.
And then notable PyPI or Conda package or something out there or even a Jupyter plugin.
I know basically this entire show has been one after another, but something you want to give a shout out to.
If I can just give one a shout out, it's Altair.
Yeah.
You should be doing the plotting in Altair.
Altair right on.
Yeah, it's quite nice.
All right.
Well, thank you so much for being here.
It's been great to have you on the show.
Thank you for having me.
Yeah, you bet.
Bye.
Have a good one.
Bye.
This has been another episode of Talk Python to Me.
Thank you to our sponsors.
Be sure to check out what they're offering.
It really helps support the show.
AWS is the lead cloud for developers, but with over 250 services, it's an overwhelming set of choices.
That's where the AWS Insiders podcast comes in.
Their job is to help you make sense of all those AWS options.
Listen to an episode at talkpython.fm/AWS Insiders.
Take some stress out of your life.
Get notified immediately about errors and performance issues in your web or mobile applications with Sentry.
Just visit talkpython.fm/sentry and get started for free.
And be sure to use the promo code talkpython, all one word.
Want to level up your Python?
We have one of the largest catalogs of Python video courses over at Talk Python.
Our content ranges from true beginners to deeply advanced topics like memory and async.
And best of all, there's not a subscription in sight.
Check it out for yourself at training.talkpython.fm.
Be sure to subscribe to the show.
Open your favorite podcast app and search for Python.
We should be right at the top.
You can also find the iTunes feed at /itunes, the Google Play feed at /play, and the direct RSS feed at /rss on talkpython.fm.
We're live streaming most of our recordings these days.
If you want to be part of the show and have your comments featured on the air, be sure to subscribe to our YouTube channel at talkpython.fm/youtube.
This is your host, Michael Kennedy.
Thanks so much for listening.
I really appreciate it.
Now get out there and write some Python code.
I'll see you next time.