Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.
This is episode 139, recorded July 11th, 2019.
I'm Michael Kennedy.
And I'm Brian Okken.
And I want to welcome Ines Montani to the show.
Ines, it's great to have you here.
Special guest, going to help us cover the news of the week.
Thanks for being here.
Yeah, thanks for having me.
I'm really excited.
It's going to be really fun to have you participate in this.
Also, thank you to DigitalOcean for sponsoring this episode.
Check them out at pythonbytes.fm/digitalocean.
More on that later.
Brian, we've talked a lot about like, how do you install Python?
How do you manage Python?
How do you upgrade your stuff?
There's just so many ways.
And then we've got things like pipenv, flit, poetry.
It goes on and on.
And it still goes on, right?
This was a contribution from Niels DeBruin sent us this.
There was an article called Simplify Your Python Developer Environment.
And it talked about using pyenv, pipex, and pipenv together.
And my first reaction was like, we've already covered all of these.
However, I have tried pipex.
Actually, I did the joke, the pi jokes.
I did that with pipex.
And I've tried pipenv once before.
It doesn't really do anything for me that I really need.
And the pyenv, I've tried it and it didn't work for me.
So actually, all these things, I kind of wanted to give them another shot anyway.
So I went ahead and read this article.
And it actually is pretty nice.
It's a nice pros and cons of all the tools and how to set them up.
And I think for somebody that wants to try these out again, this is a good article to read to try to get back into it.
So if people don't remember, pyenv is used to install and manage multiple Python versions and flavors on a computer.
And then pipex is something that allows you to create, take a Python application and have it bundled with its own virtual environment and use it globally on your system without having to activate the environment.
And then pipenv is for when you're working on project and application, it's a way to manage virtual environments and dependencies on a per project basis.
These are really interesting because I feel like often they kind of blend like in a blur together, right?
You're like, well, I know there's all these E and V things I could use and whatnot.
And it's like, well, when should I use what and what one is relevant for the situation?
And what do you think, Anis?
It actually took me a second to remember the one that I've used.
So I'm totally in the market for stuff like that.
But actually, I hadn't heard of pipex at all.
But I think, yeah, pyenv I definitely use.
And I think it's quite important, at least for the work I'm doing, because I need to run stuff in all kinds of Pythons.
And I mean, as a library developer, we need to build stuff for like Python 2.
We're supporting Python 2.7 and 3.5.
Just so folks know, like you're deeply involved with spaCy and some tools built on top of that, the natural language processing, which will come evident as we go through some of your topics and more.
But, you know, maybe not everyone knows your background.
But I feel like pyenv is most relevant for people building libraries.
And pipenv is really relevant for people building applications.
I don't know.
What do you think, Brian?
Both of them are important for people like us that have to do both.
I have a question for Ines.
The pyenv.
So one of my concerns was, can I use it to install, to have multiple Pythons and still be able to run them all from one project, like with the tox build to be able to access all of them?
So I haven't tried it all like within the exact same projects.
I think you might need different virtual environments for that.
At least that's how I use it.
So I use venv to create my virtual environments.
And then they are created with whichever Python version I've configured locally.
So I do like pyenv local 2.7.
And then the virtual environment will have 2.7 in it.
Okay.
Well, I'll give it a shot.
Yeah, yeah.
Really nice.
I'm a big fan of PipX.
I think PipX is super cool.
So PipX is great if you have a thing that you just want as a utility on the command line in your terminal.
That happens to be Python-based.
So instead of brew install something or npm install something, PipX does that.
So, for example, I have like cookie cutter.
I have the HTTP library.
I have glances.
I have PyJokes, of course, because we run this podcast.
And some other stuff that I'll even talk about later, like PTPython.
Is that a bit like PEX files or is that something else?
It's a little bit.
What it does is you say I want to have, let's say I want the utility PTPython, which is like an Emacs enabled rebel, basically.
Okay.
So I want to have that.
And I want to be able to just type it.
It's not tied to any project.
I just want to have it as a command on my computer that I can use.
So what you can do is you can PipX install PTPython.
And then it just automatically puts it in a location, modifies your path so that it has its own virtual environment.
It upgrades itself and its dependencies separately.
But anytime I want, I can just type PTPython and go crazy or glances or PyJoke or whatever.
Okay.
I think I get it.
Okay.
That actually sounds quite cool.
Yeah.
It's really nice.
You can just say, what are the updates from my Python libraries that I use as applications or little utilities?
It's pretty cool.
I like that one as well.
Yeah.
I wonder if we can ship our annotation tool Prodigy like that because it's very, very command line heavy.
And, you know, it's usually kind of a separate thing.
All it does is build upon pip.
So if you could pip install the thing and it has an entry point, then you can pipX install it as well.
Ah, okay.
Yeah.
Cool.
Yeah.
Pretty cool.
All right, Brian, are you switching to this?
Are you going to use PyEnv, pipX, and pipEnv?
Is this your new plan?
I definitely want to try PyEnv because I want to try new Python versions.
And my old process was to just download the regular install and install it.
And then my path is all weird.
And, yeah, it's a mess.
Yeah, classic.
Cool.
Yeah, this is nice.
Definitely for people looking for a different workflow.
It's something they can check out for sure.
All right, Ines, what's this next one that you got for us?
This week was actually, or like the past few weeks were actually super exciting also in my field.
So there was a new release of a fast AI course for natural language processing.
So fast AI is a very popular free online course for deep learning by Rachel Thomas and Jeremy Howard.
And it also comes with a Python library.
It comes with lots of notebooks, really active communities.
So if you want to get into like the modern machine learning stuff,
that's like probably the go-to course that I would also recommend to you.
And they've also produced some very influential research developed alongside the library and the course.
So, for example, ULM Fit, which was a very popular algorithm for text classification.
And yeah, the new thing is they've just released a course of natural language processing.
And it's a very practical introduction.
And what I thought was really, really interesting and really cool about it is that it, of course,
covers like the modern neural network approaches and all the like very hip stuff.
But it also focuses on traditional techniques.
So just the whole background of like, okay, what did people do before deep learning, topic modeling, linear models,
just really all the basics and even like rule-based approaches like regular expressions.
Like, you know, some people might look at this and be like, what regics?
That's like, you know, I did that 20 years ago.
But in fact, like, you know, in real life and in like real life practical applications, that's like super important.
And you can do a lot with that, that, you know, really gets the job done.
So I thought that was really cool.
And of course, another thing, the course has a really strong focus on ethics as well.
So their videos on bias and disinformation and basically just the topic of like, okay, think about the impact that the work you'll be doing has.
And I thought that was incredibly refreshing.
And of course, disclaimer, like I haven't actually watched all the videos yet.
I don't even think that's like physically possible to do all of that since it was released.
It's too new and it's too long.
Yeah.
It's like, it's a lot of material, but yeah, I really like the work they're doing.
And it's like, yeah, it's a very, very significant release.
And it's all free.
Yeah.
It's super cool.
Yeah.
It looks like it's free.
Like I was able to go pull up the videos without even having an account there.
It just sort of takes you through it.
More like an online video book.
You just make your way through, right?
Yeah.
And lots of like notebooks.
So you can open the same notebooks.
You can play through the examples and of course also use their library to, you know, really work through the things efficiently.
Sure.
Yeah.
That's super cool.
Does it cover any of the libraries that you all work on?
Like spaCy or anything?
spaCy is a much more like high level toolkit and framework.
So it's like, you know, this is really the basics of the technology.
So while the Fast AR library, I think it does use spaCy for tokenization.
But spaCy is really, you know, once you're building applications and you have some problems and you want to construct your pipelines and really ship something into production, that's when you would be using spaCy.
But actually, in fact, spaCy is not really the best solution if you really want to learn the underlying algorithms and implementations.
Because we're actually super opinionated.
You get one implementation and, you know, you kind of take that or you plug in your own.
I see.
This is like learning the algorithms and the foundations that maybe spaCy uses so you understand it better.
Yeah, exactly.
And also, you know, giving you some, yeah, the background.
And yeah, even the rule-based ideas, which, yeah, I still think it's so great.
I scroll through it.
I'm like, great, regular expressions.
That's like really what people should think about.
Yeah, I mean, that's a start, right?
Like sometimes you just want to pull data out of text and there you go.
Yeah, and especially then some people really, you know, then they start throwing like a neural network model at it when actually best solution would have been to just write one regular expression.
Like, I don't know, you work at a company, you have a statistical model that recognizes organization names.
And then, you know, your manager comes to you and is like, well, it's all great, but like it often gets our own company name wrong.
Can you fix that?
That's really embarrassing.
And, you know, you can spend like hours trying to tune your model and like update it and fine tune it with more examples.
Or you can just add one regular expression or one rule on top that says, okay, whenever I come across this string, don't get it wrong.
And that will likely take you like five minutes and it's much more effective in the real world.
So this is the practical applied natural language processing, right?
Yeah.
Speaking of language, this next item that I want to talk about, it just scares me.
So let me tell you quick about it.
I'll get your two opinions.
The idea is that we can clone the human voice by giving it a sample and using some sort of neural network type thing.
I'm not sure exactly.
So this was sent in by Brendan.
Thank you for sending that over.
And, you know, in just a couple of minutes, you can load up somebody's voice, use some Python, a pre-trained machine learning model, and then type in text.
It will speak whatever that text is in the voice of that person.
It's just, I don't know.
I feel like public discourse is in serious jeopardy here.
What do you all think?
This is pretty interesting.
And I was a little frightened, actually, watching this video of how easy it was to copy somebody's voice.
I mean, I don't know what the code behind it's probably not easy, but it's a little creepy.
My first thought was I could use it for if I have solo episodes, I could be my own co-host.
But that'd be cool.
That'd be pretty funny.
Yeah.
No, but I think I would say, I think it's still quite compute intensive, like, to do that, right?
I think you still, you know, if you really want to have good results and really want to do it right, but it's true that this, you know, this really, this is a really good, like, example of, wow, that's possible.
And that's the type of stuff that's been possible for quite a while, especially across, like, you know, video image and, you know, also voice, audio.
Right.
I mean, we've heard of the deepfake stuff for videos and whatnot, and that's kind of scary.
But this is, it's almost like this could be worse, right?
I can imagine somebody just putting a little static, a little muffling filter on it and saying, oh, here's a hot mic take behind the scenes.
Somebody said something they weren't supposed to during a presidential debate or some kind of public figure they're trying to discredit and just make them say stuff.
Now, I don't know what you all think.
To me, it still sounds a little bit off.
Like, it doesn't sound exactly like the person, but, you know, it's pretty close.
But I think you would still use it.
Yeah.
And also, I mean, I do think this type of technology will definitely lead to a situation where we will all just take things we hear in, like, recordings or videos much less seriously.
Like, you know, I do think it will develop into a culture where we don't necessarily trust an audio recording because, you know, it could have been produced by something like this.
But I do think just for everyday life scam, like, I think it's very timely because, yeah, there are all these news articles about all these, like, financial scams and companies using deepfake audio.
Or even before, like, using spoofed emails that were quite effective.
And actually reading that, like, you know, the trick there, I'm like, I can totally see how, like, an accounting department falls for that and thinks, oh, it's their boss in a hurry.
And then imagine that with a voice of, like, you know, CEO.
So scary.
Exactly.
Yeah.
So I'm going to link to the video.
You all can watch it.
I'm also linking to the software that did this.
Apparently, it uses something called transfer learning from speaker verification to multi-speaker text-to-speech synthesis.
And that even has an acronym, SV2-TTS, of course.
And so this was based on someone's thesis.
And you can watch the video and get a good sense.
But, yeah, you just imagine, like, I call, I somehow get the number of the CEO and I call them up and I record that call.
And then I take their, like, I don't need only five seconds or so with their voice.
And then I take that and I use some text to, like, real-time generate.
I'll call up the accounting department and say, hey, this is so-and-so.
We've got a super emergency.
Really important client.
We forgot to pay them.
We owe them $10,000.
And you just, like, type and then replay what you type live back to them.
Yeah, and then you overlay that, yeah, with some background music, background noise and just, like, oh, I'm, like, in a taxi right now.
Exactly.
Like, please get this done ASAP.
Otherwise, we're in trouble.
Bye.
Sometimes what usually doesn't work for email.
But if it's literally a voice that's interacting with you that sounds like the boss, well, it might work.
Hopefully we didn't give anyone ideas.
I guess you guys are better criminals than me.
I was just thinking, like, a different version of Ferris Bueller's Day Off.
You could just use this to call in and excuse yourself from school.
Oh, my gosh, you're right.
This would be beautiful when I was in, like, middle school or high school.
Oh, my goodness.
Yeah.
No, Michael's not feeling well.
Is he going to be okay?
He may be out tomorrow, but he'll be back pretty soon.
All right, then.
Yeah, that's really horrible.
Yeah, I mean, pretty soon you have, like, kids recording their parents' voices.
Yes.
I don't know if that works.
These are all bad.
This is a good example of why, yes, a focus on ethics, you know, when you're learning these technologies is, like, incredibly important.
Because, you know, we have that technology and every developer should think about, okay, what's the impact of having this and using this?
And, okay, we can release it to really also, you know, make everyone aware that this exists.
And, you know, we're talking about this right now, but still.
Yeah.
I guess final thought on this one, Ines.
What do you think the chances of some sort of fingerprinting or, like, system that can determine that this was faked, right?
Like, not a human, but if I could take this and feed it to, say, another ML model that knows, like, the little glitches that show up in the system, like, will we be able to verify stuff or not in the future?
Are we just lost?
I think so.
I think there have been, like, some experiments where they tried that.
And, I mean, another approach would be, okay, you can always encode things in the model that, like, only show up under very, very certain circumstances.
So, that's how, you know, you can watermark that model.
You can release that.
And then if you say a very, very, very specific sequence or if you type nonsense secrets in there, it will always produce something nonsense but very differently.
And then you're like, ah, that's the system that was used.
And, you know, that's how we can.
It won't work on the output, but, like, at least, you know, we can at least have some way of kind of finding out what type of system.
Yeah, that's part of the ethics part, right?
Like, that you embed these little watermarks rather than just, like, put it out there.
I don't know.
It's pretty scary to me, but I think as a society, we'll come around to figure out what to do about it.
Cool.
Well, not scary is DigitalOcean.
I just want to tell you quickly about them.
And they're supporting the show.
So, thanks to DigitalOcean.
All of our software runs on top of DigitalOcean infrastructure.
You get the MP3s, it delivers either streams or downloads out of there, things like that.
So, they're really, really great.
You can get started for as little as $5 per month for a server.
And they got a bunch of cool services, managed databases, load balancers, and whatnot.
And it's, you know, it's not like EC2, which is so complicated.
It could run Netflix.
It's like the simple thing that you just need to build your app and get it going.
So, check them out at pythonbytes.fm/DigitalOcean.
And you get a $50 credit for new users there.
And definitely highly recommend it.
Brian, what's this next one that you're working on here?
Okay.
Well, another contributed by a listener, this one from Andrew.
He contributed a little snippet that was on a Reddit stream.
And it was, I'm going to just guess, just describe it as abusing the pyproject.tomo file by putting any file stuff in it.
So, the example that he gave was you can have the pytest any file and the mypy any file or two any files for tools.
And you can, they're in any file format.
And Tommel files kind of look like any files, but they're not.
They're different.
And you can break any with Tommel syntax and you can break Tommel with any syntax.
However, you can write them such that they are, if you're careful, you can write them such that they comply with both.
And I went ahead and tried this out.
I was able to try putting pytest any, like, options within the Tommel file.
And, you know, both pytest and mypy do not support doing this.
But they do support passing in a path of where their config file is.
And if you pass in the project.tommel file, you can get it to work.
And if all you're trying to do is reduce the number of files in your project, yeah, this kind of works.
Why would you want to do that?
Just to try to reduce the number of files in your top level directory.
Okay.
I don't know.
I should, like, use all of these, like, files more.
And I feel like, you know, I love this idea of imagine if there was one config file.
Like, really, you know, only one place where you put everything.
Also, your dependencies.
Everything just goes in one file.
And then you have that.
But for some reason, it's never actually worked out that way in practice.
You can put it in the setup.cfg.
That's a possibility.
But those are any file syntax also.
I have to admit, like, our projects don't even have a setup.cfg.
We have a setup.py.
And then we have the requirements.txt.
Okay.
I have an admission as well.
Like, I know we're talking about pyproject.toml, but I'm still just using requirements.txt as well for some of my projects.
Because, you know what?
The workflow works.
I've got, like, external systems, like PyUp that are out there, like, automatically doing PRs for changes.
I mean, it's just, like, it's super cool.
But at the same time, I already got a flow working.
And I just, you know.
Yeah.
No, I can relate.
And so a user once, I think, contributed a pyproject.toml to spaCy.
And, you know, I really appreciated that because I'm like, great.
But it's still, I don't think, yeah, we can't really ditch requirements.txt yet.
And so now we also have that.
And now if we update, like, a dependency, I have to manually edit that in three places.
Yeah.
Yeah, yeah.
That's how it goes.
I'm on the bandwagon.
I'm switching.
I'm using Flit now.
So I'm using pyproject.toml and Flit.
Okay.
And that works cross-platform, cross-Python?
I don't know.
It works for me.
Well, that's always good.
Yeah.
I'm using it for mostly 3.6 and above, 3.6, 3.7, 3.8.
My personal projects, I think it's sufficient.
And the ones I'm supporting for other people, I think it's fine for an individual project
owner to say, I'm not supporting 2.7.
So.
No, of course.
Like, I would never, you know, and I also would never go and just, like, whine about, like,
oh, there's, of course, there's, like, an edge case for 2.7 on Windows.
And there's something there.
Like, I understand it's not, like, as easy if, like, you know, there was, like, the Python
that could just, like, magically fix everything.
Yeah.
You know, I appreciate it.
There's a lot of work that went into all of this.
And it's like, yeah, something's a bit tricky.
One of the interesting things was coverage.py.
I use that a lot.
And it got, there was a request to put pyproject.toml support on coverage.
The reason why it isn't there isn't because of any sort of, like, not that it would be
cool, but the Toml parsing is not part of the standard library.
And coverage has the strict policy that the only dependencies that it has are standard library
dependencies.
That's a reasonable desire also.
Well, yeah.
Yeah.
That's cool.
You just get coverage.py and just run the file or whatever, right?
Yeah.
But maybe we should get Toml support added to the standard library and then it wouldn't be
an issue.
There you go.
Yeah.
That's a whole different discussion.
I know that's quite a heated debate about what should be on the standard library these
days.
And the trend is less, not more.
I think if you take the poll.
Yeah.
So some of the tools that you build are absolutely about making machine learning easier and do that
across teams.
So I know that you're really turned on to that space and pay a lot of attention.
So this Polyaxon one that you found for our next item must be pretty interesting.
Yeah.
So basically, it's actually quite funny because, you know, I've obviously like, you know, thought
about what I was going to talk about and had like something else planned.
And then really today, earlier today, that release came out version 0.5 of Polyaxon.
So I was like, okay, great.
This is perfect.
It's like as if like, you know, they'd waited for my podcast recordings.
Yeah.
So basically, we've been using Polyaxon internally.
And essentially, it's a tool for experiment management.
So, you know, if you work in machine learning and you train your models, you have to like
run tons of experiments.
And you have to, you know, you run an experiment, train a model, look at the results, then you
stop it.
Then you tweak some other knobs, then you try again.
And you keep doing that until you have a good result.
And one thing we always do when we travel and like visit universities and research labs,
we usually always ask them like, hey, how do you run your experiments?
And usually they're like, well, yeah, you know, we got this GPU and it sits on my desk.
And then I start an experiment and then I sit around and then I wait.
And, you know, that's at like the top, some of the top like labs and like, you know, people
where you'd think like, oh, they must have everything taken care of, tons of money.
It's like, no, they're sitting there with their little GPU on their desk.
And that's how it's done.
And basically, Polyaxon basically, you know, helps you solve this.
So it's like super, you know, it's built on Kubernetes.
It's like very easy to set up.
And especially, you know, if you're already set up with cloud computing and yeah, and you
can also do stuff like hyperparameter search where like, you know, every hyperparameter
is a tiny knob and you have like tons of them.
And then you want to find the one combination that gives you better accuracy.
And so you can run lots of experiments, see them, you know, in their little graphs and like
try things out.
So it's been a very great tool.
It's all open source, which is, you know, very much in our spirit.
And yeah, they just released 0.5 and which comes with a plugin system, which is also great.
It's very much in our spirit.
That's also how we like to do things with spaCy.
You can run it locally.
And like, you know, it comes with some new features for chaining stuff together.
If you have your experiments have lots of steps.
So yeah, it's a great tool.
If you're working in the field.
It looks super cool.
Yeah, I can definitely recommend it.
Yeah.
So it's got a platform as a service offering.
So you just, you know, kick it off and have it go.
But also like on-premise enterprise option too.
Yeah, that's cool.
I think that's the focus.
It's like, you know, you run it and then it gives you like a little UI and you just like,
you know, you set it up yourself on your service and then it manages that.
Yeah, this looks really great.
Runs on Google's Kubernetes engine, among other things.
Probably pretty much any Kubernetes cluster, I guess.
I haven't tried it.
Yeah, I think you might have to do a bit more like setup.
If, you know, you're bringing your own, but like it should be quite very straightforward.
Google actually makes this quite straightforward.
And yeah, and another nice thing here is with the hyperparameter search.
Like if you, yeah, most machine learning stuff is done on GPU, but not everyone has GPUs.
They're very expensive.
And we actually say it's not always the best choice necessarily, because if you just want
to run lots of experiments, you can run them all in parallel.
You can run like thousands in parallel.
And then, you know, if you have a tool like Polyaxon that can help you do that.
So, you know, you don't have to kick them all off manually.
It's actually going to be much cheaper and much more efficient.
And you don't need a fancy GPU.
You can just run it on CPU.
Right.
Yeah.
The GPUs are great, but they're much harder to come by.
So that's cool.
Yeah.
It also has something about you can run it on your laptop as well.
Yeah.
It's a little data science of the box thing they talk about there at the end.
So, yeah, super cool.
A nice one.
All right.
This last one I want to talk about here.
Actually, the way I got it onto my system is I use PipX.
It's my PipX installed.
This thing called Flint.
So we've heard about linting and we've heard about f-strings.
And I'm guessing some combination thereof is where the name of the thing called Flint came
from.
It's quite new.
It's not super popular yet, but it works really, really well.
So the idea is I've got some code.
Maybe it's old code.
Maybe I just haven't bothered to write everything using f-strings.
And I would like to modernize it in its string processing.
So this tool, what you can do is you can point it at a single Python file, or you can just point
it as a directory, like a top level directory to just go to every, you know, traverse the
whole directory tree and find all the Python files and then rewrite all the string operations
to be f-strings.
Nice.
And it does a pretty good job.
It'll do the percent, you know, Python 2 style formats, as well as the, you know, dot format
style.
And it'll just replace all those with f-strings.
There's a couple of things it doesn't do.
If it's like multi-line, really long stuff, it won't replace those.
And when I first tried it, it actually was making a mistake on digit grouping format.
So if you have curly braces colon comma, because you want, you know, thousands, millions grouping
and so on, that like just went insane and broke my code.
But I submitted a bug over to the guys working on it, fixed it.
I believe a new release is already out.
So that shouldn't be there, but just, you know, run it on something you have under source
control and just look at the lines that have changed before you do the commit or, you know,
run your task, something like that.
Yeah.
Well, you're such a good open source user.
Like, you know, found a bug, you know, reported it probably with like a nice, you know, description
fixed.
I'm like, I ran this on all of Talk Python training and all of Python bytes and some of it broke.
So what I found out is it's exactly this.
If it has digit grouping, it broke.
And so then they fixed it, but it was no big deal.
I think I converted about 500 to 700 string formats over to f-strings.
And it just, it's cleaner, shorter, nicer.
The thing with f-strings is I always, I don't know if you all use it, I'll ask you a sec,
but like, I'm always like, okay, I'm going to write the string.
I'd say quote, type, type, type.
Oh, I want to put something in here.
Curly brace.
I wish I would have done the F back, back, back, back, back, back, back, put the F and then
back, back, back, back, back.
And then type the thing.
I'm like, well, that was more work than just dot format.
Cause the IDE will auto-complete us like dot F and then boom.
Like, so a lot of times I ended up using the format anyway, but I still prefer to have the
f-strings and read them.
So this way I can write it however I want and then just hit it with this before I do a check-in.
I think that we should ask VS Code and PyCharm to detect when we put a curly brace in a string
and automatically add the F.
Yes.
Just like a hockey.
I was going to say the exact same thing.
So it's not.
That's awesome.
You all are in the same boat.
So yeah, this is, this is really cool.
I definitely think my code is nicer.
I originally created like when I created the Python bytes website and I created Talk Python
training.
This was when the latest version of Python and Ubuntu was three, five.
So we didn't have f-strings.
And I actually took the server down once on accident because I used an F string and a
little utility file that was like in the same directory and like the scanning path, looking
for the routes, found that, couldn't parse it and the website couldn't start.
I'm like, why is it down?
What have I done?
I didn't even change it.
So anyway, I'm really happy now that I could just take all that code that I used to like
leave in the format style and just flint space, you know, just run on this directory.
Boom, it's done.
So yeah, it's really nice.
I can't wait to just like intuitively just use like f-strings and all that stuff.
It's still kind of, I don't know, just ingrained in like my brain.
Like even, I know, I go to conferences and I see people use all the new syntax and I'm
like, yeah, oh, that's so nice.
But it's just like, you know, in my day to day work, you know, even if we don't support
two, seven, we support three, five.
And they're just like a lot of these.
Yeah, exactly.
You know, there is this thing called, I can't remember what it was called, Brian.
We covered it where it lets you add F string support to Python two.
It may also work for Python three, five.
You can definitely retroactively add f-strings to the format.
It's some weird way.
But then you need like another runtime dependency, which.
Yeah.
It's not worth it.
It does some weird thing.
That's how it works.
Yeah.
That's a bit unattractive.
It like rewrites like the file loader with a certain weird encoder.
It's like, it's pretty sketchy.
Yeah.
Okay.
Now I wouldn't want to ship that in like our libraries.
Oh, come on.
Why not?
Just run your tests.
Make sure they pass.
That's good.
Yeah.
Good.
But it's cool that something like this is out so that when you decide like we're no
longer supporting three, five, you just hit it with this and like, you know, a quick
scan through the files and it's, it's F stringified.
That's going to be so, so nice.
Like I can't wait.
I'm yet all that and all the type hints and like, you know, once we can drop all of the,
the older versions, like I can be so, also nice.
So yeah, I'm really, I won't even mind like rewriting all of the code.
Like I think with our team, we're just going to sit down and be like, yay, let's do this.
We're going to do it.
Yes.
Here we come.
Yeah.
It's going to be so satisfying.
Like years later.
Yeah.
Well, it's the curse of success, right?
You have so many people using your libraries that you just got to keep it sort of a little
bit backwards.
Yeah.
Sure.
And like some people are still stuck on legacy code.
Like, I mean, I'm not, it's not, you know, some people like look down on like companies
that are still on like Python too, but it's like, you know, it's not
like many of them like really enjoy using all this legacy software and legacy like stuff.
They're just like, it just exists.
And we might as well keep supporting it if we can.
Yeah.
What's the Python 2 story for you all?
You're still supporting it for now?
Yeah.
And I think we will for a while.
After January?
Yeah.
We probably will.
Like there will just naturally be a point where like we cannot upgrade any of our dependencies.
Like, I don't know, NumPy for example.
Okay.
If we ever, you know, it is a good reason why we want to use a newer version of that.
We just can't.
And if everyone else drops it, we just have to be like, okay, that's it.
We can't.
And it's also not like the old versions are going away.
Like if we make sure we don't have any major bugs, like you can still use an old version
of spaCy and like, we're not going to take that away from you.
Right.
Just pin the version and you'll be good.
Yeah.
Very cool.
All right.
Well, that's it for all of our main items.
Brian, you want to, I know we've got a few little extra things just thrown here at the
end.
Do you want to kick it off?
Yeah.
So we had an email from Andre Janisch.
I think that's how you say his name.
Saying that we were, in one of our episodes, we talked about regular expressions taking down,
and I even forgot, took down something.
It was something major.
Yeah.
I can't remember, but some major cloud provider went down because of it.
Yeah.
And how that could happen.
So there's an interesting video talking about regular expression denial of service attacks
and how it happens.
It was just an interesting video.
We'll have a link to it in the show notes if anybody wants to watch.
Okay.
Yeah.
Super cool.
So I got a couple I want to throw out there.
One is if you're doing any work where you're working with like microservices or you want to
have some kind of application that's talking to some API endpoint, you want to debug it.
There's a new thing called HTTP toolkit, and it has like special Python support.
So this is like a proxy you can run on your computer and say, start recording, and it'll
start recording all the requests that you're making.
So it integrates with url.lib.request, url.lib2, request, pip, Python 2 and 3, photo, all those
things, and specifically catches traffic from those.
And it does interesting stuff by changing the Python path and environment variables.
And then all of these libraries that I talked about apparently respect certain proxy settings
and things you can set.
So you don't have to change your app at all.
You just start a terminal with HTTP toolkit and then run your code, and it can record it.
That's cool.
Yeah.
So if you're like, why is this crashing?
You know, I run my request thing, and then I get some kind of crash.
And how am I supposed to, you know, you don't have like the developer tools in your web browser
to like look at the headers and whatnot.
So you can do it with this.
It's pretty cool.
It's free, but there's also a paid version.
Just heads up.
Also, there's a nice little link.
Last time, time before, Brian, we were talking about magic, Python magic.
You're like, well, that's a pretty strong, strong name to be magic.
And all it does is detect file types.
Right?
Do you remember that thing?
David Martinez said, well, the reason it's called magic is there's basically these magic
number signatures that appear at the beginning of files.
And that's like teaches you about the syntax.
So for example, if you had a SQLite file, it would start with 53, 51, 4C, 69, et cetera.
If you see those numbers up the front, that means SQLite, right?
So wait, did you actually know this by heart?
Or did you write this down?
No, no.
I don't know.
Oh, of course.
Yeah, I know that one.
Sure.
No, I just, I pulled it up.
Let's see.
Really quickly, Python 374 is out.
So I brew and upgraded my Python 37, which is how I'm getting on my machine.
And it's already on homebrew as well.
So that was like, I don't know, six, seven hours delay there.
It was really nice to see that come out real quick.
Or if you have pyenv, you can do pyenv.
I don't even know the command, but like install something and then...
Right away have it.
That's awesome.
Yeah.
And then the last one, I want to point out this thing called flying.
I just call it flying fractals.
This person put together this project using Py Wonderland.
And it automates some other libraries that are based on C.
So they made some really cool videos of like flying through three-dimensional, like animated
Mandelbrot sets and other kinds of stuff.
When I just watched it, I thought just, wow, this is super cool computational stuff over
here.
I've done a bunch of work in like complex dynamics and like trying to visualize that.
And like this kind of blew me away.
So if you care at all about that stuff, I think you'll just enjoy like a minute of that video.
Yeah.
So yeah, actually, you might have actually noticed that my voice still isn't like 100%
and it's a bit rough.
And that's because last weekend we had our very, very first conference here in Berlin called
spaCy IRL, like, you know, spaCy in real life.
So our community came together and I'm still like absolutely blown away.
Like there was, you know, the vibe was amazing.
We had like 200 people there and a lovely like old theater, 12 really amazing talks by people
from research, industry, community.
So it was really a lot of fun and all talks were recorded and we're currently uploading
them to our YouTube channel.
So probably by the time this airs, they might've already been released.
And yeah, it'd be a bunch of, yeah, if you're interested in natural language processing, spaCy,
those, the talks were really, really great.
And yeah, I hope you, you enjoy watching them.
That's awesome.
I'm so glad you're putting them on YouTube and wow, congratulations.
You must be just blown away at how awesome it is to put on a conference about your own stuff,
right?
And so many people came and the energy and like you could tell your voices.
And it's great.
I know that was like, yeah.
Wow.
And it was also, it's actually quite refreshing to organize your own conference.
Like, you know, we were like, okay, let's do all the things that we think a conference
should do and like try them out.
And it actually worked quite well.
Like, you know, only one track, for example, stuff like that.
No questions from the audience, much more social time, some, you know, really healthy food,
stuff like that.
So it was, it was, it was great.
Like my voice suffered a bit, but you know, we're giving a lot back to the community as
in the videos, photos, stuff.
So yeah.
Sounds great.
Awesome.
Congratulations.
A couple of episodes ago, Brian actually talked about FastAPI, not to be confused with fast
AI, which I talked about earlier.
So yeah, it's a great, very modern, cool Python library for FastAPIs.
And we're like, yeah, we've been big fans.
We've started switching all our APIs over.
The exciting news here is that their core developer, Sebastian Ramirez is actually going to join our
team here in Berlin.
This means like a lot of cool development for us, but also we obviously, since we love the
FastAPI project, we'll keep supporting that and we'll definitely give him enough time to
keep working on it.
That's great news.
We found him through the project.
We saw, oh, he's doing like some consulting work.
We're like, hey, we'd love to work with him.
And one thing came to another and now, yeah, he'd be part of our Explosion team, which is
still growing, by the way.
So we've been very lucky that we were able to work with more people and expand our team.
Yeah.
That's so cool that, yeah, that your business is growing.
And I guess it's worth pointing out that back on Talk Python To Me, we talked about Explosion
AI.
I interviewed you about building a software business.
So back on episode 202.
So, you know, this is just like more, more evidence that that's all good advice.
Thanks.
Yeah, super cool.
Well, great, great news.
I guess it's probably time for a joke here too.
A pie joke, if you will, maybe.
So I think this, I'll do the first one.
This one, I think came from pie jokes.
We'll see.
We're starting to run that well dry.
So people send in your jokes, please.
But a programmer walks into the bar and orders 1.38 root beers.
The bartender informs her that it's a root beer float.
She says, no, make it a double.
All right.
It's pretty bad type system.
Maybe it doesn't work so well in Python.
Like we don't care so much about types, but you know, still.
So it's all right.
I like it.
All right.
We got one more up here.
Who put this one in?
Brian?
Yeah.
So just last night I was researching for this podcast, writing notes for the other podcast,
and working on an open source project.
And I came up with this.
What do you call a developer without a side project?
What's that?
Well rested.
Yeah, that's true.
That's totally true.
It's almost a bit sad in that sense.
Yeah.
I know it's too real.
Too real.
I personally shouldn't be complaining.
That's right.
But you know, there are some comments we could make here about like, you know, the culture
and like what's expected of developers these days and how that's maybe not ideal.
You know, sleeping enough, stuff like that.
Oh, definitely.
People should be.
And I was, it's mostly a self-reflection.
No, I mean, it is a good joke.
I'm not, I wasn't criticizing your joke.
It's a totally fine joke.
I'm just saying it's also, it's very real.
You know how jokes can be like too real and then you're like, oh.
Yeah, I'm really uncomfortable now.
Exactly.
All right.
Well, I think that's a good place to leave it.
Brian, thank you as always.
Thank you.
It was great to have you here.
Thanks for coming.
Yeah, thanks.
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 Pythonbytes.fm.
If you have a news item you want featured, just visit Pythonbytes.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.