Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python
ANNOUNCE: byteformat0.2a
 

Index | Next | Previous | View Flat


steve+comp.lang.python at pearwood

May 15, 2012, 1:30 AM


Views: 89
Permalink
ANNOUNCE: byteformat0.2a

I am pleased to announce a new release of byteformat.


http://pypi.python.org/pypi/byteformat


byteformat is a Python module for intelligently formatting numbers of
bytes using common human-readable strings:

>>> from byteformat import format
>>> format(12000)
'12 KB'
>>> format(5100000, style='ABBREV')
'5.1 Mbytes'
>>> format(48500000000000, style='LONG')
'48.5 terabytes'


byteformat understands SI decimal units, IEC binary units, and mixed
units:

>>> format(12000, scheme='IEC')
'11.7 KiB'
>>> format(12000, scheme='MIXED')
'11.7 KB'


You can also specify which prefix to use:

>>> format(48500000000000, style='LONG', prefix='M')
'48500000 megabytes'


byteformat can be used as a command-line tool:

[steve [at] and ~]$ python -m byteformat --prefix=K 1000 12300 145000
1 KB
12.3 KB
145 KB


byteformat understands all the relevant SI and IEC unit prefixes, and is
released under the MIT licence.



--
Steven
--
http://mail.python.org/mailman/listinfo/python-list

Subject User Time
ANNOUNCE: byteformat0.2a steve+comp.lang.python at pearwood May 15, 2012, 1:30 AM
    Re: ANNOUNCE: byteformat0.2a kliateni at gmail May 15, 2012, 1:52 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.