skillfed

cosl

Utils for COS Lite charms

cosl v1.10.3 221.2K downloads/30d#9,282 on PyPI0
Permissive license Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) Active released

What it is and what it does

cosl is a utility library for COS Lite charms—Juju charm applications that integrate with the Canonical Observability Stack. It provides three main components: CosTool (bindings to the cos-tool CLI), JujuTopology (logic for generating topology labels used in observability metrics), and LokiHandler (a Python logging handler that sends logs to a Loki push API endpoint). The library depends on ops, diskcache, pydantic, pyyaml, tenacity, and typing-extensions, making it suitable for charm developers who need to instrument their applications with observability without building these integrations from scratch.

The package is actively maintained and has no known vulnerabilities. It targets charm developers and system administrators building observable Juju applications. The coordinated_workers module was moved to a separate package, so if you need that functionality, you should use the coordinated-workers package instead.

Use it for:

  • Add structured logging to a Juju charm that forwards logs to a Loki instance for centralized log aggregation
  • Generate and apply Juju topology labels to charm metrics for model-driven observability
  • Integrate cos-tool functionality into charm code for COS Lite bundle operations
  • Build observability into custom charms deployed on Juju models with COS Lite

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides utilities for COS Lite charms, including bindings for cos-tool, Juju topology logic for observability labels, and a Python logging handler that forwards logs to Loki.

Yes, if you are developing Juju charms for COS Lite. The library is actively maintained, has low install friction, carries no security vulnerabilities, and provides essential observability utilities that would otherwise require custom implementation. Not relevant for non-charm Python projects.

Install

cosl on PyPI

pip

pip install cosl

uv

uv add cosl

poetry

poetry add cosl

Installing cosl

Before you install

Low install friction with a pure-wheel distribution. Actively maintained with a recent release (2026-08-14), no known vulnerabilities, and straightforward dependencies.

License in practice

Apache License 2.0 is permissive and allows commercial use, modification, and distribution with minimal restrictions—suitable for most projects.

Quickstart

pip install cosl

from cosl.cos_tool import CosTool
from cosl.juju_topology import JujuTopology
from cosl.loki_logger import LokiHandler

# Use CosTool, JujuTopology, or LokiHandler as needed for your charm

Verify before relying

  • Whether CosTool requires the external cos-tool binary to be installed on the system
  • Specific Loki API endpoint requirements and authentication details for LokiHandler
  • Whether JujuTopology requires a running Juju model or works offline

Package facts

License Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 6 — ops, diskcache, pydantic, pyyaml, tenacity, typing-extensions
Maintenance actively maintained — 0 days since the last release
Last repo commit
First released
Downloads 221,240/month — #9,282 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: cosl-1.10.3-py3-none-any.whl

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: System AdministratorsLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.8Topic :: UtilitiesTyping :: Typed

Tags

juju charm observability utilitiesloki logging handler pythoncos-tool bindingsjuju topology metricscharm logging integration
juju-charmobservabilitylogging

More Utilities packages