charmlibs-pathops
A pathlib-like interface for Juju K8s charms to interact with files in their workload container.
Decision gist · record as of 2026-08-14
Yes—if you are writing Juju Charms that need to interact with container filesystems. The library eliminates boilerplate for path handling and unifies the API across charm types. No known vulnerabilities, permissive license, low install friction, and active maintenance. Not relevant for non-charm Python projects.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python >=3.10 and ops as a runtime dependency.
- Low friction: pure Python wheel with a single runtime dependency (ops).
- Active maintenance with recent releases; last commit 2026-08-14.
License · maintenance · safety
Apache-2.0 (permissive) — Apache-2.0 permissive license allows commercial and private use with minimal restrictions.
last release 2026-06-16 (59 days) · last repo commit 2026-08-14 · 5 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 80,338 downloads/mo, #14,296 on PyPI
Alternatives
Verify before relying
from charmlibs import pathops
import ops
class KubernetesCharm(ops.CharmBase):
def __init__(self, framework: ops.Framework):
super().__init__(framework)
container = self.unit.get_container('container-name')
self.root = pathops.ContainerPath('/', container=container)
path = self.root / 'foo/bar'
path.write_text('content')- Whether PathProtocol's subset of pathlib.Path API covers typical charm file-handling workflows beyond the documented examples.
- Performance characteristics when working with large files or many operations across container boundaries.
What it is and what it does
charmlibs-pathops is a filesystem abstraction library for Juju Charms that unifies file operations across local charm containers and remote workload containers. It wraps the ops framework and provides LocalPath and ContainerPath classes that implement a common PathProtocol interface—a subset of pathlib.Path—allowing charm code to work with either filesystem using identical method calls.
The library is designed for Kubernetes charms that need to read from or write to files in both the charm container and the workload container. It handles path operations like mkdir, read_bytes, write_text, and a helper ensure_contents function that idempotently sets file contents and reports whether changes were made. It does not support relative paths, the open method, or symlink/hardlink manipulation; mkdir, write_bytes, and write_text accept mode, user, and group parameters to set permissions and ownership directly.
Use it for
- Copy configuration files from a charm container to a workload container with permission and ownership control.
- Write charm-generated configuration to a workload container and detect whether the workload needs to reload.
- Implement charm logic that works identically on both machine and Kubernetes charms by accepting a PathProtocol argument.
- Ensure a file exists with specific content and ownership in a workload container, idempotently.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes—if you are writing Juju Charms that need to interact with container filesystems.
The library eliminates boilerplate for path handling and unifies the API across charm types. No known vulnerabilities, permissive license, low install friction, and active maintenance. Not relevant for non-charm Python projects.
Install
charmlibs-pathops on PyPI
Before you install
Low friction: pure Python wheel with a single runtime dependency (ops). Active maintenance with recent releases; last commit 2026-08-14.
Requires Python >=3.10 and ops as a runtime dependency.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions.
Quickstart
from charmlibs import pathops
import ops
class KubernetesCharm(ops.CharmBase):
def __init__(self, framework: ops.Framework):
super().__init__(framework)
container = self.unit.get_container('container-name')
self.root = pathops.ContainerPath('/', container=container)
path = self.root / 'foo/bar'
path.write_text('content')
Verify before relying
- Whether PathProtocol's subset of pathlib.Path API covers typical charm file-handling workflows beyond the documented examples.
- Performance characteristics when working with large files or many operations across container boundaries.
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packageops |
| Maintenance | Actively maintained 59 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 80,338 / month, #14,296 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3 |
Evidence: charmlibs_pathops-1.3.0.post0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “juju charm file operations”
- charmlibs-pathopsProvides a pathlib-like interface for reading and writing files in…
- coslProvides utilities for COS Lite charms, including bindings for…
- opsA Python framework for developing charms—declarative, event-driven…
Give your agent the search over MCP, or paste the wish link into any chat.
More Application Frameworks packages
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Textual is a Python framework for building cross-platform user interfaces that run in the terminal or web browser using a modern, component-based API.
Install it if you're developing CLI tools, dashboards, or interactive terminal applications.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Build and connect to Model Context Protocol servers that expose tools, resources, and prompts to LLM applications over stdio, HTTP, or SSE transports.
Install it if you need to build or connect to servers.
Werkzeug is a WSGI utility library providing request/response objects, URL routing, an interactive debugger, HTTP utilities, and a development server for building web applications.
See also ops · cosl · juju · jubilant · ops-scenario · charmcraftlocal · pytest-operator · path.py · data-platform-helpers · skia-pathops