Ben Hoyt shares design decisions behind Jubilant, a Python API wrapping the Juju CLI via subprocess.run. He argues that shelling out to a CLI tool is often simpler and more stable than using a complex native API, especially when the CLI offers stable JSON output. He also describes a Go-based code generator that uses runtime reflection to convert Go structs into Python dataclasses, avoiding manual transcription errors. Finally, he covers the developer tooling setup using uv for dependency management and a simple Makefile as a command runner.
Table of contents
Subprocess.runA Pythonic wrapper, typedGo generating Python dataclassesMake and uvConclusion1 Impression