skillfed

ptpython

Python REPL build on top of prompt_toolkit

ptpython v3.0.32 1.8M downloads/30d#3,575 on PyPI5,446
Permissive license AGING released

What it is and what it does

ptpython is a drop-in replacement for the standard Python REPL that adds modern terminal features: syntax highlighting via pygments, multiline editing with proper indentation handling, intelligent autocompletion through jedi, and support for both Vi and Emacs key bindings. It runs on Linux, BSD, macOS, and Windows, and can be invoked as a standalone command or embedded directly into Python applications.

The package depends on prompt_toolkit for terminal UI, pygments for syntax coloring, jedi for code completion, and appdirs for platform-aware configuration file discovery. It supports asyncio event loops for top-level await, custom color schemes, mouse input, and bracketed paste mode. You can customize behavior through a config.py file or command-line flags, and it integrates with IPython (via ptipython) and Django's shell_plus command.

Use it for:

  • Replace your default Python REPL with a more productive interactive shell for daily development and exploration.
  • Embed ptpython in a Python application to provide users with an advanced debugging or inspection interface.
  • Use ptipython to get IPython's magic functions and shell integration alongside ptpython's UI enhancements.
  • Configure Vi or Emacs key bindings to match your editor workflow in the interactive shell.
  • Debug asyncio code interactively with top-level await support via the --asyncio flag.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

ptpython is an advanced interactive Python shell that replaces the standard REPL with syntax highlighting, multiline editing, autocompletion, and configurable key bindings.

Yes. ptpython is a mature, well-maintained tool with low install friction and no known vulnerabilities. The aging maintenance status (267 days since last release) is not alarming given the active repository and stable feature set. Install it if you spend significant time in the Python REPL and want syntax highlighting, autocompletion, and better editing—it's a straightforward quality-of-life upgrade.

Install

ptpython on PyPI

pip

pip install ptpython

uv

uv add ptpython

poetry

poetry add ptpython

Installing ptpython

Before you install

Low install friction with a pure Python wheel. Maintenance is aging—the last release was 267 days ago—but the repository remains active with recent commits and a solid user base of 5446 stars.

License in practice

Licensed under BSD (permissive), so you can use and modify ptpython freely in both open-source and commercial projects without significant legal constraints.

Quickstart

pip install ptpython

ptpython

# Or embed in your application:
from ptpython.repl import embed
embed(globals(), locals())

Requires Python 3.8 or later; config file support only works when invoking ptpython directly, not when embedded.

Verify before relying

  • Whether the aging maintenance status affects stability or feature development going forward
  • Performance characteristics when handling very large histories or complex autocompletion scenarios

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 4 — appdirs, jedi, prompt_toolkit, pygments
Maintenance aging — 267 days since the last release
Last repo commit
First released
Downloads 1,768,201/month — #3,575 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: ptpython-3.0.32-py3-none-any.whl

License :: OSI Approved :: BSD LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

python repl replacementinteractive python shellsyntax highlighting replpython autocompletionadvanced python promptmultiline python editorvi emacs key bindings
replinteractive-shelldeveloper-tools

More Terminals packages