Mercurial > repos > shellac > sam_consensus_v3
comparison env/lib/python3.9/site-packages/humanfriendly-9.1.dist-info/METADATA @ 0:4f3585e2f14b draft default tip
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
| author | shellac |
|---|---|
| date | Mon, 22 Mar 2021 18:12:50 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:4f3585e2f14b |
|---|---|
| 1 Metadata-Version: 2.1 | |
| 2 Name: humanfriendly | |
| 3 Version: 9.1 | |
| 4 Summary: Human friendly output for text interfaces using Python | |
| 5 Home-page: https://humanfriendly.readthedocs.io | |
| 6 Author: Peter Odding | |
| 7 Author-email: peter@peterodding.com | |
| 8 License: MIT | |
| 9 Platform: UNKNOWN | |
| 10 Classifier: Development Status :: 6 - Mature | |
| 11 Classifier: Environment :: Console | |
| 12 Classifier: Framework :: Sphinx :: Extension | |
| 13 Classifier: Intended Audience :: Developers | |
| 14 Classifier: Intended Audience :: System Administrators | |
| 15 Classifier: License :: OSI Approved :: MIT License | |
| 16 Classifier: Natural Language :: English | |
| 17 Classifier: Programming Language :: Python | |
| 18 Classifier: Programming Language :: Python :: 2 | |
| 19 Classifier: Programming Language :: Python :: 2.7 | |
| 20 Classifier: Programming Language :: Python :: 3 | |
| 21 Classifier: Programming Language :: Python :: 3.5 | |
| 22 Classifier: Programming Language :: Python :: 3.6 | |
| 23 Classifier: Programming Language :: Python :: 3.7 | |
| 24 Classifier: Programming Language :: Python :: 3.8 | |
| 25 Classifier: Programming Language :: Python :: Implementation :: CPython | |
| 26 Classifier: Programming Language :: Python :: Implementation :: PyPy | |
| 27 Classifier: Topic :: Communications | |
| 28 Classifier: Topic :: Scientific/Engineering :: Human Machine Interfaces | |
| 29 Classifier: Topic :: Software Development | |
| 30 Classifier: Topic :: Software Development :: Libraries :: Python Modules | |
| 31 Classifier: Topic :: Software Development :: User Interfaces | |
| 32 Classifier: Topic :: System :: Shells | |
| 33 Classifier: Topic :: System :: System Shells | |
| 34 Classifier: Topic :: System :: Systems Administration | |
| 35 Classifier: Topic :: Terminals | |
| 36 Classifier: Topic :: Text Processing :: General | |
| 37 Classifier: Topic :: Text Processing :: Linguistic | |
| 38 Classifier: Topic :: Utilities | |
| 39 Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.* | |
| 40 Requires-Dist: monotonic ; python_version == "2.7" | |
| 41 Requires-Dist: pyreadline ; sys_platform == "win32" | |
| 42 | |
| 43 humanfriendly: Human friendly input/output in Python | |
| 44 ==================================================== | |
| 45 | |
| 46 .. image:: https://travis-ci.org/xolox/python-humanfriendly.svg?branch=master | |
| 47 :target: https://travis-ci.org/xolox/python-humanfriendly | |
| 48 | |
| 49 .. image:: https://coveralls.io/repos/github/xolox/python-humanfriendly/badge.svg?branch=master | |
| 50 :target: https://coveralls.io/github/xolox/python-humanfriendly?branch=master | |
| 51 | |
| 52 The functions and classes in the `humanfriendly` package can be used to make | |
| 53 text interfaces more user friendly. Some example features: | |
| 54 | |
| 55 - Parsing and formatting numbers, file sizes, pathnames and timespans in | |
| 56 simple, human friendly formats. | |
| 57 | |
| 58 - Easy to use timers for long running operations, with human friendly | |
| 59 formatting of the resulting timespans. | |
| 60 | |
| 61 - Prompting the user to select a choice from a list of options by typing the | |
| 62 option's number or a unique substring of the option. | |
| 63 | |
| 64 - Terminal interaction including text styling (ANSI escape sequences), user | |
| 65 friendly rendering of usage messages and querying the terminal for its | |
| 66 size. | |
| 67 | |
| 68 The `humanfriendly` package is currently tested on Python 2.7, 3.5+ and PyPy | |
| 69 (2.7) on Linux and macOS. While the intention is to support Windows as well, | |
| 70 you may encounter some rough edges. | |
| 71 | |
| 72 .. contents:: | |
| 73 :local: | |
| 74 | |
| 75 Getting started | |
| 76 --------------- | |
| 77 | |
| 78 It's very simple to start using the `humanfriendly` package:: | |
| 79 | |
| 80 >>> import humanfriendly | |
| 81 >>> user_input = raw_input("Enter a readable file size: ") | |
| 82 Enter a readable file size: 16G | |
| 83 >>> num_bytes = humanfriendly.parse_size(user_input) | |
| 84 >>> print num_bytes | |
| 85 16000000000 | |
| 86 >>> print "You entered:", humanfriendly.format_size(num_bytes) | |
| 87 You entered: 16 GB | |
| 88 >>> print "You entered:", humanfriendly.format_size(num_bytes, binary=True) | |
| 89 You entered: 14.9 GiB | |
| 90 | |
| 91 Command line | |
| 92 ------------ | |
| 93 | |
| 94 .. A DRY solution to avoid duplication of the `humanfriendly --help' text: | |
| 95 .. | |
| 96 .. [[[cog | |
| 97 .. from humanfriendly.usage import inject_usage | |
| 98 .. inject_usage('humanfriendly.cli') | |
| 99 .. ]]] | |
| 100 | |
| 101 **Usage:** `humanfriendly [OPTIONS]` | |
| 102 | |
| 103 Human friendly input/output (text formatting) on the command | |
| 104 line based on the Python package with the same name. | |
| 105 | |
| 106 **Supported options:** | |
| 107 | |
| 108 .. csv-table:: | |
| 109 :header: Option, Description | |
| 110 :widths: 30, 70 | |
| 111 | |
| 112 | |
| 113 "``-c``, ``--run-command``","Execute an external command (given as the positional arguments) and render | |
| 114 a spinner and timer while the command is running. The exit status of the | |
| 115 command is propagated." | |
| 116 ``--format-table``,"Read tabular data from standard input (each line is a row and each | |
| 117 whitespace separated field is a column), format the data as a table and | |
| 118 print the resulting table to standard output. See also the ``--delimiter`` | |
| 119 option." | |
| 120 "``-d``, ``--delimiter=VALUE``","Change the delimiter used by ``--format-table`` to ``VALUE`` (a string). By default | |
| 121 all whitespace is treated as a delimiter." | |
| 122 "``-l``, ``--format-length=LENGTH``","Convert a length count (given as the integer or float ``LENGTH``) into a human | |
| 123 readable string and print that string to standard output." | |
| 124 "``-n``, ``--format-number=VALUE``","Format a number (given as the integer or floating point number ``VALUE``) with | |
| 125 thousands separators and two decimal places (if needed) and print the | |
| 126 formatted number to standard output." | |
| 127 "``-s``, ``--format-size=BYTES``","Convert a byte count (given as the integer ``BYTES``) into a human readable | |
| 128 string and print that string to standard output." | |
| 129 "``-b``, ``--binary``","Change the output of ``-s``, ``--format-size`` to use binary multiples of bytes | |
| 130 (base-2) instead of the default decimal multiples of bytes (base-10)." | |
| 131 "``-t``, ``--format-timespan=SECONDS``","Convert a number of seconds (given as the floating point number ``SECONDS``) | |
| 132 into a human readable timespan and print that string to standard output." | |
| 133 ``--parse-length=VALUE``,"Parse a human readable length (given as the string ``VALUE``) and print the | |
| 134 number of metres to standard output." | |
| 135 ``--parse-size=VALUE``,"Parse a human readable data size (given as the string ``VALUE``) and print the | |
| 136 number of bytes to standard output." | |
| 137 ``--demo``,"Demonstrate changing the style and color of the terminal font using ANSI | |
| 138 escape sequences." | |
| 139 "``-h``, ``--help``",Show this message and exit. | |
| 140 | |
| 141 .. [[[end]]] | |
| 142 | |
| 143 A note about size units | |
| 144 ----------------------- | |
| 145 | |
| 146 When I originally published the `humanfriendly` package I went with binary | |
| 147 multiples of bytes (powers of two). It was pointed out several times that this | |
| 148 was a poor choice (see issue `#4`_ and pull requests `#8`_ and `#9`_) and thus | |
| 149 the new default became decimal multiples of bytes (powers of ten): | |
| 150 | |
| 151 +------+---------------+---------------+ | |
| 152 | Unit | Binary value | Decimal value | | |
| 153 +------+---------------+---------------+ | |
| 154 | KB | 1024 | 1000 + | |
| 155 +------+---------------+---------------+ | |
| 156 | MB | 1048576 | 1000000 | | |
| 157 +------+---------------+---------------+ | |
| 158 | GB | 1073741824 | 1000000000 | | |
| 159 +------+---------------+---------------+ | |
| 160 | TB | 1099511627776 | 1000000000000 | | |
| 161 +------+---------------+---------------+ | |
| 162 | etc | | | | |
| 163 +------+---------------+---------------+ | |
| 164 | |
| 165 The option to use binary multiples of bytes remains by passing the keyword | |
| 166 argument `binary=True` to the `format_size()`_ and `parse_size()`_ functions. | |
| 167 | |
| 168 Windows support | |
| 169 --------------- | |
| 170 | |
| 171 Windows 10 gained native support for ANSI escape sequences which means commands | |
| 172 like ``humanfriendly --demo`` should work out of the box (if your system is | |
| 173 up-to-date enough). If this doesn't work then you can install the colorama_ | |
| 174 package, it will be used automatically once installed. | |
| 175 | |
| 176 Contact | |
| 177 ------- | |
| 178 | |
| 179 The latest version of `humanfriendly` is available on PyPI_ and GitHub_. The | |
| 180 documentation is hosted on `Read the Docs`_ and includes a changelog_. For bug | |
| 181 reports please create an issue on GitHub_. If you have questions, suggestions, | |
| 182 etc. feel free to send me an e-mail at `peter@peterodding.com`_. | |
| 183 | |
| 184 License | |
| 185 ------- | |
| 186 | |
| 187 This software is licensed under the `MIT license`_. | |
| 188 | |
| 189 © 2020 Peter Odding. | |
| 190 | |
| 191 .. External references: | |
| 192 .. _#4: https://github.com/xolox/python-humanfriendly/issues/4 | |
| 193 .. _#8: https://github.com/xolox/python-humanfriendly/pull/8 | |
| 194 .. _#9: https://github.com/xolox/python-humanfriendly/pull/9 | |
| 195 .. _changelog: https://humanfriendly.readthedocs.io/en/latest/changelog.html | |
| 196 .. _colorama: https://pypi.org/project/colorama | |
| 197 .. _format_size(): https://humanfriendly.readthedocs.io/en/latest/#humanfriendly.format_size | |
| 198 .. _GitHub: https://github.com/xolox/python-humanfriendly | |
| 199 .. _MIT license: https://en.wikipedia.org/wiki/MIT_License | |
| 200 .. _parse_size(): https://humanfriendly.readthedocs.io/en/latest/#humanfriendly.parse_size | |
| 201 .. _peter@peterodding.com: peter@peterodding.com | |
| 202 .. _PyPI: https://pypi.org/project/humanfriendly | |
| 203 .. _Read the Docs: https://humanfriendly.readthedocs.io | |
| 204 | |
| 205 |
