Stem is a python controller library for Tor (https://www.torproject.org/). Like its predecessor, TorCtl, it uses Tor's control protocol to help developers program against the Tor process.
For tutorials and API documentation see stem’s homepage.
To install you can either use…
pip install stem
… or install from the source tarball. Stem supports both the python 2.x and 3.x series. To use its python3 counterpart you simply need to install using that version of python.
python3 setup.py install