Python Bytes - #178 Build a PyPI package from a Jupyter notebook
Episode Date: April 22, 2020Topics covered in this episode: Pandas-Bokeh Stop naming your python modules “utils” From 1 to 10,000 test cases in under an hour: A beginner's guide to property-based testing Extras Joke Se...e the full show notes for this episode on the website at pythonbytes.fm/178
Transcript
Discussion (0)
Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.
This is episode 178, recorded April 15th, 2020. I am Brian Auchin.
I'm Michael Kennedy.
And this episode is brought to you by DigitalOcean. Who's first? I think I got my notes wrong.
Yeah. Well, I want to talk about something really quick before we actually get to the first one.
So we'll see.
Okay.
I just want to tell people about the YouTube channel and obviously if people are watching on youtube they might know
about the youtube channel but most people subscribe to our podcast and we are multicasting
and repurposing what we're doing here on youtube we talked a little bit about it last time so
basically each individual item is now a separate youtube video and you can watch brian and me talk
about it
if you want to consume in that format
and have a little bit of video
and admire Brian's awesome shirts
because he's got a bunch he's going to be wearing
throughout these different shows
and it's going to be awesome.
Oh, you didn't have to set it up like that, man.
I only have like one good shirt.
People loved the shirt for the first video we shared.
That was like several comments about,
dude, your shirt is awesome.
Yeah, go figure. Okay, so we're trying to teach you about python also but that's right
in fashion shirts in fashion yeah yeah it's a pythonbytes.fm slash youtube people could check
that out well tell me about strings python i mean michael i'll tell you about python strings you
know what strings are confusing man uh especially when they're about numbers and
dates especially dates so this seems to be like a problem that vexes me permanently and it's you
know we talked about is programming googling right like and our consensus was you know maybe in the
early stages of your career there's a lot of googling but no not really you mostly just sit down and you think about the problems and you write the code and you
evolve the code.
Like there's a lot of reading code before you actually do much writing anyway.
But this topic in particular, I'm all about Googling this all the time.
So Python has a datetime.strptime for string parse time. You give it some piece of text like Wednesday,
April 15th, comma 10 colon 30 a.m. without a space. I want to take that and turn it into a
date time so I can maybe compare it to something else, right? Like another time. How many days is
that from now? Is that in the future? Is in the past? I just need to store it in the database as
not a string, but a date time because I want to order it, and I don't want it to be alphabetical, right?
There's all sorts of reasons you need to get a date time from strings or go in the reverse.
And yet, the format, you know, that's strptime has a format string
that tells it how to look at the string and then pull the pieces out.
So, would you know about that
example I told you about? Like the Wednesday, April 15th, 1030 AM? That's definitely something
I Google every single time. Every time. And it's never quite right. So just for those of you
listening, you really want to know it's percent A space percent capital B space percent capital H
comma space percent capital M colon percent S AM. Who would ever come up with that?
Well, I mean, these are intentionally short.
Yes, I know.
So that like, they don't take up too much room, but they're, and they sort of make sense.
It's just, it's arbitrary, whether it's a capital Y or a lowercase Y or capital D or
lowercase D.
Right.
And there's documentation you can go find.
Like if you want the three letter date, day of the week, that's a percent A lowercase and whatnot.
But putting that all together can be tricky.
So what I want to tell you about is this website by Lachlan Eaglin.
And it's, let me see what the URL is.
It's pystereftime.com, which of course is linked in the show notes and the idea is you put the text you want to parse like wednesday
15 april 2020 at the time or whatever you put that in there and you hit go and it will tell
you that complex string that i told you was the right answer to my parsing problem yeah it's
awesome yeah you just put in like the the output that you want it to have happen and it tells you
the magical incantation right right or the the format of the thing you want to parse and depending
whether you're trying to go to that string or from that string but yeah super super handy this bad boy
is bookmarked for me for sure because this is way better than googling i can put it in there it gives
me a quick quick answer i can throw it into a python repl and see hey did it work or did it not work it's really easy yeah nice yeah so not super
complicated but very handy so people can bookmark that and try it out well i want to tell you about
something easier also i gotta gotta thank jack uh jack mckew has sent us a few suggestions and
they're usually pretty darn nice. And here's this one's
from Jack pandas dash bokeh bokeh. Oh, I forget how to say that. I love the logo pandas bokeh.
I say bokeh. I don't know, you know, but it's like that F stop difference where like the person
in a portrait is like crisp, but the background is faded. And the logo is pandas clear bokeh,
like in the background faded.
It's beautiful.
That's a pretty cool logo.
So I'm going to quote some from their website
or the readme.
It says,
Pandas Bokeh provides a bokeh plotting backend
for pandas, geopandas, and PySpark dataframes
similar to the already existing visualization features
of pandas.
Importing the library adds a complementary
plotting method plot underscore bokeh on data frames and series okay so that's i mean it's
already built in and all it provides is plot bokeh another function on it what's the big deal
well it's so cool it's so easy and i was i tried out some of these examples this morning, and it's just a little tiny bit of code.
And you call, like you've got a data frame,
and you call plot bokeh on it,
and it pops open like an interactive graph
that you can look at everything.
It's actually pretty incredible.
You have to do something a little different.
You plot bokeh.
But if you want the normal plotting to do the same awesome stuff that it's built in
you can set an option one of the pandas options to switch out the plotting back end so that's
neat so apparently what it's really doing is switching out the back end and to me i mean
plotting is not terribly difficult but this interface at least for me it makes it a lot easier instead of having
to work with frames and plots to just call this thing and then all the different options you can
have you can you know different point you don't want it to look like an asterisk instead of a
point or something all other different color different scale or different titles all that
stuff is uh options you can pass into the plot function and the other thing that i
that i like a few more things one of them is you just when your pip install pandas dash bokeh
it pulls everything in because it's all the rest of the stuff is dependent on it so you get all of
it just for a simple install and it also generates a generate it's able to do this uh interactively
but you can also generate with notebooks yeah this interactively, but you can also generate notebooks.
Yeah, you can generate notebooks
and you can also generate standalone HTML files with this in it.
This is really cool.
And yeah, the fact you can generate standalone HTML,
there's probably ways to plug it into Flask sites,
you know, Python websites and whatnot.
Pretty straightforward.
And the interactive bit is super nice.
I mean, this is not about Panda's interaction per se.
This is just Bokeh, right?
Being very cool and interactive.
But you can zoom, you can pan as you move around.
It'll show you the marks on the graph
and you can sort of hide and show elements.
And there's even a cool example
where they're showing the stock price of Apple
versus Google. And as you put the cursor along, it has the Apple logo next to Apple and the
information like a little like card that talks about it over time. Man, this is nice stuff.
And all you got to do is point it at a data frame. Not bad. Yeah. And they've got a whole
bunch of examples on there that get a repo with a bunch of working examples, too. Yeah, and they've got a whole bunch of examples on their GitHub repo with a bunch of working examples too.
Obviously, for the examples, the
data is just sort of random data that they've
thrown in there. But
once you know how to get your data, this does the
rest of the work for you. So it's cool.
Very cool. Yeah, it's a great one. Thank you, Jack, for
recommending it. And yeah, it's a good one, Brian, for
pulling it out. We've had DigitalOcean as a
sponsor for a while, and we really want to thank
them. They've really helped us out a lot and plus they're pretty darn cool.
So thank you DigitalOcean for sponsoring this episode and many others.
And in the past we've told you about a lot of awesome things with DigitalOcean
like their one-click install, Kubernetes cluster support,
their amazing new support center and help documentation that's been around for a while. And our podcast runs on DigitalOcean
and we're thrilled with it. And so if your business or your side project deserves
great hosting and growth that will grow with you and let you scale
affordably, I really definitely want you to swing by
pythonbytes.fm slash DigitalOcean to grab the $100
credit for new users. But there's something else
I want to tell you about digital ocean. That's really cool. They've got something they've started
recently that's called hub for good. And it's designed to support COVID-19 relief efforts where
digital ocean through this is supplying $100,000 in infrastructure credits for new not-for-profit projects.
They're also giving $50K to COVID-19 Relief Fund, their own relief fund, but still it's really cool.
And they're also trying to raise awareness for COVID-19 related projects
and provide learning for developers and also provide visibility for these projects.
And so I headed over there this morning and checked it out.
And there's a bunch of cool projects starting out that are related to COVID-19.
It's not just this sort of stuff, but it's things like there's even a platform to help
teachers interact with students during quarantine.
A lot of cool projects through this.
So thank you, DigitalOcean.
Yeah, this is a great
project and obviously their infrastructure is great and we love it but this is this is very
cool too i didn't know about this yeah it's pretty neat yeah so speaking of not knowing
you know it's i feel like i've been kind of exploring the cave of python which is large and
vast and i just come on like a whole nother area. I'm like, it opens up like, what is this?
How have I not known about this? And this is NBDev. Have you heard of NBDev? No. Yeah. Okay.
So let me tell you about it and I'll get your impressions later. So NBDev takes notebooks
and basically makes them on par with writing proper python packages and solves all these different problems it lets you
generate what's got to be some of the best documentation period for that library that is
sort of backed by a notebook so it lets you develop like full python packages and libraries
and notebooks where you can have all your code, your unit tests and your documentation
all in one place, but then you can take it and pip install, you can upload it to pip and make
it a pip installable library that people have no idea that it came from a notebook. Wow. Is that
crazy or what? That's awesome. I got to check that out. Yeah. Yeah. And you know, you think
about this idea of notebooks and to me, notebooks like burst on the scene in the 2010-ish era, maybe 2012, 2011, like that time frame.
But this project references this concept envisioned by Donald Knuth way back in 1983.
And it says notebooks finally made literate programming, this concept by Donald Knuth, a thing.
So, you know, the old is new again, but in a really cool way.
And to me, this seems like just such a massive upgrade to notebooks. So notebooks have a bunch of challenges in my view.
Like I can't use a proper editor with it. Like if I want to use PyCharm or VS code and all of its
navigation and it's cool, get blame and like history and just like all this stuff is just not
present. Right. Documentation. I think that actually it really works well there,
right? But it's, it doesn't tie the documentation of the notebook to like parts of functionality
that might be created by the notebook, which is cool. One of the biggest problems with notebooks,
it's a benefit, but it's a big problem is if you run a notebook, it stores the output
in the notebook. So if you had like a bokeh plot, or you had like a print of a
data frame, that is in there. And now it's part of it. So if I'm working on a project, and you're
working on the same project, and we both run the notebook at different times, or the same time,
but separately, and it for some reason generates different results, that's a merge conflict in git right so basically you cannot use notebooks in
like a sane way with git because anytime you work with it if you're not careful and like don't
remove all the output before you save it it's going to be a merge conflict so this project
has a git pre-commit hook that will remove that problem so right before it gets committed it'll automatically do the
cleaning of that metadata output so it'll never have that as a conflict it also has an ability
to like a cli go just accept it i just accept all the metadata changes mine are just right or
whatever right so it also has a cli to automatically fix that but if you do have those problems but it
also has this pre-commit hook to avoid them entirely.
Nice. That's a nice use for pre-commit too.
Yeah, it's super, super clever.
So if I write a function in the notebook,
I can put hash export in that cell
and that becomes a public function in the package.
Oh, cool.
Right?
So I write like documentation and pictures
and I would say hash export.
Now that's part of my library that I'm building.
It also lets you create the structure for Python packages.
So you have like the setup py
and you can do the build wheels and whatnot
automatically out of that.
And it uses this exported stuff.
You can have your unit tests in your notebook,
which is pretty cool for the things that are in there.
And then finally you can edit it.
You can take the edited library or the library that are in there. And then finally, you can edit it. You can take the edited library
or the library that exported, sorry,
and then edit it with PyCharm or VS Code
and then reverse export it.
So what you can do is like, say,
push the changes that I've done with my editor
back into the segments of the notebook
where that code came from.
Oh man, okay.
I'm a little confused, but I got to try it out.
Yeah, you got to kind of read through it to get the sense. But there's just a bunch of stuff.
Like all these things seem like, yes, you should have been able to do that with notebooks. But
obviously, right, that's not their origins, right? They can't do everything at once. But all of these
things seem awesome to me. Yeah. Yeah. So in order to get started, it's going to basically create a
Git repo for you, is my understanding, either on GitHub or GitLab. So you got to follow the
getting started instructions, and then you click a button button and it'll like generate the repo in the
right structure. Or you can use the CLI tooling to generate like the right repo with things like
the Git commit prehooks and whatnot. And if you're going to read the docs, check out nbdev.fast.ai
because this comes from fast AI people, the same one as the build the fast api
framework so some of the docs render better there's certain things on github that like
it says and here's a cool picture and it's just like source code it's not quite right so
so maybe check out the the final link at the bottom in this section to get to if you're going
to like browse through it but it's basically uh you get the same
thing out of github anyway this to me seems like a massive improvement for notebooks uh and sort of
brings them more into i can do things like for example you can now have your notebook and its
tests running as part of continuous integration like so these notebooks are now like full
participants in cic, CD.
You can create packages and put them on PyPI.
There's all sorts of neat stuff.
If you have a cool graph as part of your notebook,
that can become the documentation on PyPI
or read the docs for those functions.
I mean, it's crazy cool how this is taking
some of the awesome parts
of notebooks,
like the dock side
and turn that into the help docs
and then also letting you
export the functionality
still as a proper CS type thing.
Yeah.
I definitely got to check this out.
How did I not even know this existed?
Like, this is awesome.
Well, I don't know how long,
I mean, it looks like
it looks like five months
to me is my guess.
Okay, so we're not that behind.
No, we're not that behind.
Yeah. But this looks neat. Yeah, it's neat yeah it's very fast ai is pretty cool so i think this is probably pretty solid yeah i agree it's definitely got some solid uh people behind it so very cool very cool
anyway in b dev quite neat i want to talk about something a little not neat a little light-hearted
so this is a sort of a serious topic but this is an article from Sebastian entitled,
Stop Naming Your Python Modules, Utils.
And I don't know if we've covered it before,
but it's good advice and it's something that happens.
Basically, a lot of projects, public or private,
will at some point end up having a utils.py
or a utils package or something. And
this article is just saying, resist the urge. Utils is arguably one of the worst names for
modules because it's very blurry and imprecise. Some of the names did not say what such a name
does not say what the purpose of the code inside is. And on the contrary, a utils module can, well, contain almost anything.
By naming a module utils,
software developer lays down perfect conditions
for an incohesive or uncohesive whatever code blob.
And I have definitely seen this in action.
I have been one of the culprits before
of having a pulling out a little helper function
that I had in one file, and I wanted to use it in a different module. So I didn't know where to put
it. So I stuck it in a utils.py, added a couple more. So there's just a few methods. And I come
back six months later, and there's like a couple dozen just junk drawer functions from all over the place in
there. So if you start, people will add junk to it. So Sebastian lists a few excuses. It's just
one function, but it grows. There's no other place in the code to put it. Well, try harder.
And I need a place for company comments. I don't even really know what that means, but
name it company or something. And also Django does it. i don't know if you're a well maybe they shouldn't have
but they have it now so they're not going to change it so the advice is to try name try grouping your
utility functions and naming them based on the role of how you're going to use it, or possibly group them in themes.
And also, if you see a utils.py crop up in a code review,
just request that the person rename it to something else, if possible.
Just set up a CI rule to break the build if you see that file name.
Yeah, so what are your thoughts on this, on utils?
I agree with Sebastian, absolutely.
I understand the challenge, because naming things in software is hard but naming things in software is super important
because you know when you you think about like even just like function names or class names or
whatever right usually what will happen is you'll get like a crummy vague name and then a comment
describing what they are
doing and you're like well why don't you just make the name a little bit longer that says what it
does and utils is kind of like the generic catch-all of saying like well i couldn't come up
with a name so here it is we're just going to drop it here and in my code i have like tons of different
areas of which i organize it you know sort of like sub modules i
i guess if it's a or sub packages if it's a package but not sometimes it's not a technically
a package and i try to come up with names that are meaningful right like i have something called
number converter that will like try to parse an integer or return a default value instead of
throwing an exception or it'll try to parse some other thing or maybe it's called conversions.py or whatever but it's not like utils right like there's there's usually
some kind of uh better structure you can find that will help you do this but you know there's
that joke that uh you know naming things in computer science that's one of the hardest
problems right and i i do agree with that but yeah it's it's worth the effort when you get it
figured out if you don't believe me you can just try it sometime if you're working on group project
just put one function in utils and you will see it grow um and you'll have to it's like the broken
window theory of software yeah and misc doesn't count either if you name it misc it's just as bad
that's right yeah there's probably some synonyms here in
the code world that uh that don't count so yeah awesome i want to tell you about this one next
that helps with performance or understanding the performance more specifically of your code so i
don't know if you how much profiling you guys do your work how much does performance matter to you
guys it matters a lot yeah yeah yeah i'm building
things that go into um testing in a production line so every millisecond that it takes takes
a millisecond longer to get something shipped so yes matters yeah it matters i'm supposed to
mostly spend my time on the web and obviously it matters there right like every hundred milliseconds
i think amazon measured
is like one percent loss of orders or something ridiculous like that right like so yes understanding
your performance is good we've had good good in quotes profilers for python and they typically
tell you about this function spent this much time but another challenge is my program is using too much memory
or worse, it's something long running
like a web app or some background process
and it's like growing.
It's like sort of leaking memory.
Why is that?
So I came across this project called Scaling,
which is a high performance
and high precision CPU
and memory profiler for Python.
Cool.
Yeah.
So it lets you either analyze CPU time
or it actually lets you, on a line-by-line basis,
say, here's some memory.
What line made this?
And where is it coming from?
Yeah.
And so that's cool.
But one of the challenges for profiling
is when you're profiling your code,
you can make it, you don't get the same behavior.
It's sort of like the Heisenberg uncertainty principle, right?
It does one thing, but when you measure with a profiler, you've changed it.
So now you kind of got to say, well, that part where it was the network, that was 50%,
but now you made the computational bits way slower.
So that network part looks just like 20,
right? Like you're affecting it. So for example, if you use profile, the built-in profile,
it can make your code 30 times faster or a simple scenario than running it normally.
But you can use C profile, which is the C based one that's built in. It only slows it down by 1.65
times. So that's not too bad. There's a line profiler that's 11 times slower
and there's a whole bunch of other ones there's a memory profiler that's like over a thousand times
slower so the scaling thing has a nice comparison to all these things it says well how does scaling
do and it claims that it's got this built-in library that's much faster. So for CPU stuff, it's 1.04 times the speed.
So like 4% slower.
And it does that through sampling, right?
It doesn't do instrumentation.
It doesn't rewrite the stuff.
It actually just asks frequently like, hey, where are you in the code?
But it still gets per line analysis to that, which is pretty cool.
And then the memory one is like another 10 slower because analyzing memory is hard but
yeah there's all sorts of cool stuff you can do with it the overhead is not too bad the precision
is pretty good so like i said it gives you like line by line level of how much time you're spending
in various places it also is interesting in that it separates out the time spent running python
code from native code including like the base libraries and stuff so you can say like i can only affect the python stuff the other
stuff is not a thing i can deal with so yeah don't tell me about it or punish me for it or
maybe i do want to look at it right tell me about that so that's pretty cool and then also the
memory stuff i think is pretty cool so it says it
points to specific lines of code responsible for memory growth and it's important it does this
through a special memory allocator thing that comes with it and so while you can pip install
scalene you can't inspect the memory allocation that way you have to go and install it directly
and do some more setup.
On macOS, you can do brew install.
There's instructions in there on how to do that.
On other OSs, I have no idea what you do.
But you can't run the memory allocation directly.
You can't just say pip install it and then do the memory allocated.
There's some other lower subsystem
that has to get installed for that to work.
Yeah, and memory is an interesting one
because it's a difficult one to chase down with Python.
Yeah, it's very hard in Python
because everything is a pointer.
Everything is an indirection.
It's not like,
well, here's the block
where we allocated this object
or whatever, right?
Like, it's pretty indirect.
And you don't typically
have a hold of pointers
in the, like,
memory address sense of it
like you do in C
or something right
so it's yeah
it's challenging
I would love to see
this integrated into
PyCharm and VS Code
oh yeah
right right now
it just gives you
it gives you
like a cool tabular
text output
or file output
but if you could just
right click in PyCharm
and say
analyze with scalene
that'd be sweet
yeah I wonder
and also
that would solve
some of the install thing so if you have you have to install it separately yeah something integration with
pycharm vs code would be cool right like right now you can do profiling and it's really awesome
in pycharm but i'm pretty sure it uses c profile so yeah who knows someday yeah hey while we're
talking about editors i don't know about vs code but i do know backing up Code, but I do know, backing up a little bit, I do know that PyCharm does open notebooks okay. So. Awesome. Yeah. Anyway. Yeah, yeah, nice. I want to tell you a little
bit about testing. Awesome. I'm really surprised that you're covering this, but okay, yeah, go ahead.
Yeah, it's interesting. Lately, you've been covering the testing articles. I know. Isn't
that my role now? No, go ahead. This is great. Tell us about it.
Yeah.
This is a person named Carolyn that wrote an article called
From 1 to 10,000 Test Cases
in Under an Hour,
A Beginner's Guide to Proper...
That's productive.
And imagine if Carolyn was getting paid
by the test, right?
Like, we're evaluating your bonus for the year.
Like, I wrote five times as many tests
as anyone else,
and I just started this month.
Heck yeah.
I would totally use, if I was paid by the test case,
I would definitely use Hypothesis on every project.
So how did she do this?
What is this property-based testing?
Okay.
So hopefully people have heard of property-based testing,
but it is, so the, it's as opposed to like,
what do we call it example based testing.
So and this is kind of how she goes through this discussion.
It's it's the article is really just a really excellent introduction to property based testing and using hypothesis.
And it's I same sort of strategy
with every every other type of property-based testing library she just happens to be using
hypothesis and python so that's nice but the she starts off with a unit test example of um just
doing she has like a string sort or a not a string sort but a list sorting thing and um if you were doing example-based
testing you just pick a few example tests example test cases where you would take the input and you
know what the sorted output should look like and you you know run it through the function and make
sure the output assert that it's equal or equal to the expected one how would you do this with
property-based testing? And before she goes
in, and she does give an example of how to write some sort of test like that in property-based
testing, but she stops and pauses and talks about kind of the different mindset. You can't test
against an exact example because you don't know what example is coming in. So you have to think
about property. So like on a list sort sort thing you don't have the exact answer
but you could check to make sure that the link or it should be the same and that you can use sets on
both the input and output to make sure that the contents of the both are identical then you can
go through the answer and make sure that element wise every element i is less than or equal to i
plus one you know there's ways to to test sort without
you know without just knowing the answer but it takes a mind shift a little bit and i think
actually that's one of the benefits of property-based testing is thinking in terms of that
also i also think it's nice that she talks about how this isn't a replacement for example-based testing. It is a complement to it.
And so you can mix them together.
Then she goes on to introduce some of the aspects of hypothesis,
like there's some cool strategies,
like some lists and some integers,
and being able to set the max examples
so you can set how many,
and that's where you can just set it to 10,000
and wham, you have 10,000 test cases right away.
And just let hypothesis come up with the examples.
The real meat of the article,
which I really appreciate,
is just the hard part of property-based testing
isn't the, some of it's the syntax,
and she does cover the syntax of how to get this done,
but it's also just how to think about the properties.
Coming up with what properties to test for is the hard part.
And so taking a little time to talk about that, I think this is a great thing.
I'm also glad she threw in that one of the things you should check for with property-based testing is making sure exceptions that get raised are expected exceptions.
So if you throw garbage in or different cases that don't make sense,
you should know what kind of exceptions are going to come out
and that this can be caught with your tests with hypothesis.
And then also a great use for all of this is to implement whatever functionality you wanted
in a very simplistic but possibly slow or memory
hoggy way or something and then you can compare the elegant version and the slow version within
the tests to make sure that they come up with the same answer this is also great if you're doing a
refactoring you can refactor part of your system and make sure that the old and new way act the
same so it's just a good introduction to all of this.
Yeah, and property-based testing is,
it's, you're right, it's such a mind shift.
And it's, I don't know, I haven't fully embraced it yet,
but I feel like there's probably some places
where it would really be interesting and useful.
And I probably should just look into it.
You know, I don't know, I get stuck in my ways
and then I just, I keep going that way.
At the end, she talks about if you're not using python what options you have as well which is kind of cool right so just like he hypothesis is cool in python but if you're on typescript we
got fast check we're on dot net they don't have dashes or a's or t's so there's fs check and in
java there's this and c++ and rust and so on so yeah if it looks like you could use
the same thinking and ideas across different parts of your stack if you're having different
technologies in there this is another example of uh if it shows up in every language it's probably
something you should be paying attention to so that's a really that's a good uh rule of thumb
it's like yeah if i see it all over the place right this is a general cs sort of so that's a really that's a good uh rule of thumb it's like yeah if i see it all over
the place right this is a general cs sort of thing that's important yeah yeah uh you know what else i
like about going through stuff like this is you come across things that you didn't know about
right for example you'd think that i would know about json it seems pretty simple like the
javascript object notation but apparently there's like a json 5 as well which allows things like
comments and whatnot and multi-line strings and single quotes and elements that are not quoted
for the keys and so on and there's a whole cool library for json 5 support as if you want to have
like a little bit more human friendly json i had no idea that was a thing. Yeah, neither did I.
And I was just like, why can't I put a comment in JSON? This is driving me crazy. So what I do is I
have like a field that says comment or like double slash in quotes. And then I have the string that
is the comment because you can't actually have comments, but you can have ignored keys and values.
So that's how I have comments in my JSON. But anyway, she talks about using the JSON 5 library
that's part of Python to support that.
It's not built in, but it's a Python library.
You can use it to do that.
Pretty cool.
Yeah, nice.
Cool.
Yeah, well, I guess that's it for all of our items, huh, Brian?
Yeah, it is.
Got anything extra for us?
Yeah, I totally did.
But you nabbed it and put it in your section, so go for it.
You found a bunch of cool things here.
Yeah, I want to get this one out of the way first. Some sad news um have you you've heard of game of life right yes yeah conway's game of
life yeah conway's game of life well conway john conway is um i'm going to link to an article
that's a nice a nice article talking about the game of life and john conway but um just an
announcement that he is one of the victims of COVID-19, died from
it recently.
So that's sad.
Yeah, it's definitely sad news.
Game of Life is a kind of an excellent thing to have in the computer science realm.
Pretty neat.
So that's sad.
Something that's happy is GitHub is now free for all teams and individuals.
So that's a pretty cool announcement.
That's really awesome.
Yeah. for all teams and individuals. So that's a pretty cool announcement. That's really awesome, yeah.
So previously you had to pay to have collaborators on a private repo.
I think maybe you could have some,
but not a ton for private.
I can't remember.
Three, I think, like that.
Yeah, it's like evolving.
First you had to pay for private repos,
then you didn't,
but then you had to pay for collaborators.
Yeah, but that's awesome.
So it's much more free.
And then also for people who still
pay github like me it's half price it's 40 it's i don't know whatever four divided by nine is
it's now 44 of what you're paying before and people wonder like why would you pay for github
organizations if you have an organization so like talk python and the related training
authors and content there's like a GitHub organization for talk Python,
have people collaborate on that.
You still have to pay,
but it was $9 a month per user.
Now it's $4 a month per user.
So that's also bonus.
Yeah.
Yeah.
Pretty cool.
Yeah.
That's happy.
Yeah.
So the last thing I wanted to bring up is that the PyCon US 2020 online is now live.
So there's a welcome video and more. There's some talks linked and there's more on the way. Yeah, there's a nice welcome
video from Emily Morehouse that she basically kicks off the virtual conference in this conference.
I don't know if that's the right word for it. This thing, this event is not like a lot of online virtual conferences like on saturday we're all
going to meet and then the talks are going to be these three hours and whatnot it's like it's like
a rolling release of information and videos that then you get to consume over the next couple weeks
so yeah you're linking to basically the the landing page for like stuff as it happens right
yeah and i recommend so also recommend checking
out the um so if you go to any of the like the welcome video and then go up and find the um
the pycon us 2020 top page and look at the videos there then you can see them all listed as well
um but they're they're rolling out there's and i know that they're not all recorded, so some will come later.
For instance, I don't know if I will, but I'm still planning on recording my talk and posting it, just trying to figure out when to do that.
Yeah, cool.
I'm definitely looking forward to checking it out and see what comes along.
Also, it's worth mentioning that at that link, there's a place that has like the virtual expo and the expo hall is actually my
favorite part of the conference is because you get to walk around and meet
people and just,
you know,
see what's going on and you see all the companies and what they're doing.
But one of the things that happens there on Sunday in normal times is there's
the like hiring job fair thing and all the job fair stuff is already up there.
So if people are looking for a Python job,
there's many, many links of,
this company's hiring for these four positions.
Click here.
This company's hiring for this position.
So if you're looking for a job,
you want to get in there quick
and grab the good ones and apply to them.
Yeah, one of the things that's missing
is how am I going to last an entire year with no new t-shirts
i know well you're gonna have to be up in your game there in this video version here i know i
love all my own conference swag yeah exactly like how do you even do that how do you even find a
good tech shirt like that you buy i know they're out there but it'll be different well you want to know something that
wasn't funny is i almost forgot to put a joke in our show notes here oh no so i pulled up the
terminal and i typed pie joke because i have pipx installed pie joke so it's it's right there in the
command line anytime you need a laugh and this one is about qa software quality folks and uh it's a
take on a traditional one.
So here,
I'll hit you with this.
See what you think.
How many QAs does it take to change a light bulb?
I don't know.
They noticed the room was dark.
They don't fix problems.
They find them.
Oh dear.
That's bad,
right?
Yeah.
That's definitely why QA and development should be one team.
Absolutely.
Yeah.
All right.
Well,
a good joke.
Nonetheless, a good joke. Thanks. Well, a good joke nonetheless.
A good pie joke.
Thanks.
Well, this was lovely today.
So thanks for talking with me.
Yeah, absolutely.
Thanks as always.
Great to chat with you.
See you later.
Bye.
Thank you for listening to Python Bytes.
Follow the show on Twitter 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. This is Brian Ocken and on behalf of myself and Michael Kennedy,
thank you for listening and sharing this podcast with your friends and colleagues.