{ "info": { "author": "Dmitry E. Kislov", "author_email": "kislov@easydan.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Environment :: Other Environment", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Education", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Mathematics" ], "description": "About\n=====\n\n.. image:: https://travis-ci.org/scidam/solver.svg?branch=master\n :target: https://travis-ci.org/scidam/solver\n\n*A simple problem solver written in pure Python*\n\nModule provides an easy way to solve various problems that require\ncalculations. Lets imagine a problem formulated in\na text file using a some template language. Some places\nwithin the problem formulation text correspond to variables\nthat have default values. What does `to solve a problem` mean in this context?\nTo solve the problem is to 1) define output template (used to render solution), 2) write code\nthat exploits input variables, 3) set up output variables in the code and, finally, 4) \nrender the solution template.\nWith help of solver classes these steps of getting a problem solution\ncan be made easily.\n\nSolver features:\n * arbitrary and independent input and output markups\n used in problem formulation and solution templates.\n * ability of asynchronous problem solving (Celery is required).\n * heuristic testing of problem solvability.\n * using all of Python computational power (with third party libraries) to solve your problems.\n * using jinja2 template language to produce dynamic parts of a problem\n formulation/solution.\n\n\nRequirements\n============\n\nThe solver works under Python 2.7.x and Python 3.3 and higher. \nThe only requirements:\n\n- ``jinja2``\n- ``six``\n\n\nInstallation\n============\n\nInstall ``pysolver`` ::\n\n$ pip install python-solver\n\n\nTesting\n=======\n\nTo run tests enter the command (additionally ``numpy`` is required): ::\n\n$ python -m solver.tests\n\n\nUsage example\n=============\n\n**A simple test problem.** My name is John. I have 100 $.\nI want to buy several papers. Each paper worth is 5 $. \nHow many papers can I buy?\n\n\nTest problem (abstraction level) \n\n.. code-block:: python\n\n\n\ttest_problem_template_formulation = \"\"\"My name is {{username}}. I have {{total}} $.\n\tI want to buy several papers. Each paper worth is {{paper_cost}}$.\n\tHow many papers can I buy?\n\t\"\"\"\n\t\n\ttest_problem_solution_code = \"\"\"\n\t OUTPUTS['result']=INPUTS['total']/INPUTS['paper_cost']\n\t OUTPUTS['name'] = INPUTS['username']\n\t \"\"\"\n\ttest_problem_output_template=\"\"\"\n\t My name is {{name}} and answer is {{result}}.\n\t \"\"\"\n\t\n\tfrom solver import Task, Solver\n\t\n\ttask = Task(test_problem_template_formulation,\n\t default_vals={'username': 'John',\n\t 'total': 100, 'paper_cost': 20},\n\t solution_template=test_problem_output_template,\n\t code = test_problem_solution_code\n\t )\n\t\n\tpsolver = Solver(task)\n\n\nSolve the problem ::\n\n\t$ psolver.solve()\n\nor you can try to solve the problem asynchronously instead.\nif error occur in async_solve, \nthe solve() method will be invoked by default. ::\n\n\tpsolver.async_solve()\n\nBefore rendering the results check the problem solution is ready\n(This step is required, when getting the solution asynchronously)\n\n.. code-block:: python\n\n\n\tif psolver.is_solved:\n\t task.render_outputs() \n print(task.output) \n\n\nAnd, finally, print rendered template or do something else.", "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/scidam/solver", "keywords": "Python solver,problem solver,task templates,solution templates engine,computational problems,mathematics", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "pysolver", "package_url": "https://pypi.org/project/pysolver/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pysolver/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/scidam/solver" }, "release_url": "https://pypi.org/project/pysolver/0.0.3/", "requires_dist": null, "requires_python": null, "summary": "Make problem solving process easier", "version": "0.0.3" }, "last_serial": 1831137, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "abb4149e72e4b6170a16433b4b63bdb3", "sha256": "a08469a1cd82358cd29bfb41e233d790cf8a398ee94c0257b8186bb7166fbb9c" }, "downloads": -1, "filename": "pysolver-0.0.1.tar.gz", "has_sig": false, "md5_digest": "abb4149e72e4b6170a16433b4b63bdb3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10204, "upload_time": "2015-11-12T05:17:36", "url": "https://files.pythonhosted.org/packages/cd/67/f32118816795801fd4eb386596082df9fdafc47bcc58b9d8dcf58ef66189/pysolver-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "561617445c0669824aa8caface71e719", "sha256": "a6203d0d338688278432ab6570212e069f974dd5ab895e691fd80c5cdb8c469f" }, "downloads": -1, "filename": "pysolver-0.0.2.tar.gz", "has_sig": false, "md5_digest": "561617445c0669824aa8caface71e719", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10435, "upload_time": "2015-11-12T23:19:55", "url": "https://files.pythonhosted.org/packages/f1/5e/28df64847c4c2b5db88632c974b75f13b0abcf6d2af8626c3cfe52046c8b/pysolver-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "fe53057f44e578015e4b8e1aa28a0694", "sha256": "2e77c9758911e540a835c4dcefe53565fabef59b5e4ccac8db89894be6bb2126" }, "downloads": -1, "filename": "pysolver-0.0.3.tar.gz", "has_sig": false, "md5_digest": "fe53057f44e578015e4b8e1aa28a0694", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10475, "upload_time": "2015-11-24T10:13:04", "url": "https://files.pythonhosted.org/packages/eb/51/e2cbc4b7ef84c212e614c0bdf350dd259093b85b7cab62236e3cfab2ba29/pysolver-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fe53057f44e578015e4b8e1aa28a0694", "sha256": "2e77c9758911e540a835c4dcefe53565fabef59b5e4ccac8db89894be6bb2126" }, "downloads": -1, "filename": "pysolver-0.0.3.tar.gz", "has_sig": false, "md5_digest": "fe53057f44e578015e4b8e1aa28a0694", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10475, "upload_time": "2015-11-24T10:13:04", "url": "https://files.pythonhosted.org/packages/eb/51/e2cbc4b7ef84c212e614c0bdf350dd259093b85b7cab62236e3cfab2ba29/pysolver-0.0.3.tar.gz" } ] }