METADATA 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. Metadata-Version: 2.1
  2. Name: prompt-toolkit
  3. Version: 1.0.18
  4. Summary: Library for building powerful interactive command lines in Python
  5. Home-page: https://github.com/jonathanslenders/python-prompt-toolkit
  6. Author: Jonathan Slenders
  7. Author-email: UNKNOWN
  8. License: UNKNOWN
  9. Platform: UNKNOWN
  10. Classifier: Development Status :: 5 - Production/Stable
  11. Classifier: Intended Audience :: Developers
  12. Classifier: License :: OSI Approved :: BSD License
  13. Classifier: Operating System :: OS Independent
  14. Classifier: Programming Language :: Python :: 2
  15. Classifier: Programming Language :: Python :: 2.6
  16. Classifier: Programming Language :: Python :: 2.7
  17. Classifier: Programming Language :: Python :: 3
  18. Classifier: Programming Language :: Python :: 3.3
  19. Classifier: Programming Language :: Python :: 3.4
  20. Classifier: Programming Language :: Python :: 3.5
  21. Classifier: Programming Language :: Python
  22. Classifier: Topic :: Software Development
  23. Requires-Dist: six (>=1.9.0)
  24. Requires-Dist: wcwidth
  25. Python Prompt Toolkit
  26. =====================
  27. |Build Status| |PyPI|
  28. ``prompt_toolkit`` is a library for building powerful interactive command lines
  29. and terminal applications in Python.
  30. Read the `documentation on readthedocs
  31. <http://python-prompt-toolkit.readthedocs.io/en/stable/>`_.
  32. Ptpython
  33. ********
  34. `ptpython <http://github.com/jonathanslenders/ptpython/>`_ is an interactive
  35. Python Shell, build on top of prompt_toolkit.
  36. .. image :: https://github.com/jonathanslenders/python-prompt-toolkit/raw/master/docs/images/ptpython.png
  37. prompt_toolkit features
  38. ***********************
  39. ``prompt_toolkit`` could be a replacement for `GNU readline
  40. <http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html>`_, but it can be much
  41. more than that.
  42. Some features:
  43. - Pure Python.
  44. - Syntax highlighting of the input while typing. (For instance, with a Pygments lexer.)
  45. - Multi-line input editing.
  46. - Advanced code completion.
  47. - Both Emacs and Vi key bindings. (Similar to readline.)
  48. - Even some advanced Vi functionality, like named registers and digraphs.
  49. - Reverse and forward incremental search.
  50. - Runs on all Python versions from 2.6 up to 3.5.
  51. - Works well with Unicode double width characters. (Chinese input.)
  52. - Selecting text for copy/paste. (Both Emacs and Vi style.)
  53. - Support for `bracketed paste <https://cirw.in/blog/bracketed-paste>`_.
  54. - Mouse support for cursor positioning and scrolling.
  55. - Auto suggestions. (Like `fish shell <http://fishshell.com/>`_.)
  56. - Multiple input buffers.
  57. - No global state.
  58. - Lightweight, the only dependencies are Pygments, six and wcwidth.
  59. - Runs on Linux, OS X, FreeBSD, OpenBSD and Windows systems.
  60. - And much more...
  61. Feel free to create tickets for bugs and feature requests, and create pull
  62. requests if you have nice patches that you would like to share with others.
  63. About Windows support
  64. *********************
  65. ``prompt_toolkit`` is cross platform, and everything that you build on top
  66. should run fine on both Unix and Windows systems. On Windows, it uses a
  67. different event loop (``WaitForMultipleObjects`` instead of ``select``), and
  68. another input and output system. (Win32 APIs instead of pseudo-terminals and
  69. VT100.)
  70. It's worth noting that the implementation is a "best effort of what is
  71. possible". Both Unix and Windows terminals have their limitations. But in
  72. general, the Unix experience will still be a little better.
  73. For Windows, it's recommended to use either `cmder
  74. <http://cmder.net/>`_ or `conemu <https://conemu.github.io/>`_.
  75. Installation
  76. ************
  77. ::
  78. pip install prompt_toolkit
  79. For Conda, do:
  80. ::
  81. conda install -c https://conda.anaconda.org/conda-forge prompt_toolkit
  82. Getting started
  83. ***************
  84. The most simple example of the library would look like this:
  85. .. code:: python
  86. from prompt_toolkit import prompt
  87. if __name__ == '__main__':
  88. answer = prompt('Give me some input: ')
  89. print('You said: %s' % answer)
  90. For more complex examples, have a look in the ``examples`` directory. All
  91. examples are chosen to demonstrate only one thing. Also, don't be afraid to
  92. look at the source code. The implementation of the ``prompt`` function could be
  93. a good start.
  94. Note for Python 2: all strings are expected to be unicode strings. So, either
  95. put a small ``u`` in front of every string or put ``from __future__ import
  96. unicode_literals`` at the start of the above example.
  97. Projects using prompt_toolkit
  98. *****************************
  99. Shells:
  100. - `ptpython <http://github.com/jonathanslenders/ptpython/>`_: Python REPL
  101. - `ptpdb <http://github.com/jonathanslenders/ptpdb/>`_: Python debugger (pdb replacement)
  102. - `pgcli <http://pgcli.com/>`_: Postgres client.
  103. - `mycli <http://mycli.net>`_: MySql client.
  104. - `wharfee <http://wharfee.com/>`_: A Docker command line.
  105. - `xonsh <http://xon.sh/>`_: A Python-ish, BASHwards-compatible shell.
  106. - `saws <https://github.com/donnemartin/saws>`_: A Supercharged AWS Command Line Interface.
  107. - `cycli <https://github.com/nicolewhite/cycli>`_: A Command Line Interface for Cypher.
  108. - `crash <https://github.com/crate/crash>`_: Crate command line client.
  109. - `vcli <https://github.com/dbcli/vcli>`_: Vertica client.
  110. - `aws-shell <https://github.com/awslabs/aws-shell>`_: An integrated shell for working with the AWS CLI.
  111. - `softlayer-python <https://github.com/softlayer/softlayer-python>`_: A command-line interface to manage various SoftLayer products and services.
  112. - `ipython <http://github.com/ipython/ipython/>`_: The IPython REPL
  113. - `click-repl <https://github.com/click-contrib/click-repl>`_: Subcommand REPL for click apps.
  114. - `haxor-news <https://github.com/donnemartin/haxor-news>`_: A Hacker News CLI.
  115. - `gitsome <https://github.com/donnemartin/gitsome>`_: A Git/Shell Autocompleter with GitHub Integration.
  116. - `http-prompt <https://github.com/eliangcs/http-prompt>`_: An interactive command-line HTTP client.
  117. - `coconut <http://coconut-lang.org/>`_: Functional programming in Python.
  118. - `Ergonomica <https://ergonomica.github.io/>`_: A Bash alternative written in Python.
  119. - `Kube-shell <https://github.com/cloudnativelabs/kube-shell>`_: Kubernetes shell: An integrated shell for working with the Kubernetes CLI
  120. Full screen applications:
  121. - `pymux <http://github.com/jonathanslenders/pymux/>`_: A terminal multiplexer (like tmux) in pure Python.
  122. - `pyvim <http://github.com/jonathanslenders/pyvim/>`_: A Vim clone in pure Python.
  123. (Want your own project to be listed here? Please create a GitHub issue.)
  124. Philosophy
  125. **********
  126. The source code of ``prompt_toolkit`` should be readable, concise and
  127. efficient. We prefer short functions focussing each on one task and for which
  128. the input and output types are clearly specified. We mostly prefer composition
  129. over inheritance, because inheritance can result in too much functionality in
  130. the same object. We prefer immutable objects where possible (objects don't
  131. change after initialisation). Reusability is important. We absolutely refrain
  132. from having a changing global state, it should be possible to have multiple
  133. independent instances of the same code in the same process. The architecture
  134. should be layered: the lower levels operate on primitive operations and data
  135. structures giving -- when correctly combined -- all the possible flexibility;
  136. while at the higher level, there should be a simpler API, ready-to-use and
  137. sufficient for most use cases. Thinking about algorithms and efficiency is
  138. important, but avoid premature optimization.
  139. Special thanks to
  140. *****************
  141. - `Pygments <http://pygments.org/>`_: Syntax highlighter.
  142. - `wcwidth <https://github.com/jquast/wcwidth>`_: Determine columns needed for a wide characters.
  143. .. |Build Status| image:: https://api.travis-ci.org/jonathanslenders/python-prompt-toolkit.svg?branch=master
  144. :target: https://travis-ci.org/jonathanslenders/python-prompt-toolkit#
  145. .. |PyPI| image:: https://img.shields.io/pypi/v/prompt_toolkit.svg
  146. :target: https://pypi.python.org/pypi/prompt-toolkit/
  147. :alt: Latest Version