{ "info": { "author": "Lars van de Kerkhof", "author_email": "lars@permanentmarkers.nl", "bugtrack_url": null, "classifiers": [], "description": "formulaparser\n-------------\n\nA formula parser for python.\n\nCopyright (C) 2017 Lars van de Kerkhof\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n\nwhat it does\n============\n\nParses simple arythmetic formula's containing variables.\nCan then be used to compute values resolving the variables from a context\nobject.\n\n.. code-block:: python\n\n >>> from argparse import Namespace as KeyedObject\n >>> from formulaparser import Formula\n >>>\n >>> context = KeyedObject()\n >>> context.four = 4\n >>> context.three = 3\n >>> deepercontext = KeyedObject()\n >>> deepercontext.ten = 10\n >>> deepercontext.twelve = 12\n >>> context.nextlevel = deepercontext\n >>>\n >>> Formula(\"((1 + 2 + 3) + 4 + (3 + 7)) + 5\").calculate_value()\n 25\n >>> Formula(\"4!\").calculate_value()\n 24\n >>> Formula(\"3.287 / 6\").calculate_value()\n 0.5478333333333333\n >>> Formula(\"2 ^ 8\").calculate_value()\n 256\n >>> Formula(\"4 - (-4)\").calculate_value()\n 8\n >>> Formula(\"(4 * 6) - 8 + 7 - 4 + 3\").calculate_value()\n 22\n >>> Formula(\"((1 + four + 3) + nextlevel.ten + (3 + 7)) + 5\").calculate_value(context)\n 33\n >>> Formula(\"((four!) - 6) / nextlevel.twelve\").calculate_value(context)\n 1.5\n >>> Formula(\"2 ^ three\").calculate_value(context)\n 8\n >>> Formula(\"nextlevel.twelve - (-four)\").calculate_value(context)\n 16\n >>> Formula(\"(four * 6) - nextlevel.ten + 7 - 4 + 3\").calculate_value(context)\n 20", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/specialunderwear/python-formulaparser", "keywords": "", "license": "GPL v3", "maintainer": null, "maintainer_email": null, "name": "formulaparser", "package_url": "https://pypi.org/project/formulaparser/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/formulaparser/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/specialunderwear/python-formulaparser" }, "release_url": "https://pypi.org/project/formulaparser/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "Parse an arythmic formula from a string", "version": "0.0.1" }, "last_serial": 2720250, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "76d11c2344f62e7619f182549c9bfecb", "sha256": "090c9cbc3a91d914b2be59b5cd29e80f21ca170ff8272fc6da9c10af2abf5855" }, "downloads": -1, "filename": "formulaparser-0.0.1.tar.gz", "has_sig": false, "md5_digest": "76d11c2344f62e7619f182549c9bfecb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15887, "upload_time": "2017-03-21T12:51:07", "url": "https://files.pythonhosted.org/packages/ff/42/28b9be2ee5ed92fa2f6bb5169cc16ad21f929371410c038b89c8508b75a7/formulaparser-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "76d11c2344f62e7619f182549c9bfecb", "sha256": "090c9cbc3a91d914b2be59b5cd29e80f21ca170ff8272fc6da9c10af2abf5855" }, "downloads": -1, "filename": "formulaparser-0.0.1.tar.gz", "has_sig": false, "md5_digest": "76d11c2344f62e7619f182549c9bfecb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15887, "upload_time": "2017-03-21T12:51:07", "url": "https://files.pythonhosted.org/packages/ff/42/28b9be2ee5ed92fa2f6bb5169cc16ad21f929371410c038b89c8508b75a7/formulaparser-0.0.1.tar.gz" } ] }