This is Python Bytes, Python news and headlines delivered directly to your earbuds.
This is February 21st, 2017.
I'm Michael Kennedy here with my co-host, Brian Okken.
Hey, Brian, how's it going, man?
Going great.
We have some really cool stuff to talk about.
As usual, the Python ecosystem is bursting with good things to discuss.
Yeah, it definitely is.
So let's start with like a little reference book that we can use to stay on top of Python
and specifically modern Python, Python 3.
Yeah, so Matt Harrison has self-published quite a few books already.
And this one, I assume he self-published this one, but it's a tiny Python 3.6 notebook.
And he released it on GitHub and he also has a physical copy for sale on Amazon.
Anyway, I guess I'll just quote his introduction.
He said, this is not so much as an instructional manual, but rather notes, tables and examples
for Python syntax.
And I think it's pretty awesome.
It's like all of the syntax and everything boiled down into just the facts, ma'am, sort of thing.
It's like the pocket Python reference that you need, right?
Yeah.
And I like it even online, but it's one big long file.
I think he's got it priced at less than 10 bucks.
So I'm going to give it a shot and try the physical copy because I think that might be kind of a nice thing to have around.
Yeah, yeah.
Do you know if there's an e-book version?
Yeah, I think there is an e-book version.
Sweet, sweet, sweet.
My whole library loves on my Kindle.
If it's not on my Kindle, I don't know about it.
I love physical books, but I've done so much traveling for work that I just, I'm like, I can't take three books on this trip.
I'm just going to put them on my Kindle, you know?
So very cool.
And I know he does a lot of training and he said that he wrote this partly as something to give away when he does training.
And I think that's kind of a nice thing to hand people if you're going to do training is something like this.
Yeah, absolutely.
It's a perfect follow on to a training course or online course or something.
Okay, cool.
So the next one is by a friend of the show, Anthony Shaw.
And the title is, Oh no, this package is only Python 2.
It only supports Python 2.
The idea is like if you're like plowing through a project, doing some Python work,
and you hit a package that's not supported because it's only Python 2,
he wrote up a nice little guide of like how to solve that problem and maybe solve it for the world and not just for yourself.
So he has like a 7.5 step guide here.
So first of all, check that nobody else has solved it.
An example of this might be if you go to say suds and check out the suds package,
which is like a soap client for Python.
It's only Python 2 is updated five years ago.
You could be like, Oh no, this doesn't work.
Well, there's another one someone else forked and created called suds dash jerko.
And that one is the Python 2 and 3 version.
So be sure to look around and like don't go through this effort if someone else is like a non, not very popular, but solved version.
So then he says, all right, what you're going to do is you're going to fork it first, like go and see if there's print statements that are statements and not functions.
Fix that, right?
Write some tests.
Hopefully tests exist.
But if they don't write some tests because, you know, just the fact that it runs isn't really good enough.
And it has some cool package dimensions called modernize.
Do you know this package, Brian?
I haven't used it, but I've heard of it.
Yeah.
This is not like modernizer from JavaScript.
This is something from Python to aid with the conversion.
So, yeah, it's very cool.
I haven't used it much myself either, but I'm going to check it out.
So thanks, Anthony, for pointing that one out.
He says, all right, update the setup UI to describe your new dependencies and stuff.
Install into your original project.
Raise a pull request.
And then sadly he says, okay, well, what happens when three months later your pull request is ignored?
How do you go about dealing with this?
And it turns out as a result of this article, the package that he wrote this article because this happened to him.
He's like, all right, I need this package.
And, oh, no, it's not supported on Python 3.
So he went through this and actually did the PR.
And he said, after he wrote this article, the author or maintainer of that package came along and quickly accepted the PR.
And now that thing is Python 3.
Okay.
So does he have any recommendations for what happens if nothing happens?
If nothing happens, he says, after a while, you know, you probably should do what the guy, the Jerko guy, that's his first name,
Jerko did with Suds is go and modify the setup PY, create a different package name, and just submit it to PyPI as like an alternate version or something.
If no one's going to fix the old one and he can't get control over it.
Yeah.
Interesting.
Yeah.
It's worth pointing out that the PyPI, the packaging authority group, they actually just, I think we maybe even discussed this on the show earlier in other episodes,
is that they came up with a way to like deal with this.
Like Suds is five years old.
It only supports, it's not been edited in five years.
Like surely that should be replaced by a modern version of it if there is one, right?
So that's cool.
Yeah.
I think we talked about it last time, right?
Yeah.
And it should be, and I'm glad they're taking that on because there should be a way to say, hey, I'm willing to be the new maintainer if nobody else wants this.
Absolutely.
Nice article.
And I like that this was discussed because that happens, I think that happens at least fairly regularly.
Well, and instead of just throwing up your hands, if a few people go through these steps on the popular packages, right, that solves it for the world.
It doesn't just, it solves it for the whole community.
It doesn't just solve it for your project.
So that's great.
Yeah, definitely.
And I think that maybe modernize might be a topic for some other week.
Yeah, absolutely.
Next, we've got another, I guess, another book-like thing.
It's not really a book, but there's somebody named Andrew Montalenti.
Why do I try to pronounce names?
Anyway, it's an article called Elements of Python Style.
And, of course, playing on the elements of, is it just elements of style?
Anyway, from writing.
But anyway, it takes, it's supposed to be more than PEP 8.
And it's an opinionated little fairly small style guide still.
It's not very huge.
Talking about basically some common, a good way to style.
I just like the format of it.
And I think that I was going to take this article, and it's on GitHub.
I was going to take it and fork it and try to make something for my own team.
Oh, yeah, that's cool.
I think these things are great.
And it certainly, certainly having a consistent style helps, like you say, for example, on your team.
And if you are, a lot of people listen to the show, they're looking for jobs, getting into programming, getting into Python, like study this kind of stuff, right?
If you show up for like an interview and they ask you to write some code and you write it JavaScript style, or you write C++ style, and you claim to know Python, they're going to look at you sideways and go, hmm, not so sure about that, you know?
Yeah.
So knowing these things is like the first step to fitting in, I guess.
You have one course on Pythonic stuff.
So what did you think of all of these recommendations here?
I think these were really good.
I didn't totally study every single one of them, but looking through it, it looked really good.
Like, for example, one of the pieces of guidance I really like says you can choose camel case.
So capital first letter, capital letters of every word for things that are not quite class-like, right?
So if you have a class, PEP 8 says that should be camel case.
But you also have other things like what about named tuples?
How should a named tuple be?
I mean, it's effectively a class that has no functions, just data.
But, you know, it seems like that.
So guidance like that, like he says, the main benefit of camel case is calling attention to something that's a global noun rather than a local label or a verb.
And like, for example, Python uses true, false, and none as camel case, even though they're not classes.
So, yeah, I think this is great.
I enjoyed the article.
Okay.
My next item for you is just a cool bit of trivia.
And I want to say thank you to Christian Klaus for sending this my way.
And I found, I was looking through Reddit for things for this episode and came across somebody had posted a tweet of mine,
which that's never happened to me before, that a tweet has been actually a topic on Reddit.
And one of this popularity, it had 537 upvotes and 71 comments on my tweet.
Anyway, why was that cool?
Why is that interesting?
It has nothing to do with me because I just carried the message from Klaus, basically.
And he says, Python 3, which was originally called Python 3000, right?
That's, it's actually from Pep 3000 is the original working title that it got.
And it was released December 3rd, 2008.
So last Sunday, February 19th, it was exactly 3000 days old.
Oh, cool.
Isn't that nice?
So we've come a long ways with Python 3.
And, you know, some people kind of treat it like it's new.
It's not new.
No, definitely not.
Definitely not.
But I think it's really cool that we just passed the day where Python 3000 is 3000 days old.
Actually, that's worthwhile trivia.
I like it.
Yeah, thanks.
So another thing that I really like is these resources or like sites that bring all these different information together.
Because I have people that ask me all the time, hey, Michael, I want to get started in programming.
What are the steps I should take?
Or I've gotten this far in Python.
What should I study next?
Should I go into databases?
Should I go into data science?
What else should I do, right?
Yeah.
So there's a couple of guys that are putting together.
Actually, they're putting together some interesting topics lately.
Bob Belderboss and Julian Sequeria.
I should have you do the names.
These are pretty interesting guys that have actually talked to us, sent out feedback to us about the show and other things.
But they put together a post called that it's Python Resources.
And it's called Python Books, videos and resources from beginner to pro.
We're going to link a Reddit thread that they put up and also the link to their post.
But it's actually, it's not huge.
That's one of the things I like about it.
It's not really big list.
But it's one of the things that does definitely has is it has some nice podcasts listed in the other resources.
Yeah, of course.
Of course.
It has like a nice getting started section.
It has a now that you've done fundamentals, how do you get better?
Additional resources, all sorts of stuff.
So a lot of different ways, you know, it's got like a Hitchhiker's Guide to Python, Fluent Python, Effective Python, a lot of stuff that I've covered on my podcast, which is really great.
Some online courses and thank you.
They've included mine in there, which is really cool.
But yeah, a bunch of stuff in here that you can check out.
Full Stack Python, which of course is excellent.
Their website is P-Y-B-I-T dot E-S, which is fairly clever and fairly similar to the name of our podcast.
It is quite similar.
It's not the same, but it is quite similar.
PyBytes.
And yeah, these guys, at least Bob is in Spain, I think.
So the E-S makes a lot of sense there.
That's very cool.
All right.
My last one is a Python tool that I think a lot of people will find very useful.
So it's called Mongo Audit and it's written in Python and it has like even a nice little GUI to it, which is pretty cool.
So it describes itself as a CLI or command line interface tool for auditing MongoDB servers,
using poor security settings and performing automatic or automated penetration testing.
So you can just pip install Mongo Audit and then run it against your Mongo servers.
All databases, you want them to be secure, right?
Like if a database is just accessible on the internet with no login, that's bad, right?
Yeah.
Especially if you have private stuff in it.
So I love MongoDB.
I'm on the MongoDB masters group and I've worked with MongoDB for a long, long time.
There's a couple of choices that MongoDB has made in the early days that have kind of harmed it in terms of getting it in the headlines in ways in which it shouldn't be.
And a couple of those are by default runs without authentication.
Of course, you can set a username and password, but if you don't take that action because you don't know better, well, then if it's listening on the open internet, that's really, really bad.
And so there's a number of things like make sure you run with SSL enabled, make sure you run with the authentication and so on and so on.
So this tool basically go and run all those tests against a set of MongoDB servers, right?
And it checks that it's running like see on a non-default port.
It only accepts connections from certain hosts and so on.
So this is really, really cool.
This is very cool.
And I'm putting together a tutorial with using Mongo and I'm not, haven't taken any classes in it and I don't know how to do any of this stuff.
So I'm glad that there's a tool like this so they can point out what problems I've had with my setup and maybe I can pick your brains as to what I wish to do next.
Yeah, yeah, absolutely.
I would say like at a minimum, you know, run this tool and it has a lot of great recommendations.
But certainly at a minimum, if you're, you know, make sure you're at least only listening on local loopback.
So 127.0.0.1 or you have SSL enabled and authentication enabled, right?
Like those are the two big ones, but this tool will catch like that and lots and lots more.
So if you're somehow in charge of MongoDB things, pip install Mongo audit and have a run at it.
Very cool.
Yeah, very cool.
All right.
That's it for the news this week.
Brian, anything else you want to share with everyone?
How's the book coming along?
You know, it's very exciting.
I've got, I think we're going to do total of, I can't remember, seven or eight chapters.
And I've got five that are, I've already gone through a second phase editing and getting at with, we're playing with book titles and playing with covers now.
So hopefully not too much longer before we can make an announcement.
How awesome.
And who's the publisher?
Pragmatic.
Awesome.
Do they do things like have special covers?
Do they have like characters on the covers or anything?
There are different pictures, of course, for every book, but they're, we're working with, I'm trying to convince them to not do another snake cover just because it's Python.
Absolutely.
No more snakes.
We can do more.
It's not even as, what's so funny is like, it's not even a snake as the origin, right?
It's Monty Python.
I was thinking maybe a large tree, but that might not go over well.
What about the rabbit?
You know, the rabbit with the grenades?
Oh yeah.
That'd be funny.
The killer rabbit.
Killer rabbit.
Maybe it won't sell too many tech books.
I think it'd be funny.
Well, you have some, you have some news, Michael.
I do.
Just this morning, I released my latest course at bit.ly.
So bit.ly slash Python dash rest dash course.
So I created a course that is consuming HTTP and restful services.
JSON, XML, SOAP, binary data, screen scraping, all that kind of stuff.
So if that's interesting to you, check out this course.
And the next one I'm working on is the anti-matter version of this course, creating
services so that other people can consume them.
Oh, nice.
Yeah.
So I'm kind of on a services trip these last few weeks.
Cool.
Yeah.
All right.
Well, thanks for getting together today, Brian, and talking about all the stuff.
Yeah.
Thank you.
Very interesting stuff.
I love all the books and the references and the guidance.
Yeah.
All right.
Catch you later.
Bye everyone.
Bye.
Thank you for listening to Python Bytes.
Follow the show on Twitter via at Python Bytes.
That's Python Bytes as in B-Y-T-E-S.
And get the full show notes at 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.