Skip to content

Instantly share code, notes, and snippets.

@avylove
Created May 19, 2023 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avylove/cf60fd20d30a4e64f1f139fa45f554ad to your computer and use it in GitHub Desktop.
Save avylove/cf60fd20d30a4e64f1f139fa45f554ad to your computer and use it in GitHub Desktop.
Unit prefix printing search results
Many projects, most old and unmaintained. Many projects implement use-specific
General human-friendliness packages:
- https://pypi.org/project/humanfriendly
- https://pypi.org/project/humanize
File sile specific packages:
- https://pypi.org/project/bitmath/
- https://pypi.org/project/byteformat/
- https://pypi.org/project/datasize/
- https://pypi.org/project/hurry.filesize/
- https://pypi.org/project/hfilesize/
SI prefix packages:
- https://pypi.org/project/si-prefix/
- https://pypi.org/project/si-prefix-parser/
- https://pypi.org/project/si/
- https://pypi.org/project/units-QBD/
Unit packages (These do more and are a different use case, but I've seen them used for simple unit conversion):
- https://pypi.org/project/Unum/
- https://pypi.org/project/si-units/
- https://quantiphy.readthedocs.io/en/stable/
- https://pypi.org/project/units/
- https://pypi.org/project/quantities/
- https://pypi.org/project/electronvolt/
Helper functions in other libraries
- django.template.defaultfilters.filesizeformat
- https://boltons.readthedocs.io/en/latest/strutils.html#boltons.strutils.bytes2human
- https://webhelpers2.readthedocs.io/en/latest/modules/number.html#number-formatting
Stack overflow:
- https://stackoverflow.com/questions/1094841/get-human-readable-version-of-file-size
- https://stackoverflow.com/questions/15733772/convert-float-number-to-string-with-engineering-notation-with-si-prefix-in-pyt
- https://stackoverflow.com/questions/55209311/how-do-i-format-a-number-using-si-prefix-micro-milli-mega-giga-etc
- https://stackoverflow.com/questions/56984560/how-to-format-a-float-with-a-si-prefix-k-m-in-python
- https://stackoverflow.com/questions/15733772/convert-float-number-to-string-with-engineering-notation-with-si-prefix-in-pyt
- https://stackoverflow.com/questions/68005050/b-billions-instead-of-g-giga-in-python-plotly-customdata-si-prefix-d3
- https://stackoverflow.com/questions/13343700/bytes-to-human-readable-and-back-without-data-loss/13449587#13449587
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment