{ "info": { "author": "Cameron Simpson", "author_email": "cs@cskk.id.au", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Functions for decomposing nonnegative integers according to various unit scales.\n\nPresupplied scales:\n* `BINARY_BYTES_SCALE`: Binary units of (B)ytes, KiB, MiB, GiB etc.\n* `DECIMAL_BYTES_SCALE`: Decimal units of (B)ytes, KB, MB, GB etc.\n* `DECIMAL_SCALE`: Unit suffixes K, M, G etc.\n* `TIME_SCALE`: Units of (s)econds, (m)inutes, (h)ours, (d)ays and (w)eeks.\n\n## Function `combine(components, scale)`\n\nCombine a sequence of value components as from `human()` into an integer.\n\n## Function `geek_bytes(n)`\n\nDecompose a nonnegative integer `n` into counts by unit\nfrom `BINARY_BYTES_SCALE`.\n\n## Function `human(n, scale)`\n\nDecompose a nonnegative integer `n` into counts by unit from `scale`.\n\nParameters:\n* `n`: a nonnegative integer.\n* `scale`: a sequence of `(factor,unit)` where factor is the\n size factor to the follow scale and `unit` is the designator\n of the unit.\n\n## Function `human_bytes(n)`\n\nDecompose a nonnegative integer `n` into counts by unit\nfrom `DECIMAL_BYTES_SCALE`.\n\n## Function `human_time(n, scale=None)`\n\nDecompose a nonnegative integer `n` into counts by unit\nfrom `TIME_SCALE`.\n\n## Function `multiparse(s, scales, offset=0)`\n\nParse an integer followed by an optional scale and return computed value.\nReturns the parsed value and the new offset.\n\nParameters:\n* `s`: the string to parse.\n* `scales`: an iterable of scale arrays of (factor, unit_name).\n* `offset`: starting position for parse.\n\n## Function `parse(s, scale, offset=0)`\n\nParse an integer followed by an optional scale and return computed value.\nReturns the parsed value and the new offset.\n\nParameters:\n* `s`: the string to parse.\n* `scale`: a scale array of (factor, unit_name).\n* `offset`: starting position for parse.\n\n## Function `transcribe(n, scale, max_parts=None, skip_zero=False, sep='')`\n\nTranscribe a nonnegative integer `n` against `scale`.\n\nParameters:\n* `n`: a nonnegative integer.\n* `scale`: a sequence of (factor, unit) where factor is the\n size factor to the follow scale and `unit` is the designator\n of the unit.\n* `max_parts`: the maximum number of components to transcribe.\n* `skip_zero`: omit components of value 0.\n* `sep`: separator between words, default: `''`.\n\n## Function `transcribe_bytes_geek(n, max_parts=1, **kw)`\n\nTranscribe a nonnegative integer `n` against `BINARY_BYTES_SCALE`.\n\n## Function `transcribe_bytes_human(n, max_parts=1, **kw)`\n\nTranscribe a nonnegative integer `n` against `DECIMAL_BYTES_SCALE`.\n\n## Function `transcribe_time(n, max_parts=3, **kw)`\n\nTranscribe a nonnegative integer `n` against `TIME_SCALE`.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/cameron_simpson/css/commits/all", "keywords": "python2,python3", "license": "", "maintainer": "", "maintainer_email": "", "name": "cs.units", "package_url": "https://pypi.org/project/cs.units/", "platform": "", "project_url": "https://pypi.org/project/cs.units/", "project_urls": { "Homepage": "https://bitbucket.org/cameron_simpson/css/commits/all" }, "release_url": "https://pypi.org/project/cs.units/20190220/", "requires_dist": null, "requires_python": "", "summary": "unit suffixes for nonnegative integers; parsing and transcription", "version": "20190220" }, "last_serial": 4844590, "releases": { "20181228": [ { "comment_text": "", "digests": { "md5": "77887fb59b2bab9b669baca3e0973dfd", "sha256": "4e2c4cf63356e4d2ae6faa65d46afe4ed23564b925afed068aee988d114e3490" }, "downloads": -1, "filename": "cs.units-20181228.tar.gz", "has_sig": false, "md5_digest": "77887fb59b2bab9b669baca3e0973dfd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3362, "upload_time": "2018-12-28T04:49:42", "url": "https://files.pythonhosted.org/packages/81/2a/8ab5be6b4745386144920122901908d9a6404a9561c166460c97475850a3/cs.units-20181228.tar.gz" } ], "20190220": [ { "comment_text": "", "digests": { "md5": "a96684c67655da4391ab160689b6445c", "sha256": "d2a35267eb0056f7bab72f1e279bab01fc07ed8cad14b68198a8b65aea74ac82" }, "downloads": -1, "filename": "cs.units-20190220.tar.gz", "has_sig": false, "md5_digest": "a96684c67655da4391ab160689b6445c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3413, "upload_time": "2019-02-20T09:28:19", "url": "https://files.pythonhosted.org/packages/6b/13/7794a385106c4a11745f1a7886a20910648962a482e6d359804903f6f134/cs.units-20190220.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a96684c67655da4391ab160689b6445c", "sha256": "d2a35267eb0056f7bab72f1e279bab01fc07ed8cad14b68198a8b65aea74ac82" }, "downloads": -1, "filename": "cs.units-20190220.tar.gz", "has_sig": false, "md5_digest": "a96684c67655da4391ab160689b6445c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3413, "upload_time": "2019-02-20T09:28:19", "url": "https://files.pythonhosted.org/packages/6b/13/7794a385106c4a11745f1a7886a20910648962a482e6d359804903f6f134/cs.units-20190220.tar.gz" } ] }