HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
prompt-toolkit
python-prompt-toolkit
Python2014–2025
prompt-toolkit / python-prompt-toolkit

python-prompt-toolkit

Library for building powerful interactive command line applications in Python

28Distinct people
30Mentions
0Explicit recommenders
10.6KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Library for building powerful interactive command line applications in Python

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 6:01:08 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year30 dated mentions

Observed mentions: 2014-09-30 01:44:04 UTC to 2025-02-09 23:00:17 UTC.

02462014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments20142015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 6 mentions; 0 submissions, 6 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC211
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC606
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC312
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC404
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC303
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC211
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC505
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC101
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC202
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC101
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC000
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
Python Prompt Toolkit prompt_toolkit is a library for building powerful interactive command line applications in Python. Read the documentation on readthedocs. Gallery ptpython is an interactive Python Shell, build on top of prompt_toolkit. More examples prompt_toolkit features prompt_toolkit could be a replacement for GNU readline, but it can be much more than that. Some features: Pure Python. Syntax highlighting of the input while typing. (For instance, with a Pygments lexer.) Multi-line input editing. Advanced code completion. Both Emacs and Vi key bindings. (Similar to readline.) Even some advanced Vi functionality, like named registers and digraphs. Reverse and forward incremental search. Works well with Unicode double width characters. (Chinese input.) Selecting text for copy/paste. (Both Emacs and Vi style.) Support for bracketed paste. Mouse support for cursor positioning and scrolling. Auto suggestions. (Like fish shell.) Multiple input buffers. No global state. Lightweight, the only dependencies are Pygments and wcwidth. Runs on Linux, OS X, FreeBSD, OpenBSD and Windows systems. And much more... Feel free to create tickets for bugs and feature requests, and create pull requests if you have nice patches that you would like to share with others. Installation pip install prompt_toolkit For Conda, do: conda install -c https://conda.anaconda.org/conda-forge prompt_toolkit About Windows support prompt_toolkit is cross platform, and everything that you build on top should run fine on both Unix and Windows systems. Windows support is best on recent Windows 10 builds, for which the command line window supports vt100 escape sequences. (If not supported, we fall back to using Win32 APIs for color and cursor movements). It's worth noting that the implementation is a "best effort of what is possible". Both Unix and Windows terminals have their limitations. But in general, the Unix experience will still be a little better. Getting started The most simple example of the library would look like this: from prompt_toolkit import prompt if __name__ == '__main__': answer = prompt('Give me some input: ') print('You said: %s' % answer) For more complex examples, have a look in the examples directory. All examples are chosen to demonstrate only one thing. Also, don't be afraid to look at the source code. The implementation of the prompt function could be a good start. Philosophy The source code of prompt_toolkit should be readable, concise and efficient. We prefer short functions focusing each on one task and for which the input and output types are clearly specified. We mostly prefer composition over inheritance, because inheritance can result in too much functionality in the same object. We prefer immutable objects where possible (objects don't change after initialization). Reusability is important. We absolutely refrain from having a changing global state, it should be possible to have multiple independent instances of the same code in the same process. The architecture should be layered: the lower levels operate on primitive operations and data structures giving -- when correctly combined -- all the possible flexibility; while at the higher level, there should be a simpler API, ready-to-use and sufficient for most use cases. Thinking about algorithms and efficiency is important, but avoid premature optimization. Projects using prompt_toolkit Special thanks to Pygments: Syntax highlighter. wcwidth: Determine columns needed for a wide characters.
Read the full README on GitHub

What Hacker News says

4 sources
Thanks for sharing! This is awesome because it's so much easier to embed than Python Prompt Toolkit, which IMO is the state of the art for building terminal-based interfaces. RxTerm is exciting though because it isn't constrained performance-wise, is MIT licensed and it compiles to native code and static binaries and overall lends a simpler packaging and distribution experience. https://github.com/jonathanslenders/python-prompt-toolkit
In Building Reactive Terminal Interfaces in C++

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.