--- id: types-pexpect version: "4.9.0.20260518" license: Apache-2.0 license_treatment: permissive maintenance: active --- # types-pexpect — Typing stubs for pexpect License: permissive · Maintenance: active · Downloads: 942.0K/mo ## 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 above — 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 pip install types-pexpect uv add types-pexpect poetry add types-pexpect ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 942.0K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags type stubs pexpect, pexpect typing, mypy pexpect, pyright pexpect, terminal automation types, type checking stubs, type-stubs, static-analysis [View on SkillFed](https://skillfed.io/packages/types-pexpect) · [View on PyPI](https://pypi.org/project/types-pexpect/)