Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Fork from hurry.filesize, A simple Python library for human readable file sizes (or anything sized in bytes).
I forked the repo from source file downloaded from pip hurry.filesize
.
That simple library is very useful when debugging memory issues, but
unfortunately out-of-maintainance since 2009, so I decided to fork
the great work of Martijn Faassen, Startifact.
calmsize a simple Python library that can take a number of bytes and returns a human-readable string with the size in it, in kilobytes (K), megabytes (M), etc.
The default system it uses is "traditional", where multipliers of 1024 increase the unit size::
>>> from calmsize import size, ByteSize
>>> size(1024)
'1K'
>>> size(-1024)
'-1K'
>>> '{:.2f}'.format(size(-1024))
'-1.00K'
An alternative, slightly more verbose system::
>>> from calmsize import alternative
>>> size(1, system=alternative)
'1 byte'
>>> size(10, system=alternative)
'10 bytes'
>>> size(1024, system=alternative)
'1 KB'
A verbose system::
>>> from calmsize import verbose
>>> size(10, system=verbose)
'10 bytes'
>>> size(1024, system=verbose)
'1 kilobyte'
>>> size(2000, system=verbose)
'1 kilobyte'
>>> size(3000, system=verbose)
'2 kilobytes'
>>> size(1024 * 1024, system=verbose)
'1 megabyte'
>>> size(1024 * 1024 * 3, system=verbose)
'3 megabytes'
You can also use the SI system, where multipliers of 1000 increase the unit size::
>>> from calmsize import si
>>> size(1000, system=si)
'1K'
FAQs
Fork from hurry.filesize, A simple Python library for human readable file sizes (or anything sized in bytes).
We found that calmsize demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.