Data analysis with SQLite and Python for PyCon 2023
20th April 2023
I’m at PyCon 2023 in Salt Lake City this week.
Yesterday afternoon I presented a three hour tutorial on Data Analysis with SQLite and Python. I think it went well!
Update: The 2hr45m video of the tutorial is now available on YouTube.
I covered basics of using SQLite in Python through the sqlite3 module in the standard library, and then expanded that to demonstrate sqlite-utils, Datasette and even spent a bit of time on Datasette Lite.
One of the things I learned from the Carpentries teacher training a while ago is that a really great way to run a workshop like this is to have detailed, extensive notes available and then to work through those, slowly, at the front of the room.
I don’t know if I’ve quite nailed the “slowly” part, but I do find that having an extensive pre-prepared handout really helps keep things on track. It also gives attendees a chance to work at their own pace.
You can find the full 9-page workshop handout I prepared here:
sqlite-tutorial-pycon-2023.readthedocs.io
I built the handout site using Sphinx and Markdown, with myst-parser and sphinx_rtd_theme and hosted on Read the Docs. The underlying GitHub repository is here:
github.com/simonw/sqlite-tutorial-pycon-2023
I’m hoping to recycle some of the material from the tutorial to extend Datasette’s official tutorial series—I find that presenting workshops is an excellent opportunity to bulk up Datasette’s own documentation.
The Advanced SQL section in particular would benefit from being extended. It covers aggregations, subqueries, CTEs, SQLite’s JSON features and window functions—each of which could easily be expanded into their own full tutorial.
More recent articles
- Project: Civic Band - scraping and searching PDF meeting minutes from hundreds of municipalities - 16th November 2024
- Qwen2.5-Coder-32B is an LLM that can code well that runs on my Mac - 12th November 2024
- Visualizing local election results with Datasette, Observable and MapLibre GL - 9th November 2024