skillfed

stem

Stem is a Python controller library that allows applications to interact with Tor (https://www.torproject.org/).

stem v1.8.2 252.6K downloads/30d#8,541 on PyPI
Copyleft license LGPLv3 Abandoned released

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 stem

uv

uv add stem

poetry

poetry add stem

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)Topic :: SecurityTopic :: Software Development :: Libraries :: Python Modules

Tags

tor controller librarytor python interfaceinteract with tor daemontor control protocoltor network programmingonion routing controltor relay management
tor-integrationnetwork-controlabandoned

More Python Modules packages