{ "info": { "author": "Florian Diesch", "author_email": "devel@florian-diesch.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU General Public License (GPL)", "Natural Language :: English", "Natural Language :: German", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Scientific/Engineering", "Topic :: Software Development :: Libraries" ], "description": "What is firkin?\n===============\n\nfirkin is a python module to convert between different measurement\nunits.\n\n\nUsage\n=====\n\nFirst we create an instance of `UnitManager`::\n\n>>> um=UnitManager()\n \nNext we create two families of units. The first one ist ``liter`` and\nuses ``SIFamily`` to automatically create units with the SI prefixes::\n \n >>> um.add(SIFamily(base='l', name='liter'))\n\nNow our ``UnitManager`` knows about fl, pl, nl, ..., Ml, Gl, Tl.\n\nHow many liters are 10000 ml?::\n\n >>> um.convert_to_unit(1e4, 'ml', 'l')\n (Decimal(\"10.0000\"), 'l')\n\nNext we create a family by hand::\n \n >>> f=Family(name='f', base='gallon')\n >>> f.add('barrel', 36, 'gallon')\n >>> f.add('kilderkin', 0.5, 'barrel')\n >>> f.add('firkin', 0.5, 'kilderkin')\n\nNow we have a family called ``f`` that used gallon as its base and knows about \nbarrel, kilderkin and firkin, too.\n\nHow much gallons is one firkin?::\n\n >>> f.convert(1, 'firkin', 'gallon')\n (Decimal(\"9.00\"), 'gallon')\n\nWhat's the best way to express 3 kilderkin?::\n\n >>> f.autoconvert(3, 'kilderkin')\n (Decimal(\"1.50\"), 'barrel')\n\nTo convert between family ``f`` and family ``liter`` we need to add ``f`` to\nour ``UnitManager`` and tell how much liters (base unit of family ``liter``) a\ngallon (base unit of family ``f``) is::\n\n >>> um.add(f, other='liter', factor=4.54609)\n\nOf course the ``UnitManger`` can convert firkin to gallon, too::\n\n >>> um.convert_to_unit(1, 'firkin', 'gallon')\n (Decimal(\"9.00\"), 'gallon')\n\nBut it also can convert firkin to liters::\n\n >>> um.convert_to_unit(1, 'firkin', 'l')\n (Decimal(\"40.9148100\"), 'l')\n\nOr find the best way to express one liter in one of the units from\nfamily ``f``::\n\n >>> um.convert_to_family(1, 'l', 'f')\n (Decimal(\"0.219969248299\"), 'gallon')\n\nThat works with barrels, too::\n\n >>> um.convert_to_family(1, 'barrel', 'f')\n (Decimal(\"1.00\"), 'barrel')", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.florian-diesch.de/software/firkin/", "keywords": "measurement units convert conversion", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "firkin", "package_url": "https://pypi.org/project/firkin/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/firkin/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://www.florian-diesch.de/software/firkin/" }, "release_url": "https://pypi.org/project/firkin/0.02/", "requires_dist": null, "requires_python": null, "summary": "convert between different measurement units", "version": "0.02" }, "last_serial": 72491, "releases": { "0.01": [], "0.02": [] }, "urls": [] }