Simon Willison’s Weblog

Subscribe
Atom feed

Elsewhere

Filters: Sorted by date

Release sqlite-utils 2.7 — Python CLI utility and library for manipulating SQLite databases
Release twitter-to-sqlite 0.21.1 — Save data from Twitter to a SQLite database
None
TIL Compile a new sqlite3 binary on Ubuntu — I wanted to try the `vacuum into` backup command that was released in SQLite3 3.27.0 [on 2019-02-07](https://www.sqlite.org/changes.html#version_3_27_0).
Release datasette-atom 0.5 — Datasette plugin that adds a .atom output format
Release conditional-get 0.2a — CLI tool for fetching data using HTTP conditional get
None
TIL How to mock httpx using pytest-mock — I wrote this test to exercise some [httpx](https://pypi.org/project/httpx/) code today, using [pytest-mock](https://pypi.org/project/pytest-mock/).
Release conditional-get 0.1.1a — CLI tool for fetching data using HTTP conditional get
Release conditional-get 0.1a — CLI tool for fetching data using HTTP conditional get
None
TIL Generated a summary of nested JSON data — I was trying to figure out the shape of the JSON object from https://github.com/simonw/coronavirus-data-gov-archive/blob/master/data_latest.json?raw=true - which is 3.2MB and heavily nested, so it's difficult to get a good feel for the shape.
None
TIL Session-scoped temporary directories in pytest — I habitually use the `tmpdir` fixture in pytest to get a temporary directory that will be cleaned up after each test, but that doesn't work with `scope="session"` - which can be used to ensure an expensive fixture is run only once per test session and the generated content is used for multiple tests.
None
TIL Fixing "compinit: insecure directories" error — Every time I opened a terminal on my new Mac running Catalina with zsh I got the following annoying error:
Release dogsheep-photos 0.2a — Upload your photos to S3 and import metadata about them into a SQLite database
Release dogsheep-photos 0.1a — Upload your photos to S3 and import metadata about them into a SQLite database
None
TIL Restricting SSH connections to devices within a Tailscale network — I'm running an AWS Lightsail instance and I want to only be able to SSH to it from devices connected to my [Tailscale](https://tailscale.com/) network.
Release datasette-publish-vercel 0.5 — Datasette plugin for publishing data using Vercel
Release datasette 0.40 — An open source multi-tool for exploring and publishing data
Release datasette-template-sql 1.0.1 — Datasette plugin for executing SQL queries from templates
None
TIL Close terminal window on Ctrl+D for macOS — I always forget how to set this up. It's hidden in Preferences -> Profiles -> Basic -> Shell:
None
TIL Get Skitch working on Catalina — I really like Skitch for taking screeshots, mainly because I like to snap a quick shot and then drag the icon onto a Google Doc or similar without saving the file anywhere.
Release github-to-sqlite 2.0 — Save data from GitHub to a SQLite database
None
TIL Use labels on Cloud Run services for a billing breakdown — Thanks to [@glasnt](https://github.com/glasnt) for the tip on this one. If you want a per-service breakdown of pricing on your Google Cloud Run services within a project (each service is a different deployed application) the easiest way to do it is to apply labels to those services, then request a by-label pricing breakdown.
Release datasette-template-sql 1.0 — Datasette plugin for executing SQL queries from templates
None
TIL Running pip install -e .[test] in zsh on macOS Catalina — macOS Catalina uses `zsh` rather than `bash` as the default shell (apparently because Apple don't like GPL 3).
None
TIL macOS Catalina sort-of includes Python 3 — Once you have installed the "command line tools" for Catalina using the following terminal command:
None
TIL Null case comparisons in SQLite — I wanted to say "output this transformed value if it's not null, otherwise nothing". The recipe I figured out was:
None
TIL Using macOS stickies to display a workshop link on the screen — When giving a workshop it's often useful to have a URL to the workshop materials visible on screen at all times. I use a bit.ly link for these.
None
TIL Running different steps on a schedule — Say you have a workflow that runs hourly, but once a day you want the workflow to run slightly differently - without duplicating the entire workflow.
None
TIL Lag window function in SQLite — Here's [how to use a lag window…
None
TIL Running a Python ASGI app on Vercel — Vercel really wants you to deploy static assets with [serverless functions](https://vercel.com/docs/serverless-functions/introduction) tucked away in a separate folder. They suggest creating modules like `api/index.py` which will be served up automatically as API backends to your client-side JavaScript.
None
TIL Commit a file if it changed — This recipe runs a Python script to update a README, then commits it back to the parent repo but only if it has changed: