pyrepl
A library for building flexible command line interfaces
What it is and what it does
pyrepl is a readline replacement written entirely in Python, designed to provide a more interactive command-line editing experience than the standard readline library. It offers multi-line editing, incremental history search, completion with option display, and a substantial set of emacs-mode keybindings. The package includes no global state, allowing multiple independent readers to coexist without history interference, and is built to integrate into application event loops without hogging control.
The library ships with a `pythoni` script that provides an enhanced Python top-level REPL. It has been actively developed since 2010 and is currently maintained, supporting Python 3.8 through 3.12 across Windows and POSIX systems.
Use it for:
- Building custom Python REPLs or interactive shells with readline-like editing and history
- Integrating line-editing capabilities into CLI applications without external readline dependencies
- Creating multi-line command editors with emacs keybindings in pure Python environments
- Running Python interactively with enhanced editing via the included pythoni script
- Embedding multiple independent command readers in a single application
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
pyrepl is a pure-Python readline-like library that provides interactive command-line editing with history, completion, and emacs-mode keybindings for building flexible CLI interfaces.
Yes, if you need readline-like editing in a pure-Python CLI tool or REPL. Low install friction, no dependencies, permissive license, and active maintenance make it a straightforward choice. The lack of external system dependencies is a significant advantage for portability. Not necessary if you are satisfied with standard readline or if you need features the fact sheet does not document.
Install
pyrepl on PyPI
pip
pip install pyrepluv
uv add pyreplpoetry
poetry add pyreplInstalling pyrepl
Before you install
Low friction install with no runtime dependencies. Actively maintained as of 2026-08-02, with recent release activity. Supports Python 3.8 through 3.12.
License in practice
MIT X11 style permissive license allows use in most projects without significant restriction.
Quickstart
pip install pyrepl
from pyrepl.console import InteractiveConsole
console = InteractiveConsole()
console.interact()
Requires Python 3.8 or newer.
Verify before relying
- Exact scope of readline emacs-mode keybindings supported (description says 'fairly large subset' but does not enumerate)
- Whether the package integrates into existing event loops or requires its own control flow
- Performance characteristics with large histories or completion datasets
Package facts
| License | MIT X11 style (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 12 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,076,274/month — #4,404 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyrepl-0.11.5-py3-none-any.whl
Keywords: readline, shell
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pyreadlineProvides GNU readline-like line editing and…
permissive · top 15,000 on PyPI
pyreadline3Provides GNU readline-like keyboard input…
permissive · top 5,000 on PyPI
gnureadlineProvides GNU Readline library support for…
copyleft · top 15,000 on PyPI
fancycompleterAdds colorful TAB completion to the Python…
permissive · top 5,000 on PyPI
prompt_toolkitprompt_toolkit is a Python library for building…
permissive · top 1,000 on PyPI
urwid-readlineAdds readline-style keyboard shortcuts to urwid…
permissive · top 15,000 on PyPI
tabcompleterAdds Tab-key autocompletion and command…
permissive · top 5,000 on PyPI
ptpythonptpython is an advanced interactive Python…
permissive · top 5,000 on PyPI
readlineProvides GNU readline library support for…
copyleft · top 15,000 on PyPI
pyvimA Vi/Vim-like text editor implemented entirely…
permissive · top 15,000 on PyPI