types-pexpect
Typing stubs for pexpect
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
Provides type stubs for pexpect, enabling type checkers like mypy and pyright to validate code using pexpect.
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
pip
pip install types-pexpectuv
uv add types-pexpectpoetry
poetry add types-pexpectInstalling types-pexpect
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.
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')
Requires Python 3.10 or later
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) |
Evidence: types_pexpect-4.9.0.20260518-py3-none-any.whl
Tags
More Quality Assurance packages
Coverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
ruffRuff is a Python linter and code formatter…
permissive · top 1,000 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
blackBlack reformats Python source code to a…
permissive · top 1,000 on PyPI
pytest-xdistpytest-xdist distributes pytest tests across…
permissive · top 1,000 on PyPI
cfn-lintValidates AWS CloudFormation templates in YAML…
permissive · top 1,000 on PyPI
types-polibProvides type stubs for the polib package,…
permissive · top 15,000 on PyPI
types-WTFormsProvides type stubs for WTForms, enabling type…
permissive · top 15,000 on PyPI
types-mockProvides type stubs for the mock library,…
permissive · top 5,000 on PyPI
types-aws-xray-sdkProvides type stubs for aws-xray-sdk, enabling…
permissive · top 15,000 on PyPI
types-protobufProvides type stubs for the protobuf package,…
permissive · top 1,000 on PyPI
types-assertpyProvides type stubs enabling static type…
permissive · top 15,000 on PyPI
types-qrcodeProvides type stubs for the qrcode package,…
permissive · top 15,000 on PyPI
types-psutilProvides type annotations for the psutil…
permissive · top 5,000 on PyPI
types-MarkdownProvides type stubs for the Markdown package,…
permissive · top 5,000 on PyPI