Skip to main content

Logging with OTR (Off-the-Record Messaging) and XMPP

Project description

This is a Python library for logging to XMPP destinations using OTR (Off-the-Record Messaging) encryption.


  • OTRv2
  • Pure python (no libotr dependency)
  • Log to multiple destinations
  • Optionally check log destinations’ OTR fingerprints


$ sudo pip install --pre xmpppy  # xmpppy is tagged as an "rc" version
$ sudo pip install otrxmpplogger


from otrxmpplogger import OTRXMPPLogger
import logging
import time
log = logging.getLogger()
privkey = open('.otrprivkey', 'r').read()
handler = OTRXMPPLogger(

log.debug('setting up OTR')  # Trigger OTR setup
time.sleep(3)  # Give OTR a little while to go active
log.critical('@6 is a rat!')


  • XMPP invitations are not handled
  • It seems to take roughly 3 seconds to set up an OTR session. Messages logged before the session is ready may be lost.



If you found this software useful and would like to encourage its maintenance and further development, please consider making a donation to the Bitcoin address 13RrGMM1YUduzSrw5BhE7BXFGPtBDQYnpQ.


This is free and unencumbered public domain software. For more information, see or the accompanying UNLICENSE file.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
OTRXMPPLogger-1.0.3.tar.gz (2.9 kB) Copy SHA256 hash SHA256 Source None Mar 25, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page