skillfed

python-olm

python CFFI bindings for the olm cryptographic ratchet library

python-olm v3.2.16 1.0M downloads/30d#4,512 on PyPI
Permissive license Apache-2.0 DORMANT released

What it is and what it does

python-olm is a CFFI-based wrapper around the Olm cryptographic library, providing Python access to the Olm and Megolm ratcheting protocols. It lets you build encrypted peer-to-peer and group messaging systems by managing cryptographic accounts, sessions, and keys. The library handles the low-level cryptography (curve25519 and ed25519 keys, ratcheting state) so you can focus on message exchange; it's used in the Matrix protocol implementation.

The package works by creating Account objects that hold identity keys and generate one-time keys, OutboundSession and InboundSession objects for encrypted point-to-point channels, and OutboundGroupSession and InboundGroupSession objects for one-to-many encrypted broadcast. All objects support pickling for persistence. Installation requires a C/C++ compiler and build tools, and the package is currently dormant—no active maintenance since late 2023.

Use it for:

  • Building end-to-end encrypted messaging applications using the Olm protocol, as implemented in Matrix clients.
  • Creating peer-to-peer encrypted communication channels between two accounts with forward secrecy.
  • Implementing group encrypted messaging where a sender broadcasts to multiple recipients using Megolm.
  • Storing and restoring encrypted session state via pickling for long-lived messaging applications.
  • Integrating Olm cryptography into Python-based chat or collaboration platforms.

Worth the install?

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

Python bindings for the Olm cryptographic ratchet library, enabling peer-to-peer and group encrypted communication using the Olm and Megolm protocols.

Yes, if you need Olm/Megolm encryption and can accept dormant maintenance. The package is stable and has no known vulnerabilities, but expect no updates or support. Suitable for established projects already using Olm (e.g., Matrix clients) or for new projects willing to maintain a fork if needed. The C/C++ build requirement and lack of Windows support are real constraints.

Install

python-olm on PyPI

pip

pip install python-olm

uv

uv add python-olm

poetry

poetry add python-olm

Installing python-olm

Before you install

Medium install friction due to C/C++ compilation requirements (cmake or GNU make and a compiler needed). Package is dormant—last release was 990 days ago—so expect no active maintenance or bug fixes.

License in practice

Apache-2.0 permissive license allows use in most projects, including commercial ones, with minimal restrictions beyond attribution.

Quickstart

pip install python-olm

from olm import Account, OutboundSession
alice = Account()
bob = Account()
bob.generate_one_time_keys(1)
id_key = bob.identity_keys['curve25519']
one_time = list(bob.one_time_keys['curve25519'].values())[0]
alice_session = OutboundSession(alice, id_key, one_time)
message = alice_session.encrypt('secret')

Requires cmake or GNU make and a C/C++ compiler; known to not work on Windows.

Verify before relying

  • Whether the dormant maintenance status affects security patches or compatibility with current Python versions.
  • Exact Python version support (requires_python is unspecified in metadata).
  • Whether prebuilt wheels cover all target platforms or if compilation is required on some systems.

Package facts

License Apache-2.0 (permissive)
Python support not specified
Install friction medium — platform-specific wheel
Runtime dependencies 1 — cffi
Maintenance dormant — 990 days since the last release
First released
Downloads 1,011,283/month — #4,512 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: python_olm-3.2.16-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; python_olm-3.2.16-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; python_olm-3.2.16-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl; python_olm-3.2.16-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; python_olm-3.2.16-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; python_olm-3.2.16-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl; python_olm-3.2.16-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; python_olm-3.2.16-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; python_olm-3.2.16-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl; python_olm-3.2.16-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; python_olm-3.2.16-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; python_olm-3.2.16-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl; python_olm-3.2.16-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; python_olm-3.2.16-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; python_olm-3.2.16-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl; python_olm-3.2.16-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; python_olm-3.2.16-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; python_olm-3.2.16-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl

License :: OSI Approved :: Apache Software LicenseTopic :: Communications

Tags

olm cryptographic ratchetend-to-end encryption pythonpeer-to-peer encrypted sessionsmegolm group encryptionmatrix protocol encryptioncffi cryptography bindingsencrypted messaging library
end-to-end-encryptioncryptographymessaging

More Communications packages