Ops documentation

Important

This is the documentation for version 2.x of Ops, which stopped being actively developed in June 2025. Ops 2.x will continue to receive security and critical bug fixes.

  • If your charm needs to support Python 3.8 (Ubuntu 20.04), use Ops 2.x.

  • Otherwise, use Ops 3.x.

Ops 3.x removed support for Python 3.8, but is otherwise compatible with Ops 2.x. See the latest documentation.

The Ops library (ops) is a Python framework for writing and testing Juju charms.

The library provides:

You can structure your charm however you like, but with the ops library, you get a framework that promotes consistency and readability by following best practices. It also helps you organise your code better by separating different aspects of the charm, such as managing the application’s state, handling integrating with other services, and making the charm easier to test.


In this documentation

Start here: a hands-on introduction to ops for new users

Tutorials

Step-by-step guides covering key operations and common tasks

How-to guides

Technical information - specifications, APIs, architecture

Reference

Discussion and clarification of key topics

Explanation

Project and community

Ops is a member of the Ubuntu family. It’s an open source project that warmly welcomes community projects, contributions, suggestions, fixes and constructive feedback.