{ "info": { "author": "Kai", "author_email": "k@limist.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Other Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Office/Business :: Financial", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": ".. image:: https://travis-ci.org/limist/py-moneyed.svg?branch=master\n :target: https://travis-ci.org/limist/py-moneyed\n :alt: Build Status\n\n.. image:: https://badge.fury.io/py/py-moneyed.svg\n :target: https://badge.fury.io/py/py-moneyed\n :alt: Latest PyPI version\n\nOverview\n========\n\nThe need to represent instances of money frequently arises in software\ndevelopment, particularly any financial/economics software. To\naddress that need, the py-moneyed package provides the classes of\nMoney and Currency, at a level more useful than just using Python's\nDecimal class, or ($DEITY forbid) the float primitive. The package is\nmeant to be stand-alone and easy to either use directly, or subclass\nfurther. py-moneyed is BSD-licensed.\n\nSome of the py-moneyed code was first derived from python-money\navailable via this URL: http://code.google.com/p/python-money/ Because\nthat Google Code version has been inactive since May 2008, I forked it\nand modified it for my needs in 2010. Compared to python-money, major\nchanges here in py-moneyed include separating it from Django usage,\ntightening types handling in operators, a complete suite of unit\ntests, PEP8 adherence, providing a setup.py, and local currency\nformatting/display.\n\nUsage\n-----\n\nOn to the code! The Money class is instantiated with:\n\n- An amount which can be of type int, string, float, or Decimal.\n It will be converted to a Decimal internally. Therefore, it is best\n to avoid float objects, since they do not convert losslessly\n to Decimal.\n\n- A currency, which usually is specified by the three-capital-letters\n ISO currency code, e.g. USD, EUR, CNY, and so on.\n It will be converted to a Currency object.\n\nFor example,\n\n.. sourcecode:: python\n\n from moneyed import Money\n sale_price_today = Money(amount='99.99', currency='USD')\n\n\nYou then use Money instances as a normal number. The Money class provides\noperators with type checking, matching currency checking, and sensible\ndimensional behavior, e.g. you cannot multiply two Money instances, nor can you\nadd a Money instance to a non-Money number; dividing a Money instance by another\nresults in a Decimal value, etc.\n\nThe Currency class is provided with a complete dictionary of ISO 4217\ncurrencies data, each key (e.g. 'USD') mapping to a Currency instance\nwith ISO numeric code, canonical name in English, and countries using\nthe currency. Thanks to the python-money developers for their\n(possibly tedious) data-entry of the ISO codes!\n\nAll of these are available as pre-built Currency objects in the `moneyed`\nmodule.\n\nYou can also pass in the arguments to Money as positional arguments.\nSo you can also write:\n\n.. sourcecode:: python\n\n >>> from moneyed import Money, USD\n >>> price = Money('19.50', USD)\n >>> price\n 19 USD\n\n >>> price.amount\n Decimal('19.50')\n\n >>> price.currency\n USD\n\n >>> price.currency.code\n 'USD'\n\n\nFormatting\n----------\n\nYou can print Money object as follows:\n\n.. sourcecode:: python\n\n >>> from moneyed.localization import format_money\n >>> format_money(Money(10, USD), locale='en_US')\n '$10.00'\n\nDivision on Python 2 code\n-------------------------\n\nThis package uses the special method `__truediv__` to add division support to\n`Money` class. So, if you are using python 2, make sure that you have imported \ndivision on your code that calls division operation, otherwise you will get \nunsupported operand error.\n\n.. sourcecode:: python\n\n >>> from __future__ import division\n >>> from moneyed import Money\n >>> price = Money(amount='50', currency='USD')\n >>> price / 2\n \n\nTesting\n-------\n\nUnit-tests have been provided, and can be run with tox_ (recommended)\nor just py.test.\n\nIf you don't have tox installed on your system, it's a modern Python\ntool to automate running tests and deployment; install it to your\nglobal Python environment with: ::\n\n sudo pip install tox\n\nThen you can activate a virtualenv (any will do - by design tox will\nnot run from your globally-installed python), cd to the py-moneyed\nsource directory then run the tests at the shell: ::\n\n cd where/py-moneyed-source/is\n tox\n\nIf you do not have all versions of Python that are used in testing,\nyou can use pyenv_. After installing pyenv, install the additional\nplugin pyenv-implict_.\n\nThe py-moneyed package is tested against Python 2.6, 2.7, 3.2, 3.3,\n3.4, 3.5, and PyPy 2.1.\n\n.. _tox: http://tox.testrun.org/latest/\n.. _pyenv: https://github.com/yyuu/pyenv\n.. _pyenv-implict: https://github.com/concordusapps/pyenv-implict\n\nFuture\n------\n\nFuture versions of py-moneyed may provide currency conversions or\nother capabilities, dependent on feedback and usage.\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/limist/py-moneyed", "keywords": "money currency class abstraction", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "py-moneyed", "package_url": "https://pypi.org/project/py-moneyed/", "platform": "", "project_url": "https://pypi.org/project/py-moneyed/", "project_urls": { "Homepage": "http://github.com/limist/py-moneyed" }, "release_url": "https://pypi.org/project/py-moneyed/0.8.0/", "requires_dist": [ "pytest (>=2.3.0) ; extra == 'tests'", "tox (>=1.6.0) ; extra == 'tests'" ], "requires_python": "", "summary": "Provides Currency and Money classes for use in your Python code.", "version": "0.8.0" }, "last_serial": 4502941, "releases": { "0.3": [ { "comment_text": "", "digests": { "md5": "112d9034c7efe86915634ce251812b9f", "sha256": "cd6f6fecba3ff10d2b9387cdbc33e8446e2732e8fbcb09988daa107c5ce73594" }, "downloads": -1, "filename": "py-moneyed-0.3.tar.gz", "has_sig": false, "md5_digest": "112d9034c7efe86915634ce251812b9f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11273, "upload_time": "2011-02-12T00:08:32", "url": "https://files.pythonhosted.org/packages/58/27/2c05f58811632329a7d8788b141f2755396ba0f39ec2b35dd1c063c34e61/py-moneyed-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "be4c53953caee2e469c36249087f4067", "sha256": "eefa42150eb8224784ccdd24aafacca7095b62770def657118268d4ce32cf307" }, "downloads": -1, "filename": "py_moneyed-0.4-py2.6.egg", "has_sig": false, "md5_digest": "be4c53953caee2e469c36249087f4067", "packagetype": "bdist_egg", "python_version": "2.6", "requires_python": null, "size": 30251, "upload_time": "2012-04-09T05:34:44", "url": "https://files.pythonhosted.org/packages/df/80/5f3733202d5fa13e836575bd7bbbe4067f477f221f1c12e8e7f27669eca8/py_moneyed-0.4-py2.6.egg" }, { "comment_text": "", "digests": { "md5": "ce0e459e0a87cb75416dc0cdaf64564a", "sha256": "d01382e81c810603963a6447088f89c069eadd5ff5644585f81f8e4f048a0a32" }, "downloads": -1, "filename": "py-moneyed-0.4.tar.gz", "has_sig": false, "md5_digest": "ce0e459e0a87cb75416dc0cdaf64564a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12912, "upload_time": "2012-04-09T05:34:42", "url": "https://files.pythonhosted.org/packages/44/f9/fc5dbbc3459ca7cbaf7e9e83d6af55e7e8b2624c6e2a3d9d026db88e0f7b/py-moneyed-0.4.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "96a141ce6bc20d839f66e4610b3af8cc", "sha256": "7738c1f8c9c2494fd8806997c0cfd33393606063ebdf72ec01ab69bb3267f2e2" }, "downloads": -1, "filename": "py_moneyed-0.4.1-py2.6.egg", "has_sig": false, "md5_digest": "96a141ce6bc20d839f66e4610b3af8cc", "packagetype": "bdist_egg", "python_version": "2.6", "requires_python": null, "size": 30271, "upload_time": "2013-01-06T22:23:25", "url": "https://files.pythonhosted.org/packages/89/b4/aa170784da620ca9e88ce535531346040ae699f0cde0b526153be1018984/py_moneyed-0.4.1-py2.6.egg" }, { "comment_text": "", "digests": { "md5": "ecc58392dba24210a44fc91b7924beb2", "sha256": "bbae23b79f175b582d05f8b55066b056dd0805904f69cedac435f1ef1e6c435e" }, "downloads": -1, "filename": "py-moneyed-0.4.1.tar.gz", "has_sig": false, "md5_digest": "ecc58392dba24210a44fc91b7924beb2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12951, "upload_time": "2013-01-06T22:23:24", "url": "https://files.pythonhosted.org/packages/43/90/3caa6534708ff3fe535f16cb5fb71569e82dd2e746ae76497dddd8b75ccf/py-moneyed-0.4.1.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "749c7e67efc325fff39e47ed2cf37aad", "sha256": "f44797ed0147fb9eb51c65d4f715c0f02c9c772db8401186b84bdf9fb02a4b05" }, "downloads": -1, "filename": "py_moneyed-0.5.0-py2.7.egg", "has_sig": false, "md5_digest": "749c7e67efc325fff39e47ed2cf37aad", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 31525, "upload_time": "2013-11-15T16:30:12", "url": "https://files.pythonhosted.org/packages/64/1a/28b7565ae93bd0b573c687a3b2b5e15fab3646dee5db42e513c24a4dbf35/py_moneyed-0.5.0-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "6d6eebb6b8936054d0fdde6646c871aa", "sha256": "06cea60bffbdb8116688d305e8d645a2c32beef88d310d9b32382fd43edf88e6" }, "downloads": -1, "filename": "py-moneyed-0.5.0.tar.gz", "has_sig": false, "md5_digest": "6d6eebb6b8936054d0fdde6646c871aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13778, "upload_time": "2013-11-15T16:30:09", "url": "https://files.pythonhosted.org/packages/11/bb/46287952823ccf6ed90618eb17ef6f37ffa1b1a70e6a8093436b9ffea176/py-moneyed-0.5.0.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "cbf0050f55d3d87d514550cd2fea9477", "sha256": "a90d208e3a4890e79136567d90ab1d8e5bc84107e98630cb351a249353f9e88d" }, "downloads": -1, "filename": "py_moneyed-0.6.0-py2-none-any.whl", "has_sig": false, "md5_digest": "cbf0050f55d3d87d514550cd2fea9477", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 17941, "upload_time": "2015-08-11T10:52:28", "url": "https://files.pythonhosted.org/packages/ef/ba/24a56c2e0b1603b4b64063a2cbc1cce68ebdb068ce8e3fff1e6214d29d28/py_moneyed-0.6.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "69b110268a9e83071050392bb7b88d30", "sha256": "3d59ace3c4fb59d2d55d710684ac37cf422eba25aed02d6de7eb7926afc0db3c" }, "downloads": -1, "filename": "py-moneyed-0.6.0.tar.gz", "has_sig": false, "md5_digest": "69b110268a9e83071050392bb7b88d30", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17843, "upload_time": "2015-08-11T10:52:23", "url": "https://files.pythonhosted.org/packages/24/cc/536f70bb83ea96d9a2affa857d43cf988dddc959ec42655bf59423ba3113/py-moneyed-0.6.0.tar.gz" } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "b5800fb689f2df0c9c3315904aec3340", "sha256": "0c5dc04f77f1e0a123df051cc6ddc79267a48c612cb2d3dcfe7eb88cfc395bf9" }, "downloads": -1, "filename": "py_moneyed-0.7.0-py3-none-any.whl", "has_sig": false, "md5_digest": "b5800fb689f2df0c9c3315904aec3340", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 20116, "upload_time": "2017-05-08T08:55:14", "url": "https://files.pythonhosted.org/packages/4c/2c/3c57645cddb0e64aac10749829a843eb5e3aab8e067e2c870d98c38a7947/py_moneyed-0.7.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "34fe426837979a526a7f2d09e9888a64", "sha256": "f8c04183fd65d307a4b59f4a68332d3b9418d668b2a36cedd531f9cd1eb98933" }, "downloads": -1, "filename": "py-moneyed-0.7.0.tar.gz", "has_sig": false, "md5_digest": "34fe426837979a526a7f2d09e9888a64", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20908, "upload_time": "2017-05-08T08:55:12", "url": "https://files.pythonhosted.org/packages/6c/d7/4c18795b2db308dee630a5fb0d5b7861efc21212c58d98caeb589f9f3616/py-moneyed-0.7.0.tar.gz" } ], "0.8.0": [ { "comment_text": "", "digests": { "md5": "5306681bc180c862394b5925f1222288", "sha256": "c6691b914a5e4b5b2335cf113620479a52cc82988c0e143435a7c5c7d60cd4ad" }, "downloads": -1, "filename": "py_moneyed-0.8.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5306681bc180c862394b5925f1222288", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 18662, "upload_time": "2018-11-19T13:31:29", "url": "https://files.pythonhosted.org/packages/fc/84/2efdf86de54c2601a66caa4504f6978432f15f79b593772e9b0cc9cceddc/py_moneyed-0.8.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "261ec2667dd4123aeb21db467c7d6cf2", "sha256": "ec73795171919d537880a33c44d07fcdf0a5225e8368684fe02f0e75a6404742" }, "downloads": -1, "filename": "py-moneyed-0.8.0.tar.gz", "has_sig": false, "md5_digest": "261ec2667dd4123aeb21db467c7d6cf2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21865, "upload_time": "2018-11-19T13:31:31", "url": "https://files.pythonhosted.org/packages/09/d2/f8855d8b241fc10c12b3d923cea329220b73f0f4c33e502bf432684065e8/py-moneyed-0.8.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5306681bc180c862394b5925f1222288", "sha256": "c6691b914a5e4b5b2335cf113620479a52cc82988c0e143435a7c5c7d60cd4ad" }, "downloads": -1, "filename": "py_moneyed-0.8.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5306681bc180c862394b5925f1222288", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 18662, "upload_time": "2018-11-19T13:31:29", "url": "https://files.pythonhosted.org/packages/fc/84/2efdf86de54c2601a66caa4504f6978432f15f79b593772e9b0cc9cceddc/py_moneyed-0.8.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "261ec2667dd4123aeb21db467c7d6cf2", "sha256": "ec73795171919d537880a33c44d07fcdf0a5225e8368684fe02f0e75a6404742" }, "downloads": -1, "filename": "py-moneyed-0.8.0.tar.gz", "has_sig": false, "md5_digest": "261ec2667dd4123aeb21db467c7d6cf2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21865, "upload_time": "2018-11-19T13:31:31", "url": "https://files.pythonhosted.org/packages/09/d2/f8855d8b241fc10c12b3d923cea329220b73f0f4c33e502bf432684065e8/py-moneyed-0.8.0.tar.gz" } ] }