
TorCtl is a Python Tor controller with extensions to support path building and various constraints on node and path selection, as well as statistics gathering
There are a few more extras including SQL support for retrieving stats, GeoIP localization support, between others.