A Python implementation of the OMEMO Multi-End Message and Object Encryption protocol.
A complete implementation of XEP-0384 on protocol-level, i.e. more than just the cryptography. python-omemo supports different versions of the specification through so-called backends. One backend for OMEMO in the urn:xmpp:omemo:2
namespace is shipped with python-omemo. A backend for (legacy) OMEMO in the eu.siacs.conversations.axolotl
namespace is available as a separate package: python-omemo-backend-legacy. Multiple backends can be loaded and used at the same time, the library manages their coexistence transparently.
python-omemo depends on two system libraries, libxeddsa>=2,<3 and libsodium.
Install the latest release using pip (pip install OMEMO
) or manually from source by running pip install .
(recommended) or python setup.py install
in the cloned repository. The installation requires libsodium and the Python development headers to be installed. If a locally installed version of libxeddsa is available, python-xeddsa (a dependency of python-omemo) tries to use that. Otherwise it uses prebuilt binaries of the library, which are available for Linux, MacOS and Windows for the amd64 architecture, and potentially for MacOS arm64 too. Set the LIBXEDDSA_FORCE_LOCAL
environment variable to forbid the usage of prebuilt binaries.
python-omemo uses pytest as its testing framework, mypy for static type checks and both pylint and Flake8 for linting. All tests/checks can be run locally with the following commands:
$ pip install --upgrade pytest pytest-asyncio mypy pylint flake8
$ mypy --strict omemo/ setup.py tests/
$ pylint omemo/ setup.py tests/
$ flake8 omemo/ setup.py tests/
$ pytest
Refer to the documentation on readthedocs.io, or build/view it locally in the docs/
directory. To build the docs locally, install the requirements listed in docs/requirements.txt
, e.g. using pip install -r docs/requirements.txt
, and then run make html
from within the docs/
directory. The documentation can then be found in docs/_build/html/
.
The functionality.md
file contains an overview of supported functionality/use cases, mostly targeted at developers.