METADATA 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. Metadata-Version: 2.4
  2. Name: prompt_toolkit
  3. Version: 3.0.52
  4. Summary: Library for building powerful interactive command lines in Python
  5. Author: Jonathan Slenders
  6. Project-URL: Homepage, https://github.com/prompt-toolkit/python-prompt-toolkit
  7. Project-URL: Documentation, https://python-prompt-toolkit.readthedocs.io/en/stable/
  8. Classifier: Development Status :: 5 - Production/Stable
  9. Classifier: Intended Audience :: Developers
  10. Classifier: License :: OSI Approved :: BSD License
  11. Classifier: Operating System :: OS Independent
  12. Classifier: Programming Language :: Python :: 3
  13. Classifier: Programming Language :: Python :: 3.8
  14. Classifier: Programming Language :: Python :: 3.9
  15. Classifier: Programming Language :: Python :: 3.10
  16. Classifier: Programming Language :: Python :: 3.11
  17. Classifier: Programming Language :: Python :: 3.12
  18. Classifier: Programming Language :: Python :: 3.13
  19. Classifier: Programming Language :: Python :: 3 :: Only
  20. Classifier: Programming Language :: Python
  21. Classifier: Topic :: Software Development
  22. Requires-Python: >=3.8
  23. Description-Content-Type: text/x-rst
  24. License-File: LICENSE
  25. License-File: AUTHORS.rst
  26. Requires-Dist: wcwidth
  27. Dynamic: license-file
  28. Python Prompt Toolkit
  29. =====================
  30. |AppVeyor| |PyPI| |RTD| |License| |Codecov|
  31. .. image :: /docs/images/logo_400px.png
  32. ``prompt_toolkit`` *is a library for building powerful interactive command line applications in Python.*
  33. Read the `documentation on readthedocs
  34. <http://python-prompt-toolkit.readthedocs.io/en/stable/>`_.
  35. Gallery
  36. *******
  37. `ptpython <http://github.com/prompt-toolkit/ptpython/>`_ is an interactive
  38. Python Shell, build on top of ``prompt_toolkit``.
  39. .. image :: /docs/images/ptpython.png
  40. `More examples <https://python-prompt-toolkit.readthedocs.io/en/stable/pages/gallery.html>`_
  41. prompt_toolkit features
  42. ***********************
  43. ``prompt_toolkit`` could be a replacement for `GNU readline
  44. <https://tiswww.case.edu/php/chet/readline/rltop.html>`_, but it can be much
  45. more than that.
  46. Some features:
  47. - **Pure Python**.
  48. - Syntax highlighting of the input while typing. (For instance, with a Pygments lexer.)
  49. - Multi-line input editing.
  50. - Advanced code completion.
  51. - Both Emacs and Vi key bindings. (Similar to readline.)
  52. - Even some advanced Vi functionality, like named registers and digraphs.
  53. - Reverse and forward incremental search.
  54. - Works well with Unicode double width characters. (Chinese input.)
  55. - Selecting text for copy/paste. (Both Emacs and Vi style.)
  56. - Support for `bracketed paste <https://cirw.in/blog/bracketed-paste>`_.
  57. - Mouse support for cursor positioning and scrolling.
  58. - Auto suggestions. (Like `fish shell <http://fishshell.com/>`_.)
  59. - Multiple input buffers.
  60. - No global state.
  61. - Lightweight, the only dependencies are Pygments and wcwidth.
  62. - Runs on Linux, OS X, FreeBSD, OpenBSD and Windows systems.
  63. - And much more...
  64. Feel free to create tickets for bugs and feature requests, and create pull
  65. requests if you have nice patches that you would like to share with others.
  66. Installation
  67. ************
  68. ::
  69. pip install prompt_toolkit
  70. For Conda, do:
  71. ::
  72. conda install -c https://conda.anaconda.org/conda-forge prompt_toolkit
  73. About Windows support
  74. *********************
  75. ``prompt_toolkit`` is cross platform, and everything that you build on top
  76. should run fine on both Unix and Windows systems. Windows support is best on
  77. recent Windows 10 builds, for which the command line window supports vt100
  78. escape sequences. (If not supported, we fall back to using Win32 APIs for color
  79. and cursor movements).
  80. It's worth noting that the implementation is a "best effort of what is
  81. possible". Both Unix and Windows terminals have their limitations. But in
  82. general, the Unix experience will still be a little better.
  83. Getting started
  84. ***************
  85. The most simple example of the library would look like this:
  86. .. code:: python
  87. from prompt_toolkit import prompt
  88. if __name__ == '__main__':
  89. answer = prompt('Give me some input: ')
  90. print('You said: %s' % answer)
  91. For more complex examples, have a look in the ``examples`` directory. All
  92. examples are chosen to demonstrate only one thing. Also, don't be afraid to
  93. look at the source code. The implementation of the ``prompt`` function could be
  94. a good start.
  95. Philosophy
  96. **********
  97. The source code of ``prompt_toolkit`` should be **readable**, **concise** and
  98. **efficient**. We prefer short functions focusing each on one task and for which
  99. the input and output types are clearly specified. We mostly prefer composition
  100. over inheritance, because inheritance can result in too much functionality in
  101. the same object. We prefer immutable objects where possible (objects don't
  102. change after initialization). Reusability is important. We absolutely refrain
  103. from having a changing global state, it should be possible to have multiple
  104. independent instances of the same code in the same process. The architecture
  105. should be layered: the lower levels operate on primitive operations and data
  106. structures giving -- when correctly combined -- all the possible flexibility;
  107. while at the higher level, there should be a simpler API, ready-to-use and
  108. sufficient for most use cases. Thinking about algorithms and efficiency is
  109. important, but avoid premature optimization.
  110. `Projects using prompt_toolkit <PROJECTS.rst>`_
  111. ***********************************************
  112. Special thanks to
  113. *****************
  114. - `Pygments <http://pygments.org/>`_: Syntax highlighter.
  115. - `wcwidth <https://github.com/jquast/wcwidth>`_: Determine columns needed for a wide characters.
  116. .. |PyPI| image:: https://img.shields.io/pypi/v/prompt_toolkit.svg
  117. :target: https://pypi.python.org/pypi/prompt-toolkit/
  118. :alt: Latest Version
  119. .. |AppVeyor| image:: https://ci.appveyor.com/api/projects/status/32r7s2skrgm9ubva?svg=true
  120. :target: https://ci.appveyor.com/project/prompt-toolkit/python-prompt-toolkit/
  121. .. |RTD| image:: https://readthedocs.org/projects/python-prompt-toolkit/badge/
  122. :target: https://python-prompt-toolkit.readthedocs.io/en/master/
  123. .. |License| image:: https://img.shields.io/github/license/prompt-toolkit/python-prompt-toolkit.svg
  124. :target: https://github.com/prompt-toolkit/python-prompt-toolkit/blob/master/LICENSE
  125. .. |Codecov| image:: https://codecov.io/gh/prompt-toolkit/python-prompt-toolkit/branch/master/graphs/badge.svg?style=flat
  126. :target: https://codecov.io/gh/prompt-toolkit/python-prompt-toolkit/