Charm Tech has released version 1.0 of charmlibs-pathops, a new Python package that provides a pathlib-like API for interacting with local files and files in containers. This will allow you to use the same API for managing files in your machine charms and in the charm & workload containers of your Kubernetes charms.
The common API is a subset of the pathlib.Path
methods that can be implemented via Pebble for Kubernetes charm containers, with file creation methods extended to take permission and ownership arguments. If you’re an experienced Python developer, we hope that this pathlib-like API will feel familiar.
Check out the readme for tips on getting started, or dive into the reference docs on our new charm libraries documentation site. If you encounter any bugs, or have feature requests or improvement suggestions, please don’t hesitate to open an issue.