--- id: txtorcon version: "26.6.0" license: MIT license_treatment: permissive maintenance: active --- # txtorcon — Twisted-based Tor controller client, with state-tracking and configuration abstractions. https://txtorcon.readthedocs.org https://github.com/meejah/txtorcon License: permissive · Maintenance: active · Downloads: 695.1K/mo ## What it is and what it does txtorcon implements the Tor control specification for Python, allowing programs to connect to a running Tor instance and issue commands asynchronously. It abstracts Tor's control protocol into Python objects representing circuits, relays, and configuration, making it practical to embed Tor functionality into larger applications. Typical usage involves connecting to a local or remote Tor control socket, then issuing commands: fetching live stream updates, building circuits through specific relays, reading and modifying Tor configuration, or launching hidden services. The library integrates with endpoint systems, so Tor-routed connections can be used transparently in servers and clients. Use it for: - Monitor Tor relay and stream activity in real time from a Python event loop. - Automate onion service deployment and management via the control protocol. - Create a Tor controller tool that tracks circuit state and relay information. - Build a proxy or client that routes traffic through Tor circuits programmatically. - Integrate Tor anonymity into existing Python applications. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. txtorcon is a client library for controlling and monitoring Tor instances via the Tor control protocol, enabling Python programs to manage circuits, streams, relays, and onion services. Yes, if you need to control or monitor Tor from Python. The library is actively maintained, has no known vulnerabilities, installs with low friction, and is MIT-licensed. Not relevant for applications that do not need direct Tor control. ## Install pip install txtorcon uv add txtorcon poetry add txtorcon ## Installing txtorcon Before you install: Low install friction; pure Python wheel with no compiled dependencies. Actively maintained as of 2026-06-01. License in practice: MIT-licensed under permissive terms, allowing use in commercial and proprietary projects with minimal restrictions. Quickstart: pip install txtorcon import txtorcon tor = await txtorcon.connect(reactor) print(f"Connected to Tor {tor.version}") Requires a running Tor daemon accessible via control socket; Python 3.8+ required. Verify before relying: - Whether Automat and Twisted are explicitly listed as runtime dependencies in package metadata (description mentions them but deps.runtime is empty). - Specific version constraints for Twisted or Automat compatibility. - Whether the example code in the description excerpt is representative of typical usage patterns. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 695.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags tor controller client python, tor circuit management, tor control protocol, onion service automation, tor state tracking, tor event monitoring, tor relay monitoring, tor-integration, anonymity [View on SkillFed](https://skillfed.io/packages/txtorcon) · [View on PyPI](https://pypi.org/project/txtorcon/)