stem
Stem is a Python controller library that allows applications to interact with Tor (https://www.torproject.org/).
What it is and what it does
Stem is a Python library that lets you programmatically control and query a running Tor instance via its control protocol. It abstracts the low-level socket communication, allowing you to issue commands, parse responses, and monitor Tor's state from Python code. The library has no runtime dependencies, making it lightweight to install, but it does require a Tor daemon to be running separately on your system.
The package is marked as production-stable and has been in use since its first release in 2013, but it is now abandoned—the last release was in June 2023 with no subsequent maintenance. If you need to automate Tor operations or build tools that interact with Tor, Stem can do that, but you should be aware that you will not receive updates for new Tor protocol features or bug fixes.
Use it for:
- Automate Tor relay configuration and monitoring by scripting control protocol commands.
- Build testing frameworks that need to spawn and control Tor instances programmatically.
- Query Tor's internal state for network analysis or debugging purposes.
- Develop privacy-focused applications that need to manage Tor connections and routing.
- Monitor Tor daemon health and performance metrics from a Python application.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Stem is a Python controller library for interacting with Tor, allowing applications to query and command Tor instances over the control protocol.
Yes, if you need to control Tor from Python and can tolerate no upstream maintenance. The library is stable and has no known vulnerabilities, but it is abandoned as of 2023. Verify compatibility with your Tor version before deploying. The copyleft LGPLv3 license requires careful review if you plan to distribute derivative work.
Install
stem on PyPI
pip
pip install stemuv
uv add stempoetry
poetry add stemInstalling stem
Before you install
Installation requires no runtime dependencies, but the package is abandoned—last release was 2023-06-06 and no commits have been recorded since. High install friction suggests build or environment complexity. Use only if you can accept no upstream maintenance.
License in practice
Licensed under LGPLv3 (copyleft). Any derivative work or modification must be released under the same license; linking in a proprietary application requires careful legal review.
Quickstart
pip install stem
import stem.control
with stem.control.Controller.from_port() as controller:
controller.authenticate()
print(controller.get_version())
Requires a running Tor daemon with control port enabled and authentication configured.
Verify before relying
- Whether the package works with current Tor versions and control protocol changes since 2023.
- Python version compatibility beyond the unspecified declaration in the fact sheet.
- Whether the high install friction is due to compiled dependencies or packaging issues.
- Specific control port and authentication requirements for typical Stem usage.
Package facts
| License | LGPLv3 (copyleft) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,165 days since the last release |
| First released | |
| Downloads | 252,598/month — #8,541 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: stem-1.8.2.tar.gz
Keywords: tor, onion, controller
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
txtorcontxtorcon is a client library for controlling…
permissive · top 15,000 on PyPI
brainstemProvides Python bindings to control and…
unclear · top 15,000 on PyPI
snowballstemmerProvides stemming algorithms for 34 languages,…
permissive · top 1,000 on PyPI
py-rust-stemmersProvides fast, parallel word stemming using…
unclear · top 5,000 on PyPI
simple-equA library of ready-to-use STEM equations…
permissive · top 15,000 on PyPI
SastrawiSastrawi reduces inflected Indonesian words to…
permissive · top 15,000 on PyPI
boschshcpyPython client library for the Bosch Smart Home…
permissive · top 15,000 on PyPI
python-matter-serverProvides a WebSocket-based Matter controller…
permissive · top 15,000 on PyPI
flux-ledControls Magic Home and Surp Life WiFi LED…
copyleft · top 15,000 on PyPI
qutebrowserA keyboard-driven, vim-like web browser built…
copyleft · top 15,000 on PyPI