ptyprocess
Run a subprocess in a pseudo terminal
Decision gist · record as of 2026-08-14
Yes, if you need to automate interactive terminal programs on Unix/POSIX systems. The package is stable and has no known vulnerabilities. However, note that it is aging (last release 2020-12-28) and not actively maintained; it works well for its narrow, well-defined purpose but won't receive updates for new Python features or terminal standards. Not usable on Windows.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Unix/POSIX systems only (macOS, Linux); pty is not available on Windows.
- Low install friction with a pure-Python wheel.
- Maintenance is aging—the latest release was 2020-12-28 and the repository shows no recent commits, though it remains archived=false and is in production/stable status.
License · maintenance · safety
permissive license (permissive) — ISC License (permissive) allows use in most projects with minimal restrictions; attribution is typically required but no copyleft obligations apply.
last release 2020-12-28 (2055 days) · last repo commit 2025-07-17 · 238 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 205,236,250 downloads/mo, #200 on PyPI
Alternatives
Verify before relying
pip install ptyprocess
from ptyprocess import PtyProcessUnicode
p = PtyProcessUnicode.spawn(['python'])
p.read(20)
p.write('6+6\n')
p.read(20)- Whether the package works reliably with modern Python versions beyond those listed in classifiers (2.7, 3).
- Current status of any known issues with Unicode handling or terminal control sequences.
What it is and what it does
ptyprocess wraps the Unix pty (pseudo-terminal) interface to run a subprocess in a full terminal environment rather than through simple pipes. This is essential when you need to automate programs that detect whether they're connected to a real terminal—many tools change their output format, disable colors, or fail entirely when piped. It lets you interact with password prompts, terminal-based UIs, and programs that use terminal control sequences as if you were typing at a real console.
The package provides a straightforward API: spawn a process with a command, then read from and write to it as you would with a terminal session. It handles the low-level pty setup so you don't have to. It has no runtime dependencies and installs as a pure-Python wheel, making it lightweight and portable across Unix-like systems.
Use it for
- Automate interactive CLI tools that prompt for passwords or user input without reading from stdin.
- Test terminal-based applications that behave differently when output is piped versus displayed on a real terminal.
- Control curses-style or full-screen terminal interfaces programmatically.
- Build expect-like automation scripts for legacy or interactive command-line programs.
- Capture colored output and terminal control sequences from programs that strip them when piped.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to automate interactive terminal programs on Unix/POSIX systems.
The package is stable and has no known vulnerabilities. However, note that it is aging (last release 2020-12-28) and not actively maintained; it works well for its narrow, well-defined purpose but won't receive updates for new Python features or terminal standards. Not usable on Windows.
Install
ptyprocess on PyPI
Before you install
Low install friction with a pure-Python wheel. Maintenance is aging—the latest release was 2020-12-28 and the repository shows no recent commits, though it remains archived=false and is in production/stable status.
Unix/POSIX systems only (macOS, Linux); pty is not available on Windows.
License in practice
ISC License (permissive) allows use in most projects with minimal restrictions; attribution is typically required but no copyleft obligations apply.
Quickstart
pip install ptyprocess
from ptyprocess import PtyProcessUnicode
p = PtyProcessUnicode.spawn(['python'])
p.read(20)
p.write('6+6\n')
p.read(20)
Verify before relying
- Whether the package works reliably with modern Python versions beyond those listed in classifiers (2.7, 3).
- Current status of any known issues with Unicode handling or terminal control sequences.
Package facts
| License | permissive license permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Aging 2,055 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 205,236,250 / month, #200 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: System AdministratorsLicense :: OSI Approved :: ISC License (ISCL)Operating System :: MacOS :: MacOS XOperating System :: POSIXProgramming Language :: PythonProgramming Language :: Python :: 2.7Programming Language :: Python :: 3Topic :: Terminals |
Evidence: ptyprocess-0.7.0-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “pseudo terminal subprocess”
- ptyprocessRun a subprocess in a pseudo terminal (pty) and interact with its…
- subprocess-multiteeMultiplexes subprocess stdout/stderr to multiple destinations…
- diffqDiffQ performs differentiable quantization of PyTorch models using…
Give your agent the search over MCP, or paste the wish link into any chat.
More Terminals packages
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
Rich renders styled text, tables, progress bars, syntax highlighting, markdown, and tracebacks to the terminal with minimal code.
Colorama makes ANSI escape sequences for colored terminal text work on Windows by intercepting and converting them to win32 API calls, while passing through unchanged on other platforms.
Install it if you need colored terminal output to work on Windows or want to use ANSI-based libraries portably; skip it only if you target non-Windows platforms…
Measures the displayed width of Unicode strings in terminals, accounting for wide characters, combining marks, and terminal escape sequences that standard Python string functions mishandle.
Install it if your application formats text for terminals and handles non-ASCII characters.
Pexpect spawns and controls interactive console applications by sending input and matching output patterns, automating tasks that would otherwise require manual interaction.
Adds ANSI color and text formatting (bold, underline, blink, reverse, etc.) to terminal output, with support for named colors, RGB tuples, and automatic terminal capability detection.
Install it if you need ANSI color formatting in any Python CLI, script, or logging system.
See also dockerpty · pywinpty · bash · inputimeout · pairmux · subprocess-multitee · EasyProcess · sh · scripttest