{ "info": { "author": "simonzack", "author_email": "simonzack@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Human Readable File Sizes\r\n=========================\r\n\r\nParses & Formats integer file sizes to human readable file sizes.\r\n\r\nExample Usage\r\n-------------\r\n\r\nParsing\r\n~~~~~~~\r\n\r\n::\r\n\r\n >>> from hfilesize import Format, FileSize\r\n >>> FileSize('1k')\r\n ... 1000\r\n >>> FileSize('1K')\r\n ... 1024\r\n >>> FileSize('1kib')\r\n ... 1024\r\n >>> FileSize('1K', default_binary=False, case_sensitive=False)\r\n ... 1000\r\n >>> FileSize('1 kibibyte')\r\n ... 1024\r\n\r\nFormatting\r\n~~~~~~~~~~\r\n\r\n::\r\n\r\n >>> '{:d}'.format(FileSize(1024))\r\n ... '1024'\r\n >>> '{:.02fH}'.format(FileSize(1024))\r\n ... '1 KB'\r\n >>> '{:.02fHcv}'.format(FileSize(1024))\r\n ... '1 kilobyte'\r\n >>> '{:.02fhs}'.format(FileSize(1000))\r\n ... '1 KB'\r\n >>> '{:.02fhs^0}'.format(FileSize(1000))\r\n ... '1000 B'\r\n >>> '{: >10.02fH}'.format(FileSize(1024))\r\n ... ' 1 KB'\r\n\r\nDocumentation\r\n-------------\r\n\r\nParsing Options\r\n~~~~~~~~~~~~~~~\r\n\r\n- ``case_sensitive``: Use 1024 for upper case and 1000 for lower case\r\n if casing exists, as is common in unix utilities, e.g. dd\r\n\r\n- ``default_binary``: Default base if it is not clear what the unit is\r\n (i.e. if it is not 'mib' or 'mebibytes')\r\n\r\nFormatting Options\r\n~~~~~~~~~~~~~~~~~~\r\n\r\n- format type: ``[hH][size_format][^exponent]``\r\n\r\n - ``h``: Base 1000\r\n - ``H``: Base 1024\r\n\r\n- ``size_format``: ``c | cs | cv | e | ev | s | sv``\r\n\r\n - ``c``: Commonly used case-sensitive suffixes\r\n - ``cs``: Commonly used abbreviated case-sensitive suffixes\r\n - ``cv``: Commonly used verbose case-sensitive suffixes\r\n - ``e``: IEC suffixes\r\n - ``ev``: IEC verbose suffixes\r\n - ``s``: SI suffixes\r\n - ``sv``: SI verbose suffixes\r\n\r\n- ``exponent``: ``integer``\r\n\r\nReferences\r\n----------\r\n\r\nInspired by:\r\n\r\n- ```hurry.filesize`` `__\r\n- `Human readable file/memory sizes v2 (Python\r\n recipe) `__\r\n\r\nLicense\r\n-------\r\n\r\nLicensed under GPLv3.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/simonzack/hfilesize", "keywords": null, "license": "GPLv3", "maintainer": null, "maintainer_email": null, "name": "hfilesize", "package_url": "https://pypi.org/project/hfilesize/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/hfilesize/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/simonzack/hfilesize" }, "release_url": "https://pypi.org/project/hfilesize/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Human Readable File Sizes", "version": "0.1.0" }, "last_serial": 1038639, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "598f5440be97223d529c41f5be6879a7", "sha256": "560578c395a3b9b0fd25f93c6fb75008e0797cff48b462656c2bc7373179fa30" }, "downloads": -1, "filename": "hfilesize-0.1.0.zip", "has_sig": false, "md5_digest": "598f5440be97223d529c41f5be6879a7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7409, "upload_time": "2014-03-23T17:55:40", "url": "https://files.pythonhosted.org/packages/6f/29/23423e1022626fe2251fbbf3e0854c6f1e954d740537718938ba5072c8a4/hfilesize-0.1.0.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "598f5440be97223d529c41f5be6879a7", "sha256": "560578c395a3b9b0fd25f93c6fb75008e0797cff48b462656c2bc7373179fa30" }, "downloads": -1, "filename": "hfilesize-0.1.0.zip", "has_sig": false, "md5_digest": "598f5440be97223d529c41f5be6879a7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7409, "upload_time": "2014-03-23T17:55:40", "url": "https://files.pythonhosted.org/packages/6f/29/23423e1022626fe2251fbbf3e0854c6f1e954d740537718938ba5072c8a4/hfilesize-0.1.0.zip" } ] }