shelmet (via) This looks like a pleasant ergonomic alternative to Python's subprocess module, plus a whole bunch of other useful utilities. Lets you do things like this:
sh.cmd("ps", "aux").pipe("grep", "-i", check=False).run("search term")
I like the way it uses context managers as well: with sh.environ({"KEY1": "val1"})
sets new environment variables for the duration of the block, with sh.cd("path/to/dir")
temporarily changes the working directory and with sh.atomicfile("file.txt") as fp
lets you write to a temporary file that will be atomically renamed when the block finishes.
Recent articles
- 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
- Project: VERDAD - tracking misinformation in radio broadcasts using Gemini 1.5 - 7th November 2024