Human readable output in bits
<p>I have looked at the modules <em>humanize</em> and <em>humanfriendly</em>, and neither can convert a large bit value to human readable bit output (e.g. Mbits, Gbits, Tbits, ..etc).  Has anyone come across such a module?  Example:</p>

<pre><code>mbits = 1000000
gbits = 1000000000
</code></pre>

<p>Then    </p>

<pre><code>print(human.bits(mbits)) # would output "1 Mbit"
print(human.bits(gbits)) # would output "1 Gbit"
</code></pre>

<p>...etc, up to exabit.</p>

<p>You can try <code>hurry.filesize</code></p>

<pre><code>&gt;&gt;&gt; from hurry.filesize import size
&gt;&gt;&gt; size(11000)
'10K'
</code></pre>

<p>There is another library <code>bitmath</code></p>

<pre><code>&gt;&gt;&gt; from bitmath import *
&gt;&gt;&gt; small_number = MiB(10000)
&gt;&gt;&gt; print small_number.best_prefix()
9.765625 GiB
</code></pre>

python