bitmath
bitmath copied to clipboard
Python module for representing file sizes with different prefix notations
Hi, I find this a bit unintuitive: >>> bitmath.KiB(1/3).to_Bit() Bit(2730.6666666666665) I would expect this to throw an exception (I did not specify an integer count of bytes). There seems to...
- allows specifying precision in inline string formatting - e.g. 'size: {:0.1f}'.format(s) - using standard string formatting, not just bitmath.format - adds corresponding tests Short description: Adds a __format__ method...
Even if progressbar is not used, using the click integration requires that progressbar be installed otherwise error: "ModuleNotFoundError: No module named 'progressbar'" is produced. It seems that progressbar shouldn't be...
The ```best_prefix``` of a bit unit comes as MegaByte. b -> M How to REPRODUCE the issue: ``` >>> import bitmath >>> b = bitmath.Bit(30950093.15655963) >>> b Bit(30950093.15655963) >>> b.best_prefix()...
While I can see reasons for it, it's counterintuitive that adding 1 to a Byte would make it a float rather than a Byte one increment higher. This limits the...
Howdy! Right now, most strings use abbreviations. However, "Byte" is still written out all the way. This can cause consistency issues. For example: ```python import bitmath with bitmath.format(fmt_str="{value:.2f} {unit}"): formatted_size...
follow up of https://github.com/tbielawa/bitmath/issues/69, seems to work but still need to clean.
Copied from Ankur Sinha (FranciscoD) on bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=1654747 ``` python-progressbar2 is a much better maintained, more featured fork of progressbar which had gone inactive in the past. Would it please...
Using the latest version of bitmath, im trying to convert a bit value into the best bit prefix. as seen below the output is always converted to bytes, I would...
Using the format context manager in a threaded environment introduces a race condition where the global formatter and global plural flag can be reset by one context manager after another...