{"id":21827,"library":"python-olm","title":"python-olm","description":"Python CFFI bindings for the Olm cryptographic ratchet library, used for end-to-end encryption in Matrix and other messaging protocols. Current version 3.2.16. Release cadence is irregular.","status":"active","version":"3.2.16","language":"python","source_language":"en","source_url":"https://gitlab.matrix.org/matrix-org/olm/olm/-/tree/master/python","tags":["olm","matrix","encryption","cryptography","cffi"],"install":[{"cmd":"pip install python-olm","lang":"bash","label":"Default install"}],"dependencies":[{"reason":"Required for CFFI bindings","package":"cffi","optional":false}],"imports":[{"note":"Importing the module directly gives you the CFFI module, not the Python wrapper. Use from olm import Olm to get the high-level class.","wrong":"import olm","symbol":"Olm","correct":"from olm import Olm"},{"note":"The old module-based import path (olm.account) was removed in 3.0.0. All classes are now directly under olm.","wrong":"from olm.account import Account","symbol":"Account","correct":"from olm import Account"}],"quickstart":{"code":"from olm import Account, Olm\n\n# Initialize the library\nolm = Olm()\n\n# Create an account\naccount = Account()\nprint(f\"Account created: {account.identity_keys['curve25519']}\")","lang":"python","description":"Create an Olm account and print the Curve25519 identity key."},"warnings":[{"fix":"Change imports: replace 'from olm.account import Account' with 'from olm import Account'.","message":"In version 3.0.0, all submodules (olm.account, olm.session, etc.) were removed. All classes must be imported directly from olm: from olm import Account, Session.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Add 'olm = Olm()' at the start of your application.","message":"The Olm class initialization now requires calling Olm() before using other classes. Failure to do so may cause segfaults or undefined behavior.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use the high-level Python classes instead of accessing CFFI directly.","message":"The 'olm' module attribute for the CFFI binding (e.g., olm._olm) is deprecated and may be removed in future versions.","severity":"deprecated","affected_versions":">=3.2.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use: 'from olm import Account'","cause":"Importing submodules directly, which were removed in 3.0.0.","error":"ModuleNotFoundError: No module named 'olm.account'"},{"fix":"Ensure you do 'from olm import Account' and that you have the Python package installed (pip install python-olm) not just the C library.","cause":"Importing the CFFI module olm itself instead of using the Python wrapper. The Python classes are in the olm Python package, not the olm CFFI module.","error":"AttributeError: module 'olm' has no attribute 'Account'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}