types-pexpect
Typing stubs for pexpect
Decision gist · record as of 2026-08-14
Yes, if you use pexpect and run static type checking. Install it alongside pexpect to get full type coverage in mypy or pyright. No downside: it has no dependencies, adds no runtime cost, and is actively maintained. Skip only if you don't use a type checker or don't use pexpect.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later
- Low install friction with no runtime dependencies.
- Actively maintained as part of typeshed; last commit 2026-08-14.
License · maintenance · safety
Apache-2.0 (permissive) — Licensed under Apache-2.0 (permissive), allowing use in both open-source and proprietary projects without significant restrictions.
last release 2026-05-18 (88 days) · last repo commit 2026-08-14 · 37 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 941,982 downloads/mo, #4,675 on PyPI
Alternatives
Verify before relying
pip install types-pexpect
import pexpect
child = pexpect.spawn('bash')- Whether these stubs cover all pexpect 4.9.* APIs or only a subset
- Compatibility with pexpect versions outside the 4.9.* series
What it is and what it does
types-pexpect is a type stub package that provides type annotations for pexpect's public API. It allows static type checkers like mypy and pyright to understand and validate code that uses pexpect without requiring pexpect itself to ship with inline type hints.
The package is generated and maintained as part of typeshed, the canonical repository of type stubs for the Python ecosystem. It targets pexpect version 4.9.* and has zero runtime dependencies—it exists purely to inform type checkers during development. Installation is straightforward and adds no overhead to your application.
Use it for
- Enable type checkers to validate scripts that automate terminal sessions with pexpect
- Catch type errors in subprocess automation code before runtime in CI/CD pipelines
- Provide IDE autocomplete and inline documentation for pexpect method calls
- Validate terminal interaction logic in test automation frameworks using pexpect
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you use pexpect and run static type checking.
Install it alongside pexpect to get full type coverage in mypy or pyright. No downside: it has no dependencies, adds no runtime cost, and is actively maintained. Skip only if you don't use a type checker or don't use pexpect.
Install
types-pexpect on PyPI
Before you install
Low install friction with no runtime dependencies. Actively maintained as part of typeshed; last commit 2026-08-14. Tested against mypy 2.1.0 and pyright 1.1.409.
Requires Python 3.10 or later
License in practice
Licensed under Apache-2.0 (permissive), allowing use in both open-source and proprietary projects without significant restrictions.
Quickstart
pip install types-pexpect
import pexpect
child = pexpect.spawn('bash')
Verify before relying
- Whether these stubs cover all pexpect 4.9.* APIs or only a subset
- Compatibility with pexpect versions outside the 4.9.* series
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 88 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 941,982 / month, #4,675 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Programming Language :: Python :: 3Typing :: Stubs Only |
Evidence: types_pexpect-4.9.0.20260518-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 › “type stubs pexpect”
- types-pexpectProvides type stubs for pexpect, enabling type checkers like mypy and…
- pexpect-serialExtends pexpect to work with serial ports by wrapping pyserial…
- pexpectPexpect spawns and controls interactive console applications by…
Give your agent the search over MCP, or paste the wish link into any chat.
More Quality Assurance packages
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
Ruff is a Python linter and code formatter written in Rust that combines linting, formatting, and code fixing into a single tool, replacing Flake8, Black, isort, and related utilities.
Pexpect spawns and controls interactive console applications by sending input and matching output patterns, automating tasks that would otherwise require manual interaction.
Black reformats Python source code to a consistent style by parsing entire files and rewriting them according to an opinionated, deterministic set of rules, eliminating manual formatting decisions.
pytest-xdist distributes pytest tests across multiple CPU cores or machines to speed up test execution, with the simplest usage being `pytest -n auto` to spawn workers equal to available CPUs.
Install it if your test suite takes long enough that parallelization would save meaningful time.
Validates AWS CloudFormation templates in YAML or JSON format against resource provider schemas and best practices, checking property values and configuration correctness.
Install it if you work with CloudFormation templates.
See also types-polib · types-WTForms · types-mock · types-aws-xray-sdk · types-protobuf · types-assertpy · types-qrcode · types-psutil · types-Markdown