ops
The Python library behind great charms
Decision gist · record as of 2026-08-14
Yes. If you are writing charms for Juju (Kubernetes or machine), ops is the standard, actively maintained framework with low install friction and no security vulnerabilities. It is production-stable and the recommended choice for new charm development. Install it as part of your charm project's dependencies via charmcraft or requirements.txt.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or above; intended for use within a Juju charm project structure (typically initialized via charmcraft).
- Low install friction; pure Python wheel with three runtime dependencies (PyYAML, websocket-client, opentelemetry-api).
- Actively maintained with a recent release and ongoing commits; requires Python 3.10 or above.
License · maintenance · safety
Apache-2.0 (permissive) — Licensed under Apache-2.0 (permissive); safe for commercial and proprietary use with minimal attribution requirements.
last release 2026-07-30 (15 days) · last repo commit 2026-08-10 · 265 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 484,840 downloads/mo, #6,401 on PyPI
Alternatives
Verify before relying
pip install ops
import ops
class MyCharm(ops.CharmBase):
def __init__(self, *args):
super().__init__(*args)
self.framework.observe(self.on.config_changed, self._on_config_changed)
def _on_config_changed(self, event):
self.unit.status = ops.ActiveStatus()- Whether ops 3.8.1 is compatible with all currently supported Juju versions.
- Performance characteristics when managing large numbers of containers or relations.
- Maturity of opentelemetry-api integration and observability features.
What it is and what it does
The ops library is the official Python framework for writing charms—Juju's declarative, event-driven model for managing Kubernetes workloads and machines. It provides a base class (CharmBase) that charm authors subclass to observe Juju events (config changes, pebble readiness, relation changes) and pair them to handler methods. The library abstracts Juju's event model and state management, letting developers focus on charm logic rather than low-level protocol details.
Ops includes a testing module (ops.testing) for unit testing charms in isolation, a Pebble API for managing container workloads, and integrations with PyYAML for configuration, websocket-client for Juju communication, and opentelemetry-api for observability. It is actively maintained by Canonical and is the recommended way to write new charms; the framework is production-stable and widely used in the Juju ecosystem.
Use it for
- Write a Kubernetes charm to manage a containerized application's lifecycle, configuration, and relations within Juju.
- Unit test charm logic using ops.testing.Context to simulate Juju events and verify charm behavior.
- Define and manage container workloads via the Pebble API, including service startup, configuration, and health checks.
- Handle charm configuration changes and relation events to coordinate multi-charm deployments.
- Integrate observability into charms using opentelemetry-api for tracing and metrics.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
If you are writing charms for Juju (Kubernetes or machine), ops is the standard, actively maintained framework with low install friction and no security vulnerabilities. It is production-stable and the recommended choice for new charm development. Install it as part of your charm project's dependencies via charmcraft or requirements.txt.
Install
ops on PyPI
Before you install
Low install friction; pure Python wheel with three runtime dependencies (PyYAML, websocket-client, opentelemetry-api). Actively maintained with a recent release and ongoing commits; requires Python 3.10 or above.
Requires Python 3.10 or above; intended for use within a Juju charm project structure (typically initialized via charmcraft).
License in practice
Licensed under Apache-2.0 (permissive); safe for commercial and proprietary use with minimal attribution requirements.
Quickstart
pip install ops
import ops
class MyCharm(ops.CharmBase):
def __init__(self, *args):
super().__init__(*args)
self.framework.observe(self.on.config_changed, self._on_config_changed)
def _on_config_changed(self, event):
self.unit.status = ops.ActiveStatus()
Verify before relying
- Whether ops 3.8.1 is compatible with all currently supported Juju versions.
- Performance characteristics when managing large numbers of containers or relations.
- Maturity of opentelemetry-api integration and observability features.
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesPyYAMLwebsocket-clientopentelemetry-api |
| Maintenance | Actively maintained 15 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 484,840 / month, #6,401 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 :: DevelopersIntended Audience :: System AdministratorsOperating System :: MacOS :: MacOS XOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3 |
Evidence: ops-3.8.1-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 development python”
- opsA Python framework for developing charms—declarative, event-driven…
- jubilantJubilant wraps the Juju CLI with a type-annotated Python interface,…
- coslProvides utilities for COS Lite charms, including bindings for…
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 charmlibs-pathops · cosl · jubilant · ops-scenario · juju · pytest-operator · charmcraftlocal · craft-parts · charmcraftcache · dagger-io