__init__.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. """
  2. prompt_toolkit
  3. ==============
  4. Author: Jonathan Slenders
  5. Description: prompt_toolkit is a Library for building powerful interactive
  6. command lines in Python. It can be a replacement for GNU
  7. Readline, but it can be much more than that.
  8. See the examples directory to learn about the usage.
  9. Probably, to get started, you might also want to have a look at
  10. `prompt_toolkit.shortcuts.prompt`.
  11. """
  12. from __future__ import annotations
  13. import re
  14. # note: this is a bit more lax than the actual pep 440 to allow for a/b/rc/dev without a number
  15. pep440 = re.compile(
  16. r"^([1-9]\d*!)?(0|[1-9]\d*)(\.(0|[1-9]\d*))*((a|b|rc)(0|[1-9]\d*)?)?(\.post(0|[1-9]\d*))?(\.dev(0|[1-9]\d*)?)?$",
  17. re.UNICODE,
  18. )
  19. from .application import Application
  20. from .formatted_text import ANSI, HTML
  21. from .shortcuts import PromptSession, print_formatted_text, prompt
  22. # Don't forget to update in `docs/conf.py`!
  23. __version__ = "3.0.47"
  24. assert pep440.match(__version__)
  25. # Version tuple.
  26. VERSION = tuple(int(v.rstrip("abrc")) for v in __version__.split(".")[:3])
  27. __all__ = [
  28. # Application.
  29. "Application",
  30. # Shortcuts.
  31. "prompt",
  32. "PromptSession",
  33. "print_formatted_text",
  34. # Formatted text.
  35. "HTML",
  36. "ANSI",
  37. # Version info.
  38. "__version__",
  39. "VERSION",
  40. ]