canonical/operator — reverse-engineered prompt

Reverse engineered prompt

Build me a pure Python library for creating and testing Juju charms, aimed at people writing both Kubernetes and machine charms. I want it to feel like the standard modern way to write charms in Python, where a charm author can define a charm class, hook up Juju events like config changes and Pebble ready, manage workload containers and unit status, and package the result for deployment with Juju.

Please include a friendly developer experience, solid docs, and a few working examples, especially a simple Kubernetes charm that starts a containerized workload and reacts to events. I also want good testing support so charm code can be exercised in unit tests with fake state, fake containers, and event simulation, without needing a real cluster every time.

Make it production quality, well tested, and easy to understand for someone learning charm development. Target modern Python, 3.10 and up. If you need details, look up the current Juju and charm docs online and follow the latest conventions.

Want more depth? Deep Reverse