# API documentation

- Core pexpect components
  - spawn class
  - run function
  - Exceptions
  - Utility functions
- fdpexpect - use pexpect with a file descriptor
  - fdspawn class
- socket_pexpect - use pexpect with a socket
  - SocketSpawn class
- popen_spawn - use pexpect with a piped subprocess
  - PopenSpawn class
- replwrap - Control read-eval-print-loops
  - `REPLWrapper`
  - `PEXPECT_PROMPT`
  - `python()`
  - `bash()`
- pxssh - control an SSH session
  - `ExceptionPxssh`
  - pxssh class

The modules `pexpect.screen` and `pexpect.ANSI` have been deprecated in Pexpect version 4. They were separate from the main use cases for Pexpect, and there are better maintained Python terminal emulator packages, such as pyte. These modules are still present for now, but we don’t advise using them in new code.