What is sizelib?
sizelib is a Python library for calculating and humanizing file sizes, times, frequencies & data transfer rates. It offers a zero-overhead and highly readable API.
- Size Helper Functions – Define constraints easily using binary (base 2 / 1024) or decimal (base 10 / 1000) helper methods.
- Humanizing Byte Sizes – Convert raw byte values back into clean, readable strings using the
human_size()function. - Time Helper Functions – Define time constraints cleanly in seconds using duration unit methods (
ms,s,m,h,d,w,m28..m31,y,ly). - Humanizing Times – Convert raw second values into readable duration strings using the
human_time()function. - Frequency Helper Functions – Define frequency constraints cleanly in Hertz using frequency unit methods (
hz,khz,mhz,ghz,thz,phz,ehz,zhz,yhz). - Humanizing Frequencies – Convert raw Hertz values into readable frequency strings using the
human_freq()function. - Rate Helper Functions – Define data transfer rate and bandwidth constraints cleanly using bit and byte rate methods (
bps..ybps,b_s,kib_s..yib_s,kb_s..yb_s). - Type Preservation – Dynamically maintains input types (
intorfloat) across all calculations. - Zero Overhead & Dependencies – Pure-Python library with zero external dependencies.