{ "info": { "author": "Anne Mulhern", "author_email": "amulhern@redhat.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries", "Topic :: System :: Hardware", "Topic :: System :: Operating System Kernels :: Linux" ], "description": ".. image:: https://secure.travis-ci.org/mulkieran/bytesize.png?branch=master\n :target: http://travis-ci.org/mulkieran/bytesize\n\nBytesize\n========\n\nBytesize is a module for handling computation with\nsizes expressed in bytes. Its principle feature is a Size class from\nwhich can be constructed Size objects which represent a precise and finite\nquantity of bytes. Various arithmetic operations are defined for Size objects.\n\nIts sole purpose is the representation of real quantities of memory on real\nmachines. For that reason, it does not allow powers of bytes, imprecise\nquantities of bytes, or non-finite quantities of bytes. In order that the\nusual laws of arithmetic can be maintained, it does allow fractional quantities\nof bytes.\n\nPractical Computing with Bytes\n------------------------------\n\nWhen computing with bytes, the numeric value can be viewed as a logical,\nrather than a physical, quantity. That is, unlike, e.g., mass or length,\nwhich are quantities which must be measured with a measuring instrument\nwhich has some built-in imprecision, the number of bytes of memory in RAM,\nor on a disk, is a quantity that is not measured, but is known precisely.\nConsequently, computations such as addition of two Sizes, and conversion\nbetween different magnitudes of bytes, i.e., from MiB to GiB, must be done\nprecisely. The underlying implementation must therefore use a precise\nrepresentation of the number of bytes. Floating point numbers, which are\nfrequently the preferred type for the representation of physical\nquantities, are disallowed by this requirement.\n\nOperations\n----------\nThis module does not accomodate multi-dimensionality of byte quantities.\nConsequently, multiplying one Size object by another Size object will cause\nan error to be raised, since bytes^2 is not representable by the module.\nFor most uses any operation which would yield a multi-dimensional quantity\nof bytes is not useful. There are no plans to adapt this package so that it\ncan accomodate multi-dimensionality of bytes.\n\nNumerous computations with bytes are nonsensical. For example, 2 raised to a\npower which is some number of bytes, is a meaningless computation. All such\noperations cause an error to be raised.\n\nThe result type of operations is a Size, where appropriate, or a subtype of\nRational, where a numeric value is appropriate.\n\nFloating Point Numbers\n----------------------\nIt is not possible to use floating point numbers in computations with Sizes.\nWhere a fractional quantity is desired, use Decimal objects instead of floats.\nThus, Size(0) * 1.2 raises an exception, but Size(0) * Decimal(\"1.2\") is\nacceptable.\n\nDisplaying Sizes\n----------------\nSizes are displayed according to a specified configuration. In the default\nconfiguration, Sizes are displayed using binary rather than SI prefixes\nor names, regardless of the value. For example, 1000 bytes is not displayed\nas 1KB (1 kilobyte), but as some number of bytes or KiB (kibibytes).\n\nThe detailed representation of Sizes uses a precise decimal representation\nthat includes the repeating portion, if any.\n\nRepresenting Units\n------------------\nThe size module supplies a set of named prefixes for both SI and binary units,\nfor all non-fractional prefixes. Fractional prefixes are not defined.\n\nConstructing Sizes Programatically\n----------------------------------\nNew Size objects can be constructed from Size objects, numeric values, e.g.,\nint or Decimal, or strings which represent such numeric values.\nstrings may be used to represent fractional quantities, e.g., \"1.2\", but\nfloats are disallowed.\n\nThe constructor takes an optional units specifier, which defaults to bytes\nfor all numeric values, and to None for Size objects. The type of the\nunit specifier is a named prefix supplied by the size module or a Size object.\n\nErrors\n------\nAll errors raised by bytesize operations are subtypes of the SizeError class.\n\nAlternative Packages\n--------------------\nIf you are interested in computing in Python with physical, rather than\nlogical, quantities, you should consult the pint package:\nhttp://pint.readthedocs.org.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://bytesize.readthedocs.org/", "keywords": null, "license": "GPL 2+", "maintainer": null, "maintainer_email": null, "name": "bytesize", "package_url": "https://pypi.org/project/bytesize/", "platform": "Linux", "project_url": "https://pypi.org/project/bytesize/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://bytesize.readthedocs.org/" }, "release_url": "https://pypi.org/project/bytesize/0.4/", "requires_dist": null, "requires_python": null, "summary": "computing with and displaying bytes", "version": "0.4" }, "last_serial": 1850239, "releases": { "0.01": [ { "comment_text": "", "digests": { "md5": "279fcbe07e39015729dd4a547cf18d4b", "sha256": "cf5d6147741ada0167a8e5e385feffc368e3433455cc6b79e52bdd49a1e09fcd" }, "downloads": -1, "filename": "bytesize-0.01.tar.gz", "has_sig": false, "md5_digest": "279fcbe07e39015729dd4a547cf18d4b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11003, "upload_time": "2015-11-09T14:19:59", "url": "https://files.pythonhosted.org/packages/5e/72/fcc4ae3868bd2c4749d01a07b19c0c803d2e7db417256c93df328e6387a7/bytesize-0.01.tar.gz" } ], "0.02": [ { "comment_text": "", "digests": { "md5": "4d859522e3e0a61e1b00bbd5b2a14648", "sha256": "06be2fbad3ca11154250d2002027e9a181fe4361b3fbb6e511dc2e2ed84e0168" }, "downloads": -1, "filename": "bytesize-0.02.tar.gz", "has_sig": false, "md5_digest": "4d859522e3e0a61e1b00bbd5b2a14648", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 37952, "upload_time": "2015-11-10T22:46:20", "url": "https://files.pythonhosted.org/packages/ba/2f/3e23f98e3ae5e849edad878a613632f3977538f5727c3ae557e7d1295a8f/bytesize-0.02.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "3c17a07d74a23ddeafb6faa7162f1f0d", "sha256": "90d004baa19269256ec43ba5639cd1ce43f76ccbc087acefdce0991bb4338405" }, "downloads": -1, "filename": "bytesize-0.3.tar.gz", "has_sig": false, "md5_digest": "3c17a07d74a23ddeafb6faa7162f1f0d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 61138, "upload_time": "2015-11-13T21:27:11", "url": "https://files.pythonhosted.org/packages/bc/45/fd89bfbaa7d556547f0dc2e9713dac9a4747d1da4daed679d77b5c77cd36/bytesize-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "0301154aa272c558cf16dad091a925d5", "sha256": "f9dfbd5cca080327f4c85c1237f7ec0509187bb197478c9523c07ad55fc5529d" }, "downloads": -1, "filename": "bytesize-0.4.tar.gz", "has_sig": false, "md5_digest": "0301154aa272c558cf16dad091a925d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 48126, "upload_time": "2015-12-07T15:20:26", "url": "https://files.pythonhosted.org/packages/7e/4c/68ce9e514213f91a40468bf83bd929c1b09bde73fee55fd6604d2703b749/bytesize-0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0301154aa272c558cf16dad091a925d5", "sha256": "f9dfbd5cca080327f4c85c1237f7ec0509187bb197478c9523c07ad55fc5529d" }, "downloads": -1, "filename": "bytesize-0.4.tar.gz", "has_sig": false, "md5_digest": "0301154aa272c558cf16dad091a925d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 48126, "upload_time": "2015-12-07T15:20:26", "url": "https://files.pythonhosted.org/packages/7e/4c/68ce9e514213f91a40468bf83bd929c1b09bde73fee55fd6604d2703b749/bytesize-0.4.tar.gz" } ] }