Hey everyone,
Happy Saturday! I haven't done a "Fun with Python" post in a little while, so I wanted to share a small, fun project I put together: a script that shows you what happened on this day in history, right in your terminal.
The idea was to create a simple script that fetches historical events for the current date and displays them in a clean, readable format. It's a fun little project that involves interacting with a web API, parsing JSON, and presenting dataβall common and useful Python tasks.
The script uses the requests
library to fetch data from the "On This Day" public API and the rich
library to make the terminal output look great. As with all my tools, it's set up to be run easily with uv run
, so you don't have to worry about managing a virtual environment manually.
It grabs the current date, then makes separate API calls to get the top five historical events, births, and deaths for that day.
After a few tweaks, the final output is a nicely formatted summary that's easy to read at a glance.
Itβs a simple but satisfying project, and a great example of how you can use Python to pull interesting information from the web and create your own custom command-line tools.
You can find the complete, updated script in the Gist below if you'd like to try it out yourself.
As always,
Michael Garcia a.k.a. TheCrazyGM
I love these little "project builder" scripts - speaking of we might need a reorg on project builder to add sections, one of these days π
!PAKX
!PIMP
!PIZZA
View or trade
PAKX
tokens.Use !PAKX command if you hold enough balance to call for a @pakx vote on worthy posts! More details available on PAKX Blog.
Very cool tool, my friend. I love the idea of custom command-line tools. I make simpler tools using Bash scripts and aliases, which I've certainly found very useful. π π π β¨ π€
$PIZZA slices delivered:
@ecoinstant(2/20) tipped @thecrazygm
Come get MOONed!