{ "info": { "author": "", "author_email": "", "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 :: 3", "Topic :: Office/Business :: Financial", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Overview\n========\n\nCustomized fork of http://github.com/limist/py-moneyed which adds\nability to extend the core `Money` class.\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\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 has been tested with Python 2.6, 2.7, 3.2, 3.3 \nand 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.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/udemy/py-moneyed", "keywords": "money currency class abstraction", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "ud-py-moneyed", "package_url": "https://pypi.org/project/ud-py-moneyed/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/ud-py-moneyed/", "project_urls": { "Homepage": "https://github.com/udemy/py-moneyed" }, "release_url": "https://pypi.org/project/ud-py-moneyed/0.6.2/", "requires_dist": null, "requires_python": "", "summary": "Provides Currency and Money classes for use in your Python code.", "version": "0.6.2" }, "last_serial": 2050143, "releases": { "0.5.1": [ { "comment_text": "", "digests": { "md5": "92f23577591996e74efd262b3f7b9fa4", "sha256": "44684eed1cb7b6b766fbe4d2c94cff26748b216fecf08e85ecf977ed7a7fffed" }, "downloads": -1, "filename": "ud-py-moneyed-0.5.1.tar.gz", "has_sig": false, "md5_digest": "92f23577591996e74efd262b3f7b9fa4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15878, "upload_time": "2015-04-20T23:49:14", "url": "https://files.pythonhosted.org/packages/61/ff/bc96682797d57280cda1a4484a1aa107f83f658a5e267d9b082986a7c84a/ud-py-moneyed-0.5.1.tar.gz" } ], "0.5.2": [ { "comment_text": "", "digests": { "md5": "378f7fee9ce9f22fe1e331cd63018768", "sha256": "c53064f7cf2a79e815849f280f3903b1c7d501e62a1f8eb9951e1d44f4347c40" }, "downloads": -1, "filename": "ud-py-moneyed-0.5.2.tar.gz", "has_sig": false, "md5_digest": "378f7fee9ce9f22fe1e331cd63018768", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16162, "upload_time": "2015-04-24T17:00:49", "url": "https://files.pythonhosted.org/packages/77/dd/781c43bcf7775dd9d35ca3a9192448c106ad1fb2bc7c08b98e3d01b333fb/ud-py-moneyed-0.5.2.tar.gz" } ], "0.6.1": [ { "comment_text": "", "digests": { "md5": "1b9afef7963ac5c8162a45a7562c3fe0", "sha256": "c5f28e1c89f02c634dff6cf342751f18607855fcd147445d0e206967244226cc" }, "downloads": -1, "filename": "ud-py-moneyed-0.6.1.tar.gz", "has_sig": false, "md5_digest": "1b9afef7963ac5c8162a45a7562c3fe0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16710, "upload_time": "2015-10-07T19:49:49", "url": "https://files.pythonhosted.org/packages/4e/14/0aa2caa03c5b171762ed9b5a5065b834fc7feed090854d82108f89b66733/ud-py-moneyed-0.6.1.tar.gz" } ], "0.6.2": [ { "comment_text": "", "digests": { "md5": "96cb903d8f55b6f877d95d3b88cb8c6f", "sha256": "d9875bc5b420e9348dc71e5654e573e085111c495cc412fb022d3b4923548b74" }, "downloads": -1, "filename": "ud-py-moneyed-0.6.2.tar.gz", "has_sig": false, "md5_digest": "96cb903d8f55b6f877d95d3b88cb8c6f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16756, "upload_time": "2016-04-06T22:16:53", "url": "https://files.pythonhosted.org/packages/d8/0a/50124fd1cb701d2077c19cf28dc329e9084d6443b6be53abdf5424715635/ud-py-moneyed-0.6.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "96cb903d8f55b6f877d95d3b88cb8c6f", "sha256": "d9875bc5b420e9348dc71e5654e573e085111c495cc412fb022d3b4923548b74" }, "downloads": -1, "filename": "ud-py-moneyed-0.6.2.tar.gz", "has_sig": false, "md5_digest": "96cb903d8f55b6f877d95d3b88cb8c6f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16756, "upload_time": "2016-04-06T22:16:53", "url": "https://files.pythonhosted.org/packages/d8/0a/50124fd1cb701d2077c19cf28dc329e9084d6443b6be53abdf5424715635/ud-py-moneyed-0.6.2.tar.gz" } ] }