@@ -5,29 +5,30 @@ Python Prompt Toolkit
5
5
6
6
.. image :: https://github.com/prompt-toolkit/python-prompt-toolkit/raw/master/docs/images/logo_400px.png
7
7
8
- *``prompt_toolkit`` is a library for building powerful interactive command line
9
- applications in Python. *
8
+ ``prompt_toolkit `` *is a library for building powerful interactive command line applications in Python. *
10
9
11
10
Read the `documentation on readthedocs
12
11
<http://python-prompt-toolkit.readthedocs.io/en/stable/> `_.
13
12
14
13
NOTICE: prompt_toolkit 3.0
15
14
**************************
16
15
17
- Please notice that this branch is the prompt_toolkit 3.0 branch. For most
18
- users, it should be compatible with prompt_toolkit 2.0, but it requires at
19
- least Python 3.6. On the plus side, prompt_toolkit 3.0 is completly type
16
+ Please notice that this branch is the `` prompt_toolkit `` ** 3.0 ** branch. For most
17
+ users, it should be compatible with `` prompt_toolkit `` ** 2.0 ** , but it requires at
18
+ least ** Python 3.6 ** . On the plus side, `` prompt_toolkit `` ** 3.0 ** is completly type
20
19
annotated and uses asyncio natively.
21
20
22
21
23
- Ptpython
24
- ********
22
+ Gallery
23
+ *******
25
24
26
25
`ptpython <http://github.com/prompt-toolkit/ptpython/ >`_ is an interactive
27
- Python Shell, build on top of prompt_toolkit.
26
+ Python Shell, build on top of `` prompt_toolkit `` .
28
27
29
28
.. image :: https://github.com/prompt-toolkit/python-prompt-toolkit/raw/master/docs/images/ptpython.png
30
29
30
+ `More examples <https://python-prompt-toolkit.readthedocs.io/en/stable/pages/gallery.html >`_
31
+ ^^^^
31
32
32
33
prompt_toolkit features
33
34
***********************
@@ -38,14 +39,13 @@ more than that.
38
39
39
40
Some features:
40
41
41
- - Pure Python.
42
+ - ** Pure Python ** .
42
43
- Syntax highlighting of the input while typing. (For instance, with a Pygments lexer.)
43
44
- Multi-line input editing.
44
45
- Advanced code completion.
45
46
- Both Emacs and Vi key bindings. (Similar to readline.)
46
47
- Even some advanced Vi functionality, like named registers and digraphs.
47
48
- Reverse and forward incremental search.
48
- - Runs on all Python versions from 2.6 up to 3.7.
49
49
- Works well with Unicode double width characters. (Chinese input.)
50
50
- Selecting text for copy/paste. (Both Emacs and Vi style.)
51
51
- Support for `bracketed paste <https://cirw.in/blog/bracketed-paste >`_.
@@ -61,6 +61,20 @@ Feel free to create tickets for bugs and feature requests, and create pull
61
61
requests if you have nice patches that you would like to share with others.
62
62
63
63
64
+ Installation
65
+ ************
66
+
67
+ ::
68
+
69
+ pip install prompt_toolkit
70
+
71
+ For Conda, do:
72
+
73
+ ::
74
+
75
+ conda install -c https://conda.anaconda.org/conda-forge prompt_toolkit
76
+
77
+
64
78
About Windows support
65
79
*********************
66
80
@@ -77,21 +91,6 @@ general, the Unix experience will still be a little better.
77
91
For Windows, it's recommended to use either `cmder
78
92
<http://cmder.net/> `_ or `conemu <https://conemu.github.io/ >`_.
79
93
80
-
81
- Installation
82
- ************
83
-
84
- ::
85
-
86
- pip install prompt_toolkit
87
-
88
- For Conda, do:
89
-
90
- ::
91
-
92
- conda install -c https://conda.anaconda.org/conda-forge prompt_toolkit
93
-
94
-
95
94
Getting started
96
95
***************
97
96
@@ -114,71 +113,11 @@ Note for Python 2: all strings are expected to be unicode strings. So, either
114
113
put a small ``u `` in front of every string or put ``from __future__ import
115
114
unicode_literals `` at the start of the above example.
116
115
117
-
118
- Projects using prompt_toolkit
119
- *****************************
120
-
121
- Shells:
122
-
123
- - `ptpython <http://github.com/prompt-toolkit/ptpython/ >`_: Python REPL
124
- - `ptpdb <http://github.com/jonathanslenders/ptpdb/ >`_: Python debugger (pdb replacement)
125
- - `pgcli <https://www.pgcli.com/ >`_: Postgres client.
126
- - `mycli <https://www.mycli.net/ >`_: MySql client.
127
- - `litecli <https://litecli.com/ >`_: SQLite client.
128
- - `wharfee <http://wharfee.com/ >`_: A Docker command line.
129
- - `xonsh <http://xon.sh/ >`_: A Python-ish, BASHwards-compatible shell.
130
- - `saws <https://github.com/donnemartin/saws >`_: A Supercharged AWS Command Line Interface.
131
- - `cycli <https://github.com/nicolewhite/cycli >`_: A Command Line Interface for Cypher.
132
- - `crash <https://github.com/crate/crash >`_: Crate command line client.
133
- - `vcli <https://github.com/dbcli/vcli >`_: Vertica client.
134
- - `aws-shell <https://github.com/awslabs/aws-shell >`_: An integrated shell for working with the AWS CLI.
135
- - `softlayer-python <https://github.com/softlayer/softlayer-python >`_: A command-line interface to manage various SoftLayer products and services.
136
- - `ipython <http://github.com/ipython/ipython/ >`_: The IPython REPL
137
- - `click-repl <https://github.com/click-contrib/click-repl >`_: Subcommand REPL for click apps.
138
- - `haxor-news <https://github.com/donnemartin/haxor-news >`_: A Hacker News CLI.
139
- - `gitsome <https://github.com/donnemartin/gitsome >`_: A Git/Shell Autocompleter with GitHub Integration.
140
- - `http-prompt <https://github.com/eliangcs/http-prompt >`_: An interactive command-line HTTP client.
141
- - `coconut <http://coconut-lang.org/ >`_: Functional programming in Python.
142
- - `Ergonomica <https://github.com/ergonomica/ergonomica >`_: A Bash alternative written in Python.
143
- - `Kube-shell <https://github.com/cloudnativelabs/kube-shell >`_: Kubernetes shell: An integrated shell for working with the Kubernetes CLI
144
- - `mssql-cli <https://github.com/dbcli/mssql-cli >`_: A command-line client for Microsoft SQL Server.
145
- - `robotframework-debuglibrary <https://github.com/xyb/robotframework-debuglibrary >`_: A debug library and REPL for RobotFramework.
146
- - `ptrepl <https://github.com/imomaliev/ptrepl >`_: Run any command as REPL
147
- - `clipwdmgr <https://github.com/samisalkosuo/clipasswordmgr >`_: Command Line Password Manager.
148
- - `slacker <https://github.com/netromdk/slacker >`_: Easy access to the Slack API and admin of workspaces via REPL.
149
- - `EdgeDB <https://edgedb.com/ >`_: The next generation object-relational database.
150
- - `pywit <https://github.com/wit-ai/pywit >`_: Python library for Wit.ai.
151
- - `objection <https://github.com/sensepost/objection >`_: Runtime Mobile Exploration.
152
- - `habu <https://github.com/portantier/habu >`_: Python Network Hacking Toolkit.
153
- - `nawano <https://github.com/rbw/nawano >`_: Nano cryptocurrency wallet
154
- - `athenacli <https://github.com/dbcli/athenacli >`_: A CLI for AWS Athena.
155
- - `vulcano <https://github.com/dgarana/vulcano >`_: A framework for creating command-line applications that also runs in REPL mode.
156
- - `kafka-shell <https://github.com/devshawn/kafka-shell >`_: A supercharged shell for Apache Kafka.
157
-
158
- Full screen applications:
159
-
160
- - `pymux <http://github.com/prompt-toolkit/pymux/ >`_: A terminal multiplexer (like tmux) in pure Python.
161
- - `pyvim <http://github.com/prompt-toolkit/pyvim/ >`_: A Vim clone in pure Python.
162
- - `freud <http://github.com/stloma/freud/ >`_: REST client backed by SQLite for storing servers
163
- - `pypager <https://github.com/prompt-toolkit/pypager >`_: A $PAGER in pure Python (like "less").
164
- - `kubeterminal <https://github.com/samisalkosuo/kubeterminal >`_: Kubectl helper tool.
165
-
166
- Libraries:
167
-
168
- - `ptterm <https://github.com/prompt-toolkit/ptterm >`_: A terminal emulator
169
- widget for prompt_toolkit.
170
- - `PyInquirer <https://github.com/CITGuru/PyInquirer/ >`_: A Python library that
171
- wants to make it easy for existing Inquirer.js users to write immersive
172
- command line applications in Python.
173
-
174
- (Want your own project to be listed here? Please create a GitHub issue.)
175
-
176
-
177
116
Philosophy
178
117
**********
179
118
180
- The source code of ``prompt_toolkit `` should be readable, concise and
181
- efficient. We prefer short functions focusing each on one task and for which
119
+ The source code of ``prompt_toolkit `` should be ** readable **, ** concise ** and
120
+ ** efficient ** . We prefer short functions focusing each on one task and for which
182
121
the input and output types are clearly specified. We mostly prefer composition
183
122
over inheritance, because inheritance can result in too much functionality in
184
123
the same object. We prefer immutable objects where possible (objects don't
@@ -192,6 +131,9 @@ sufficient for most use cases. Thinking about algorithms and efficiency is
192
131
important, but avoid premature optimization.
193
132
194
133
134
+ `Projects using prompt_toolkit <PROJECTS.rst >`_
135
+ ***********************************************
136
+
195
137
Special thanks to
196
138
*****************
197
139
@@ -217,10 +159,3 @@ Special thanks to
217
159
.. |Codecov | image :: https://codecov.io/gh/prompt-toolkit/python-prompt-toolkit/branch/master/graphs/badge.svg?style=flat
218
160
:target: https://codecov.io/gh/prompt-toolkit/python-prompt-toolkit/
219
161
220
-
221
- Other libraries and implementations in other languages
222
- ******************************************************
223
-
224
- - `go-prompt <https://github.com/c-bata/go-prompt >`_: building a powerful
225
- interactive prompt in Go, inspired by python-prompt-toolkit.
226
- - `urwid <http://urwid.org/ >`_: Console user interface library for Python.
0 commit comments