{ "info": { "author": "Ken Kundert", "author_email": "quantiphy@nurdletech.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Natural Language :: English", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Scientific/Engineering", "Topic :: Utilities" ], "description": "QuantiPhy \u2014 Physical Quantities\n===============================\n\n.. image:: https://img.shields.io/travis/KenKundert/quantiphy/master.svg\n :target: https://travis-ci.org/KenKundert/quantiphy\n\n.. image:: https://img.shields.io/coveralls/KenKundert/quantiphy.svg\n :target: https://coveralls.io/r/KenKundert/quantiphy\n\n.. image:: https://img.shields.io/pypi/v/quantiphy.svg\n :target: https://pypi.python.org/pypi/quantiphy\n\n.. image:: https://img.shields.io/pypi/pyversions/quantiphy.svg\n :target: https://pypi.python.org/pypi/quantiphy/\n\n.. IGNORE: pypi statistics are broken and unlikely to be fixed\n .. image:: https://img.shields.io/pypi/dm/quantiphy.svg\n :target: https://pypi.python.org/pypi/quantiphy/\n\n:Author: Ken Kundert\n:Version: 2.6.0\n:Released: 2019-07-11\n\n\nWhat?\n-----\n\n*QuantiPhy* is a Python library that offers support for physical quantities. \nA quantity is the pairing of a number and a unit of measure that indicates the \namount of some measurable thing. *QuantiPhy* provides quantity objects that \nkeep the units with the number, making it easy to share them as single object. \nThey subclass float and so can be used anywhere a real number is appropriate.\n\n\nWhy?\n----\n\n*QuantiPhy* naturally supports SI scale factors, which are widely used in \nscience and engineering. SI scale factors make it possible to cleanly represent \nboth very large and very small quantities in a form that is both easy to read \nand write. While generally better for humans, no general programming language \nprovides direct support for reading or writing quantities with SI scale factors, \nmaking it difficult to write software that communicates effectively with humans. \n*QuantiPhy* addresses this deficiency, making it natural and simple to both \ninput and output physical quantities.\n\n\nFeatures\n--------\n\n- Flexibly reads amounts with units and SI scale factors.\n- Quantities subclass the *float* class and so can be used as conventional \n numbers.\n- Generally includes the units when printing or converting to strings and by \n default employs SI scale factors.\n- Flexible unit conversion and scaling is supported to make it easy to convert \n to or from any required form.\n- Provides a small but extensible collection of physical constants.\n- Supports the binary scale factors (*Ki*, *Mi*, etc.) along with the normal SI \n scale factors (*k*, *M*, etc.).\n\n\nAlternatives\n------------\n\nThere are a considerable number of Python packages dedicated to units and \nquantities (`alternatives `_). \nHowever, as a rule, they focus on the units rather than the scale factors. In \nparticular, they build a system of units that you are expected to use throughout \nyour calculations. These packages demand a high level of commitment from their \nusers and in turn provide unit consistency and built-in unit conversions. In \ncontrast, *QuantiPhy* treats units basically as documentation. They are simply \nstrings that are attached to quantities largely so they can be presented to the \nuser when the values are printed. As such, *QuantiPhy* is a light-weight package \nthat demands little from the user. It is used when inputting and outputting \nvalues, and then only when it provides value. As a result, it provides \na simplicity in use that cannot be matched by the other packages.\n\n\nQuick Start\n-----------\n\nYou can find the documentation on `ReadTheDocs\n`_. Install with::\n\n pip3 install --user quantiphy\n\nRequires Python3.4 or better. Python2.7 is also supported, however support for \nunicode is weak.\n\nYou can find the full documentation `here `_.\n\nYou use *Quantity* to convert numbers and units in various forms to quantities:\n\n.. code-block:: python\n\n >>> from quantiphy import Quantity\n\n >>> Tclk = Quantity(10e-9, 's')\n >>> print(Tclk)\n 10 ns\n\n >>> Fhy = Quantity('1420.405751786 MHz')\n >>> print(Fhy)\n 1.4204 GHz\n\n >>> Rsense = Quantity('1e-4\u03a9')\n >>> print(Rsense)\n 100 u\u03a9\n\n >>> cost = Quantity('$11_200_000')\n >>> print(cost)\n $11.2M\n\n >>> Tboil = Quantity('212 \u00b0F', scale='\u00b0C')\n >>> print(Tboil)\n 100 \u00b0C\n\nOnce you have a quantity, there are a variety of ways of accessing aspects of \nthe quantity:\n\n.. code-block:: python\n\n >>> Tclk.real\n 1e-08\n\n >>> float(Fhy)\n 1420405751.786\n\n >>> 2*cost\n 22400000.0\n\n >>> Rsense.units\n '\u03a9'\n\n >>> str(Tboil)\n '100 \u00b0C'\n\nYou can use the render method to flexibly convert the quantity to a string:\n\n.. code-block:: python\n\n >>> Tclk.render()\n '10 ns'\n\n >>> Tclk.render(show_units=False)\n '10n'\n\n >>> Tclk.render(form='eng', show_units=False)\n '10e-9'\n\n >>> Fhy.render(prec=8)\n '1.42040575 GHz'\n\n >>> Tboil.render(scale='\u00b0F')\n '212 \u00b0F'\n\nYou can use the string format method or the new format strings to flexibly \nincorporate quantity values into strings:\n\n.. code-block:: python\n\n >>> f'{Fhy}'\n '1.4204 GHz'\n\n >>> f'{Fhy:.6}'\n '1.420406 GHz'\n\n >>> f'|{Fhy:<15.6}|'\n '|1.420406 GHz |'\n\n >>> f'|{Fhy:>15.6}|'\n '| 1.420406 GHz|'\n\n >>> f'Boiling point of water: {Tboil:s}'\n 'Boiling point of water: 100 \u00b0C'\n\n >>> f'Boiling point of water: {Tboil:s\u00b0F}'\n 'Boiling point of water: 212 \u00b0F'\n\n*QuantiPhy* has many more features and capabilities. For more information, view \nthe `documentation `_.", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/kenkundert/quantiphy/tarball/master", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://quantiphy.readthedocs.io", "keywords": "quantities,physical,quantity,units,SI,scale,factors,engineering,notation,mks,cgs", "license": "GPLv3+", "maintainer": "", "maintainer_email": "", "name": "quantiphy", "package_url": "https://pypi.org/project/quantiphy/", "platform": "", "project_url": "https://pypi.org/project/quantiphy/", "project_urls": { "Download": "https://github.com/kenkundert/quantiphy/tarball/master", "Homepage": "https://quantiphy.readthedocs.io" }, "release_url": "https://pypi.org/project/quantiphy/2.6.0/", "requires_dist": null, "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*", "summary": "physical quantities (numbers with units)", "version": "2.6.0" }, "last_serial": 5880999, "releases": { "0.0.1": [], "0.2.0": [ { "comment_text": "", "digests": { "md5": "ab39922c9e8025c4f4faaf566cc0a4c6", "sha256": "88de4942b360d4d8d734ff37159343c33ea07e56230ed733d2286cbd3c174fca" }, "downloads": -1, "filename": "quantiphy-0.2.0.tar.gz", "has_sig": false, "md5_digest": "ab39922c9e8025c4f4faaf566cc0a4c6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25334, "upload_time": "2016-10-23T07:43:03", "url": "https://files.pythonhosted.org/packages/c9/cb/62ba0587386c41ce6f4f3a03cb83970a4b3a738ae9325a92d58048210c4b/quantiphy-0.2.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "f9ea78fc25a9b1440c072592dc3bc131", "sha256": "7c1b0d52dc9254ab60fe531bb9105e5d7c4c9253a7f11258973f9b0173ad7e2f" }, "downloads": -1, "filename": "quantiphy-0.4.0.tar.gz", "has_sig": false, "md5_digest": "f9ea78fc25a9b1440c072592dc3bc131", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26504, "upload_time": "2016-10-26T10:31:09", "url": "https://files.pythonhosted.org/packages/28/10/538a1f76e4a698ec641827d9dcfdea5d7fd0dc4e9407adcd06d2c390d756/quantiphy-0.4.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "c76cbc4e14186e3492a6a250ddb8bef0", "sha256": "3ad0e68b9043071bfa1e6543254831b27ec3be5fc9165c3c21af48ce3140e993" }, "downloads": -1, "filename": "quantiphy-0.5.0.tar.gz", "has_sig": false, "md5_digest": "c76cbc4e14186e3492a6a250ddb8bef0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31247, "upload_time": "2016-11-04T08:16:38", "url": "https://files.pythonhosted.org/packages/1c/6c/a3caaa600d5c2de46dfe21b7306565a1262e0268fac83242c8f488039db9/quantiphy-0.5.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "b278ca6b287a7de5a9a4d3da91332659", "sha256": "3fc003e8352def57bc0328243f27ce28b7d3e332ca2081a7ae6730fde958a4e0" }, "downloads": -1, "filename": "quantiphy-1.0.0.tar.gz", "has_sig": false, "md5_digest": "b278ca6b287a7de5a9a4d3da91332659", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 46035, "upload_time": "2016-11-27T04:44:47", "url": "https://files.pythonhosted.org/packages/b2/8e/0c0649ea90ffefe158e889a5376dbef1658fb4a989ab7e7dab55d0217f83/quantiphy-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "6e42b75b7d11f6988d746c1cfc32b5c0", "sha256": "53a17fb044daffc6929aec59b16a0dbcaaedc7fb568201440982f8a3fc0159d2" }, "downloads": -1, "filename": "quantiphy-1.1.0.tar.gz", "has_sig": false, "md5_digest": "6e42b75b7d11f6988d746c1cfc32b5c0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 47787, "upload_time": "2016-11-27T20:43:18", "url": "https://files.pythonhosted.org/packages/a6/b2/16aea19e7efbb944d3afa982da712f8eddda98d8d675ad94910fafb600d6/quantiphy-1.1.0.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "9bd823c2e4a746780bc4fe0fba8f8c1f", "sha256": "2478943e2798b245238f9b6ae307eef4b2a5657a4f81f8bd74aec1af6d9a8396" }, "downloads": -1, "filename": "quantiphy-1.2.0.tar.gz", "has_sig": false, "md5_digest": "9bd823c2e4a746780bc4fe0fba8f8c1f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 52102, "upload_time": "2017-02-24T20:48:59", "url": "https://files.pythonhosted.org/packages/f2/72/c213f9ce4b9c72b43e7af27ba6fa6dbab1024c8ef1bce9d4766e1a7dc00e/quantiphy-1.2.0.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "aa939e553b5393734602b699d76e3d5d", "sha256": "2bef48ccb3807ffe32a68acd2062bdd53bf74075ed0fa0b01cd7b2eddb15cbd5" }, "downloads": -1, "filename": "quantiphy-1.3.0.tar.gz", "has_sig": false, "md5_digest": "aa939e553b5393734602b699d76e3d5d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 56638, "upload_time": "2017-03-19T18:01:54", "url": "https://files.pythonhosted.org/packages/03/9c/c2a688021a5a501eda2edfa269dd46bed0b2ef086d99e278cfa773e9252f/quantiphy-1.3.0.tar.gz" } ], "1.4.0": [ { "comment_text": "", "digests": { "md5": "78eebaff212dbe6ad4f288d75f9cbb79", "sha256": "2438ee8ef5bb3e3d54816da8031cf753378990e1f70e1f3c8bc677937caf787b" }, "downloads": -1, "filename": "quantiphy-1.4.0.tar.gz", "has_sig": true, "md5_digest": "78eebaff212dbe6ad4f288d75f9cbb79", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21253, "upload_time": "2017-07-13T17:27:15", "url": "https://files.pythonhosted.org/packages/4b/39/d5099f7d28988d7a59a0dde9f3111260dd27c7dd0fc889d1814786dc97da/quantiphy-1.4.0.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "51e7eb0726d69c01db86744ed6af6b7b", "sha256": "f7e90f68d625e86b33690b55ab5b868ff6035ec5fe4c45cade2714167cba3619" }, "downloads": -1, "filename": "quantiphy-2.0.0.tar.gz", "has_sig": true, "md5_digest": "51e7eb0726d69c01db86744ed6af6b7b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21240, "upload_time": "2017-07-13T17:54:50", "url": "https://files.pythonhosted.org/packages/3a/90/0e464cc3a3f7e4cf89b30eccdc13af738e911e8c6e4fbd4846f49dd34747/quantiphy-2.0.0.tar.gz" } ], "2.1.0": [ { "comment_text": "", "digests": { "md5": "0b4568bd15be7b30c9651ab868f5e066", "sha256": "31b198e0b9ef694ca458c77dfcc21f74878338d99c3fedbd56776798fbe552f9" }, "downloads": -1, "filename": "quantiphy-2.1.0.tar.gz", "has_sig": true, "md5_digest": "0b4568bd15be7b30c9651ab868f5e066", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23357, "upload_time": "2017-07-31T00:12:59", "url": "https://files.pythonhosted.org/packages/e9/c7/018893e7f6f659bb7c6067da5092b65491b4ba033fcc328a2dc560f9f7db/quantiphy-2.1.0.tar.gz" } ], "2.2.0": [ { "comment_text": "", "digests": { "md5": "f92763e48e860e8a083302ca2d103dd0", "sha256": "c360d476d286a78084182b8e226c1d6bbe50b51c64cbf35860f449006d289b28" }, "downloads": -1, "filename": "quantiphy-2.2.0.tar.gz", "has_sig": true, "md5_digest": "f92763e48e860e8a083302ca2d103dd0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24427, "upload_time": "2017-11-22T17:44:44", "url": "https://files.pythonhosted.org/packages/d6/ce/6e769b3a2f89f5765a3d59f2e20ea8098e602928158d2832e5d9d0c9a0a0/quantiphy-2.2.0.tar.gz" } ], "2.3.0": [ { "comment_text": "", "digests": { "md5": "08ec43d5201cefc497e02a3e96009573", "sha256": "144aaf5392618f2dec8fef76d1d951067aeed030b2983fe88a9ce4a4a5fe8f03" }, "downloads": -1, "filename": "quantiphy-2.3.0.tar.gz", "has_sig": true, "md5_digest": "08ec43d5201cefc497e02a3e96009573", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27155, "upload_time": "2018-03-12T06:02:40", "url": "https://files.pythonhosted.org/packages/8f/6f/75321bc4211dc5a1cdb063bebe11f4dcc52d77d44970e95b9ec200935ef0/quantiphy-2.3.0.tar.gz" } ], "2.4.0": [ { "comment_text": "", "digests": { "md5": "9982707bc5155f498c8762c93aba9a2a", "sha256": "d17aa98bec867236f9495d5b2d1c77c5d832084ef7d31347228f33bf7df65e65" }, "downloads": -1, "filename": "quantiphy-2.4.0.tar.gz", "has_sig": true, "md5_digest": "9982707bc5155f498c8762c93aba9a2a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28205, "upload_time": "2018-09-12T18:04:22", "url": "https://files.pythonhosted.org/packages/d9/53/0c81df52b418d5d48b02cbee112d9cce6985b6f395795e38318959d829b4/quantiphy-2.4.0.tar.gz" } ], "2.5.0": [ { "comment_text": "", "digests": { "md5": "3960b41dde5461d227bf7f4adb5122c2", "sha256": "1039b62e899346fb33f6d821b4b7e028b3146b824272ed7723b438a964e4011e" }, "downloads": -1, "filename": "quantiphy-2.5.0.tar.gz", "has_sig": false, "md5_digest": "3960b41dde5461d227bf7f4adb5122c2", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*", "size": 30125, "upload_time": "2019-01-17T07:17:34", "url": "https://files.pythonhosted.org/packages/dd/fe/1ed45743adf0d38164206b80d0059dbebd475bfda90a95246c8edee747ef/quantiphy-2.5.0.tar.gz" } ], "2.6.0": [ { "comment_text": "", "digests": { "md5": "b62da00961f456442ed196f9c6fb7096", "sha256": "0b85a160b5d710af4419b1ef1809563113126ccf28d996db7d90ffa2d6f96788" }, "downloads": -1, "filename": "quantiphy-2.6.0.tar.gz", "has_sig": false, "md5_digest": "b62da00961f456442ed196f9c6fb7096", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*", "size": 30703, "upload_time": "2019-09-24T16:59:54", "url": "https://files.pythonhosted.org/packages/a9/33/f6a1b5847d9f02ef88f926f1ec5dba5ff7239de11880da25cf5800c2c999/quantiphy-2.6.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b62da00961f456442ed196f9c6fb7096", "sha256": "0b85a160b5d710af4419b1ef1809563113126ccf28d996db7d90ffa2d6f96788" }, "downloads": -1, "filename": "quantiphy-2.6.0.tar.gz", "has_sig": false, "md5_digest": "b62da00961f456442ed196f9c6fb7096", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*", "size": 30703, "upload_time": "2019-09-24T16:59:54", "url": "https://files.pythonhosted.org/packages/a9/33/f6a1b5847d9f02ef88f926f1ec5dba5ff7239de11880da25cf5800c2c999/quantiphy-2.6.0.tar.gz" } ] }