skillfed

types-pexpect

Typing stubs for pexpect

types-pexpect v4.9.0.20260518 942.0K downloads/30d#4,675 on PyPI37
Permissive license Apache-2.0 Active released

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-pexpect

uv

uv add types-pexpect

poetry

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 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

Programming Language :: Python :: 3Typing :: Stubs Only

Tags

type stubs pexpectpexpect typingmypy pexpectpyright pexpectterminal automation typestype checking stubs
type-stubsstatic-analysis

More Quality Assurance packages