{ "info": { "author": "Jacek Artymiak", "author_email": "jacek@artymiak.com", "bugtrack_url": null, "classifiers": [], "description": "Calculator\n==========\n\nA simple calculator library.\n\nThis module is now a Python package. You can install it using:\n\n $ sudo pip install simplecalculator\n\nExamples of usage:\n\n * `simplecalculator.py` -- a command-line utility\n\n * `tornadoweb.py` -- a TornadoWeb applications with a minimalistic RESTful API. Do you math with curl!\n\nHow?\n----\n\nClone this repo and tests:\n\n $ python -m unittest test\n\nAll good?\n\nUsage (in your script)\n-----------------------\n\n 1. Import `calculator`\n\n 2. Instantiate `SimpleCalculator()`\n\n 3. Call `run()` with the list of values, operands, and functions you want to process.\n\n 4. The history of operations, results, and unprocessed input is stored in `SimpleCalculator.log`.\n\nHere's a short sample:\n\n from calculator.simple import SimpleCalculator\n\n c = SimpleCalculator()\n c.run('1 + 1')\n print c.log\n\nIf you want to read the state of the LCD (no kidding!), use\n\n print c.lcd\n\nUsage (on the command line)\n---------------------------\n\nRun:\n\n $ ./simplecalculator.py -s \"1 + 2 / 6 acv 1 + 1 / 33 fmod 0.01\"\n\nthen\n\n\n $ ./simplecalculator.py -s \"1 + 2 / 6 acv 1 + 1 / 33 ceil fmod\"\n\nthen\n\n $ ./simplecalculator.py -s \"1 + 2 / 6 acv 1 + 1 / 33 fmod 0.01 1 2 3 4\"\n\nThis calculator is as forgiving as a simple desktop calculator, it will ignore what it does not know, try to compute what it can treating the given string as a list of keystrokes. You may see one or more `status` entries after the last result, that's intended.\n\nUsage (via curl)\n----------------\n\nIf you want to implement this alculator as a RESTful API, install [TornadoWeb](http://tornadoweb.org 'TornadoWeb') and run `tornadoweb.py', then use curl:\n\n $ curl -X POST http://localhost:8888/v1/calculate -d '1 + 2 / 6 acv 1 + 1 / 33 fmod 0.01 1 2 3 4'\n\nYou can easily extend this calculator to support any number of one- and two-argument functions, search calculator/simple.py for `fmod` and `ceil` to see what modifications you need to make.\n\nWhy?\n----\n\nI got asked to provide samples of my work, proof I know Python, etc. This project is way more than what I was asked to deliver, but I had more time to spare. There is more coming.\n\nWho?\n----\n\nJacek Artymiak\n", "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/badmetacoder/calculator", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "simplecalculator", "package_url": "https://pypi.org/project/simplecalculator/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/simplecalculator/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/badmetacoder/calculator" }, "release_url": "https://pypi.org/project/simplecalculator/0.0.4/", "requires_dist": null, "requires_python": null, "summary": "A simple calculator library.", "version": "0.0.4" }, "last_serial": 888424, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "58257ff0dd33ccd1274cddf035f19f0d", "sha256": "eeb8b7038584ca28f9a8e03b772837b85d1fc3ac40ce05a12573116dc4cf6908" }, "downloads": -1, "filename": "simplecalculator-0.0.1.tar.gz", "has_sig": false, "md5_digest": "58257ff0dd33ccd1274cddf035f19f0d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2504, "upload_time": "2013-08-20T12:12:06", "url": "https://files.pythonhosted.org/packages/91/94/484a417f99b377e36abfa14adfe5f5aeeb113c3708228a46ef0729ca9cf4/simplecalculator-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "bb9301bf9fddf749861d136a3dfa7faf", "sha256": "062d11e6f030c7c002fbc59cebec930d96009b5fce097aec385069b0d99b310a" }, "downloads": -1, "filename": "simplecalculator-0.0.2.tar.gz", "has_sig": false, "md5_digest": "bb9301bf9fddf749861d136a3dfa7faf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2642, "upload_time": "2013-08-20T13:54:19", "url": "https://files.pythonhosted.org/packages/d2/37/34eef52af162d33dc505fcdfab4c2a3f1cc87e720eb6037c91e252225da9/simplecalculator-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "d6fcf3013480414983f3673d753c8c2d", "sha256": "4d1918c9f0a2bd47d02e76a4644250684f1ce0664819986f3c2ae9eb1e3177cd" }, "downloads": -1, "filename": "simplecalculator-0.0.3.tar.gz", "has_sig": false, "md5_digest": "d6fcf3013480414983f3673d753c8c2d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2711, "upload_time": "2013-08-20T20:13:44", "url": "https://files.pythonhosted.org/packages/5d/cb/44fee458a7e95da97ab67b23d3541de468a802665e5fef648d169d4e69bd/simplecalculator-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "f7d3e6b77b3ece9ee18cb113339d2522", "sha256": "1d862b52bc21305ef7633e59be71aae233905c51846b8775b66afb0104fa6110" }, "downloads": -1, "filename": "simplecalculator-0.0.4.tar.gz", "has_sig": false, "md5_digest": "f7d3e6b77b3ece9ee18cb113339d2522", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2776, "upload_time": "2013-10-12T22:02:28", "url": "https://files.pythonhosted.org/packages/69/d8/3e50699faedb93a5818c962faefe81afdbbc2aa4a9ad55e6098f5416ece2/simplecalculator-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f7d3e6b77b3ece9ee18cb113339d2522", "sha256": "1d862b52bc21305ef7633e59be71aae233905c51846b8775b66afb0104fa6110" }, "downloads": -1, "filename": "simplecalculator-0.0.4.tar.gz", "has_sig": false, "md5_digest": "f7d3e6b77b3ece9ee18cb113339d2522", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2776, "upload_time": "2013-10-12T22:02:28", "url": "https://files.pythonhosted.org/packages/69/d8/3e50699faedb93a5818c962faefe81afdbbc2aa4a9ad55e6098f5416ece2/simplecalculator-0.0.4.tar.gz" } ] }