{"id":5253,"library":"hurry-filesize","title":"Hurry Filesize","description":"Hurry Filesize is a simple Python library, version 0.9, designed to convert a number of bytes into a human-readable string (e.g., '1K', '2M'). First released in 2009, it provides various systems for formatting, including traditional (1024 multipliers), SI (1000 multipliers), and verbose options. Due to its age, it maintains a very low release cadence, with its current version being its initial public release.","status":"maintenance","version":"0.9","language":"en","source_language":"en","source_url":"https://pypi.org/project/hurry.filesize/","tags":["filesize","human-readable","bytes","utility"],"install":[{"cmd":"pip install hurry.filesize","lang":"bash","label":"Install with pip"}],"dependencies":[],"imports":[{"note":"This imports the primary function for human-readable sizing using the default 'traditional' system (1024 multipliers).","symbol":"size","correct":"from hurry.filesize import size"},{"note":"Imports an alternative system constant for more verbose output (e.g., '1 KB', '1 byte').","symbol":"alternative","correct":"from hurry.filesize import alternative"},{"note":"Imports the SI system constant for 1000 multipliers (e.g., '1K' for 1000 bytes).","symbol":"si","correct":"from hurry.filesize import si"},{"note":"Imports a verbose system constant for full unit names (e.g., '1 kilobyte', '1 megabyte').","symbol":"verbose","correct":"from hurry.filesize import verbose"}],"quickstart":{"code":"from hurry.filesize import size, alternative, si, verbose\n\nbytes_value = 1024 * 1024 * 3.5 # 3.5 MB\n\nprint(f\"Default: {size(bytes_value)}\")\nprint(f\"Alternative: {size(bytes_value, system=alternative)}\")\nprint(f\"SI: {size(bytes_value, system=si)}\")\nprint(f\"Verbose: {size(bytes_value, system=verbose)}\")\n\n# Example with smaller values\nprint(f\"10 bytes (default): {size(10)}\")\nprint(f\"10 bytes (alternative): {size(10, system=alternative)}\")\nprint(f\"10 bytes (verbose): {size(10, system=verbose)}\")","lang":"python","description":"This quickstart demonstrates how to import and use the `size` function with its default 'traditional' system and alternative formatting systems (alternative, SI, verbose) to convert byte values into human-readable strings."},"warnings":[{"fix":"For higher precision or floating-point output, consider alternative libraries like `datasize` or custom formatting functions.","message":"The default `size` function and its alternative systems provide integer approximations, which may lead to a loss of precision. For example, `size(1031053)` might return '1M' or '2M' rather than '1.03M'.","severity":"gotcha","affected_versions":"0.9"},{"fix":"For new projects, evaluate more recently maintained alternatives that offer similar or extended functionality, such as `hfilesize` or `datasize`.","message":"The library has not been updated since its initial release in 2009. While functional for its core purpose, it lacks modern maintenance and may not be actively supported for new Python features or complex edge cases.","severity":"deprecated","affected_versions":"0.9"},{"fix":"Always import specifically from `hurry.filesize` (e.g., `from hurry.filesize import size`) rather than attempting to import `hurry` directly for `filesize` functionality.","message":"The `hurry` package itself is a namespace package, which can sometimes lead to confusion regarding its internal structure or sub-package imports if users expect a traditional package with an `__init__.py` at its root.","severity":"gotcha","affected_versions":"0.9"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}