txtorcon is an implementation of the control-spec for Tor using the Twisted networking library for Python.

This would be of interest to anyone wishing to write event-based software in Python that talks to a Tor program. Currently, txtorcon is capable of:

  • maintaining up-to-date state information about Tor (Circuits, Streams and Routers)
  • maintaining current configuration information
  • maintaining representation of Tor’s address mappings (with expiry)
  • interrogating initial state of all three of the above
  • listing for and altering stream to circuit mappings
  • building custom circuits
  • Circuit and Stream state listeners
  • uses GeoIP to provide location and ASN information for Routers
  • uses psutil (optional) to locate processes creating Streams
  • listening for any Tor EVENT

Comments (positive or negative) appreciated. Even better if they come with patches.