[issue31749] Request: Human readable byte amounts in the standard library

2020-08-28 Thread Avram
Avram added the comment: I looked through a lot of the suggested libraries and they all seemed either too specific to an implementation or didn't fully implement compatibility. So I created Prefixed to prove out the implementation of of an expanded format specification for float would look li

[issue31749] Request: Human readable byte amounts in the standard library

2019-05-29 Thread desbma
Change by desbma : -- nosy: +desbma ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/m

[issue31749] Request: Human readable byte amounts in the standard library

2017-10-29 Thread Martin Panter
Martin Panter added the comment: Ken Kundert started a related discussion a while back on Python-ideas: . This was about SI-prefixed units in general; not restricted to bytes. Also, the “timeit” mod

[issue31749] Request: Human readable byte amounts in the standard library

2017-10-11 Thread Jason Stelzer
Jason Stelzer added the comment: I often speak in generalizations and half thoughts. Feel free to cherry pick as much or a little as you want. Including a core shim of whatever is agreed to be the minimalist functionality with a SEE ALSO note or clue as to where to start would: * Resolve the

[issue31749] Request: Human readable byte amounts in the standard library

2017-10-11 Thread Rich
Rich added the comment: I think bitmath would be overkill to include in its entirety, but maybe there solution is a good one. There is also: https://pypi.python.org/pypi/byteformat/ https://pypi.python.org/pypi/datasize https://pypi.python.org/pypi/hurry.filesize https://pypi.python.org/pypi/

[issue31749] Request: Human readable byte amounts in the standard library

2017-10-11 Thread Jason Stelzer
Jason Stelzer added the comment: Just pointing out that this exists and seems active. https://github.com/tbielawa/bitmath Perhaps include some or all of it in core python? Crazier things have happened. -- nosy: +Jason Stelzer ___ Python tracker

[issue31749] Request: Human readable byte amounts in the standard library

2017-10-10 Thread Eric V. Smith
Eric V. Smith added the comment: A library implementing this should definitely go on PyPI first to shake out design issues. Then we'd need a PEP. As someone who has a simplistic version of this code around, and who's done a bit of string formatting, I can assure you that there are a lot of is

[issue31749] Request: Human readable byte amounts in the standard library

2017-10-10 Thread Rich
Rich added the comment: Yep, as I mentioned, it should be configurable to use either format. Localization is an excellent point as well, so, all in all, the optional arguments to the function are format, significant digits, and delimiter. That's not an unreasonable amount of configurability.

[issue31749] Request: Human readable byte amounts in the standard library

2017-10-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Do you mean decimal or binary prefixes? 123901842 bytes can be formatted as "118.2 MiB". In different areas decimal and binary prefixes can be more common. For example the volume of hard disks usually is specified with decimal prefixes, but the volume of RA

[issue31749] Request: Human readable byte amounts in the standard library

2017-10-10 Thread Timothy Allen
Timothy Allen added the comment: This would be a benefit to my team, for sure. I can't even tell you how many different solutions we currently use to make file sizes human readable - at least three. -- nosy: +FlipperPA ___ Python tracker

[issue31749] Request: Human readable byte amounts in the standard library

2017-10-10 Thread Michael DePalatis
Michael DePalatis added the comment: This would be a useful feature, but I don't think it quite fits in the math package. It might make more sense to use this with string formatting, for example: {:h}.format(filesize) where I use h as the format specifier since it doesn't appear to be taken

[issue31749] Request: Human readable byte amounts in the standard library

2017-10-10 Thread Rich
New submission from Rich : This problem is an _extremely_ common one, a problem that almost any Python project of a reasonable size will encounter. Given a number of bytes, say 123901842, format this as '123.9MB'. The reason I strongly think that this should be included in the standard librar