You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

152 lines
3.5 KiB

4 years ago
  1. Metadata-Version: 2.1
  2. Name: progress
  3. Version: 1.4
  4. Summary: Easy to use progress bars
  5. Home-page: http://github.com/verigak/progress/
  6. Author: Giorgos Verigakis
  7. Author-email: verigak@gmail.com
  8. License: ISC
  9. Platform: UNKNOWN
  10. Classifier: Environment :: Console
  11. Classifier: Intended Audience :: Developers
  12. Classifier: License :: OSI Approved :: ISC License (ISCL)
  13. Classifier: Programming Language :: Python :: 2.6
  14. Classifier: Programming Language :: Python :: 2.7
  15. Classifier: Programming Language :: Python :: 3.3
  16. Classifier: Programming Language :: Python :: 3.4
  17. Classifier: Programming Language :: Python :: 3.5
  18. Classifier: Programming Language :: Python :: 3.6
  19. Easy progress reporting for Python
  20. ==================================
  21. |pypi|
  22. |demo|
  23. .. |pypi| image:: https://img.shields.io/pypi/v/progress.svg
  24. .. |demo| image:: https://raw.github.com/verigak/progress/master/demo.gif
  25. :alt: Demo
  26. Bars
  27. ----
  28. There are 7 progress bars to choose from:
  29. - ``Bar``
  30. - ``ChargingBar``
  31. - ``FillingSquaresBar``
  32. - ``FillingCirclesBar``
  33. - ``IncrementalBar``
  34. - ``PixelBar``
  35. - ``ShadyBar``
  36. To use them, just call ``next`` to advance and ``finish`` to finish:
  37. .. code-block:: python
  38. from progress.bar import Bar
  39. bar = Bar('Processing', max=20)
  40. for i in range(20):
  41. # Do some work
  42. bar.next()
  43. bar.finish()
  44. The result will be a bar like the following: ::
  45. Processing |############# | 42/100
  46. To simplify the common case where the work is done in an iterator, you can
  47. use the ``iter`` method:
  48. .. code-block:: python
  49. for i in Bar('Processing').iter(it):
  50. # Do some work
  51. Progress bars are very customizable, you can change their width, their fill
  52. character, their suffix and more:
  53. .. code-block:: python
  54. bar = Bar('Loading', fill='@', suffix='%(percent)d%%')
  55. This will produce a bar like the following: ::
  56. Loading |@@@@@@@@@@@@@ | 42%
  57. You can use a number of template arguments in ``message`` and ``suffix``:
  58. ========== ================================
  59. Name Value
  60. ========== ================================
  61. index current value
  62. max maximum value
  63. remaining max - index
  64. progress index / max
  65. percent progress * 100
  66. avg simple moving average time per item (in seconds)
  67. elapsed elapsed time in seconds
  68. elapsed_td elapsed as a timedelta (useful for printing as a string)
  69. eta avg * remaining
  70. eta_td eta as a timedelta (useful for printing as a string)
  71. ========== ================================
  72. Instead of passing all configuration options on instatiation, you can create
  73. your custom subclass:
  74. .. code-block:: python
  75. class FancyBar(Bar):
  76. message = 'Loading'
  77. fill = '*'
  78. suffix = '%(percent).1f%% - %(eta)ds'
  79. You can also override any of the arguments or create your own:
  80. .. code-block:: python
  81. class SlowBar(Bar):
  82. suffix = '%(remaining_hours)d hours remaining'
  83. @property
  84. def remaining_hours(self):
  85. return self.eta // 3600
  86. Spinners
  87. ========
  88. For actions with an unknown number of steps you can use a spinner:
  89. .. code-block:: python
  90. from progress.spinner import Spinner
  91. spinner = Spinner('Loading ')
  92. while state != 'FINISHED':
  93. # Do some work
  94. spinner.next()
  95. There are 5 predefined spinners:
  96. - ``Spinner``
  97. - ``PieSpinner``
  98. - ``MoonSpinner``
  99. - ``LineSpinner``
  100. - ``PixelSpinner``
  101. Other
  102. =====
  103. There are a number of other classes available too, please check the source or
  104. subclass one of them to create your own.
  105. License
  106. =======
  107. progress is licensed under ISC