txtorcon is a Twisted-based Python asynchronous controller library for Tor, following control-spec. This would be of interest to anyone wishing to write event-based software in Python that talks to a Tor program.
Cut to the chase by perusing the Walkthrough.
The main code is under 2000 lines according to ohcount, or 4500 lines including tests. Some features and motivating examples:
- txtorcon.TorConfig tracks and allows updating of config with attribute-style acccess (including hidden services):
This documentation was generated April 03, 2014.
- email@example.com (public key: meejah.asc)
- git clone git://github.com/meejah/txtorcon.git
- ``pip install txtorcon``
- Watch an asciinema demo for an overview.
If you’re using Debian, txtorcon is now in testing (jessie) and wheezy-backports thanks to Lunar:
echo "deb http://ftp.ca.debian.org/debian/ wheezy-backports main" >> /etc/apt/sources.list apt-get update apt-get install python-txtorcon
Installing the wheel files requires a recent pip and setuptools. At least on Debian, it is important to upgrade setuptools before pip. This procedure appears to work fine:
virtualenv foo . foo/bin/activate pip install --upgrade setuptools pip install --upgrade pip pip install path/to/txtorcon-0.9.0-py27-none-any.whl
- txtorcon README
- txtorcon Package
- Protocol and Helper Classes
- State-Tracking Classes
- Configuration Classes
- Launching Tor
- txtorcon.interface Module
- txtorcon.util Module