Day 3 — Made some feta, and itslit!12 August 2020 · recurse-center Tweet
Today I used a countdown timer to timebox my coding sessions which really helped with focus. I did this during Hack and Tell where everybody says what they're going to work on, hack on that for 2 hours, and finally tell what they worked on at the end of the session. I felt that it was a good opportunity to start working on a Python project manager that I've been wanting to build for automating some common maintenance tasks.
feta. I started building it with Click (which is a pleasure to work with!) and added two commands,
find tells you if the project name is available on the Python Package Index and Read The Docs, because:
The first—and possibly the hardest—step is to come up with a good name for your package. All packages on PyPI need to have unique names. With more than 150,000 packages already on PyPI, chances are that your favorite name is already taken. — Real Python
Choose a memorable and unique name for your package. — PyPA
new command can help you scaffold an empty Python project. Cookiecutter can also be used to do this. But since I wanted to add auto-completion prompts for some fields using prompt-toolkit, I ended up reinventing the wheel. I think I should also add support to use existing Cookiecutter templates.
I'm also using this project as an excuse to learn about the process of building Python wheels. I'm planning to add a
build command which exposes the API described in PEP 517, so that I can specify
feta as a build backend in a
I had less time during the second Hack and Tell session (because timezones suck and I had to eat!), so I decided to build a CLI tool that opens up a random lightning talk from a random conference every time you run it. It's called
I really enjoy lightning talks and it seemed like a good idea to watch a random one when I sit down to eat, instead of watching The Office reruns! I still remember how much fun I had during this lightning talk at PyCon AU last year :) You should totally check it out.
The first step was to get rich data about conference talks. PyVideo made this really easy (thank you!) because they maintain such a catalogue for Python conferences with each lightning talk tagged as, you guessed it, "lightning talk"!
$ git clone email@example.com:pyvideo/data pyvideo-data $ cd pyvideo-data
After that, I wrote some Python to get all the lightning talk URLs out, and saved them in a file. There are 530 of them!
from pathlib import Path lightning_talks =  for path in Path(".").rglob("*.json"): with open(path, "r") as f: talk = json.load(f) tags = talk.get("tags", "") if "lightning" in "".join(tags).lower(): lightning_talks.append(talk["videos"]["url"]) with open("lightning_talks", "w") as f: f.write("\n".join(lightning_talks))
It was smooth sailing after this. Andrew suggested that I could add talks from other conferences too. I'll probably do this at another Hack and Tell. And maybe add a CLI option using which you can open a lightning talk from a specific language's (go / python / rust) conference. For now, you can install it using:
$ pip install itslit
And then run it using:
This will open a random lightning talk in an existing browser window. Here's the code.