{ "info": { "author": "Yuce Tekol", "author_email": "yucetekol@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "\n\n\n# PySwip\n\n## What's New?\n\nSee the [CHANGELOG](CHANGELOG.md).\n\n**This library is being cleaned up and refactored. Expect API breakage and incompatibility with previous versions.**\n\n**WARNING! PySwip has no Windows installers! If you are a Windows user, see [INSTALL](https://github.com/yuce/pyswip/blob/master/INSTALL.md#windows). There are some \"free download\" sites that claim to be hosting PySwip installers. DO NOT TRUST THEM!**\n\nThanks to all [contributors](CONTRIBUTORS.txt).\n\n## Introduction\n\nPySwip is a Python - SWI-Prolog bridge enabling to query [SWI-Prolog](http://www.swi-prolog.org) in your Python programs.\nIt features an (incomplete) SWI-Prolog foreign language interface, a utility class that makes it easy querying with Prolog and also a\nPythonic interface.\n\nSince PySwip uses SWI-Prolog as a shared library and ctypes to access it, it doesn't require compilation to be installed.\n\n## Requirements:\n\n* Python 2.7 or 3.4 and higher.\n * PyPy is currently not supported.\n* SWI-Prolog 7.2.x and higher.\n* `libswipl` as a shared library. *This is the default on most platforms.*\n* Works on Linux, Windows, MacOS and FreeBSD. Should work on other POSIX.\n\n## Install\n\n**IMPORTANT: Make sure the SWI-Prolog architecture is the same as the Python architecture. If you are using a 64bit build of Python, use a 64bit build of SWI-Prolog, etc.***\n\nSee [INSTALL](INSTALL.md) for instructions.\n\n## Examples\n\n### Using Prolog\n\n```python\nfrom pyswip import Prolog\nprolog = Prolog()\nprolog.assertz(\"father(michael,john)\")\nprolog.assertz(\"father(michael,gina)\")\nlist(prolog.query(\"father(michael,X)\")) == [{'X': 'john'}, {'X': 'gina'}]\nfor soln in prolog.query(\"father(X,Y)\"):\n print(soln[\"X\"], \"is the father of\", soln[\"Y\"])\n# michael is the father of john\n# michael is the father of gina\n```\n\nAn existing knowledge base stored in a Prolog file can also be consulted,\nand queried. Assuming the filename \"knowledge_base.pl\" and the Python is\nbeing run in the same working directory, it is consulted like so:\n\n >>> from pyswip import Prolog\n >>> prolog = Prolog()\n >>> prolog.consult(\"knowledge_base.pl\")\n\n### Foreign Functions\n\n```python\nfrom __future__ import print_function\nfrom pyswip import Prolog, registerForeign\n\ndef hello(t):\n print(\"Hello,\", t)\nhello.arity = 1\n\nregisterForeign(hello)\n\nprolog = Prolog()\nprolog.assertz(\"father(michael,john)\")\nprolog.assertz(\"father(michael,gina)\")\nprint(list(prolog.query(\"father(michael,X), hello(X)\")))\n```\n\n### Pythonic interface (Experimental)\n\n```python\nfrom __future__ import print_function\nfrom pyswip import Functor, Variable, Query, call\n\nassertz = Functor(\"assertz\", 1)\nfather = Functor(\"father\", 2)\ncall(assertz(father(\"michael\",\"john\")))\ncall(assertz(father(\"michael\",\"gina\")))\nX = Variable()\n\nq = Query(father(\"michael\",X))\nwhile q.nextSolution():\n print(\"Hello,\", X.value)\nq.closeQuery()\n\n# Outputs:\n# Hello, john\n# Hello, gina\n\n```\n\nThe core functionality of `Prolog.query` is based on Nathan Denny's public domain prolog.py.\n\n## Help!\n\n* [Support Forum](https://groups.google.com/forum/#!forum/pyswip)\n* [Stack Overflow](https://stackoverflow.com/search?q=pyswip)\n\n## Projects/Publications that Use or Reference PySwip\n\n**Do you have a project, video or publication that uses/mentions PySwip? [file an issue](https://github.com/yuce/pyswip/issues/new?title=Powered%20by%20PySwip) or send a pull request.**\n\n### Books\n\n* [Beginning Artificial Intelligence with the Raspberry Pi](https://www.apress.com/gp/book/9781484227428)\n\n### Publications\n\n* [Assessment of Graph Databases as a Viable Materiel Solution for the Army's Dynamic Force Structure (DFS) Portal Implementation: Part 3, Risks, Mitigation Approach, and Roadmap](https://www.researchgate.net/publication/321977892_Assessment_of_Graph_Databases_as_a_Viable_Materiel_Solution_for_the_Army's_Dynamic_Force_Structure_DFS_Portal_Implementation_Part_3_Risks_Mitigation_Approach_and_Roadmap_Assessment_of_Graph_Databases_)\n* [Tackling Complexity in High Performance Computing Applications](https://link.springer.com/article/10.1007/s10766-016-0422-9)\n* [Social Human-Robot Interaction: A New Cognitive and Affective Interaction-Oriented Architecture](https://www.springer.com/gp/book/9783319474366)\n* [A Planning Module for a ROS-Based Ubiquitous Robot Control System](https://dspace.library.uu.nl/bitstream/handle/1874/292669/2014-03-27%20MSc%20Thesis%20Pieterjan%20van%20Gastel.pdf) (PDF)\n* [A pilot framework developed as a common platform integrating diverse elements of computer aided fixture design](https://www.tandfonline.com/doi/full/10.1080/00207543.2013.832000)\n* [Integration von Prolog und ClioPatria in Python](http://www1.pub.informatik.uni-wuerzburg.de/pub/theses/2017-bodenlos-master.pdf) (PDF, German)\n* [SELECTSCRIPT: A Query Language for Robotic World Models and Simulations](https://ieeexplore.ieee.org/document/7140077/)\n* [A Concept for Declarative Information Acquisition in Smart Environments](https://d-nb.info/1122172583/34)\n* [Implementation on ADHD Diagnostic Expert System based on DSM Diagnostic Criteria](http://jse.or.kr/AJMAHS/papers/v7n11/50.pdf) (PDF, Korean)\n* [Wie sehen Krebsmolekule aus? Vergleich der Gute der Klassifizierung potenziell krebserregender Molekule durch induktiv logische und merkmalsbasierte Lernverfahren](http://www.cogsys.wiai.uni-bamberg.de/teaching/ss17/pj_bama/ProjektberichtRelLearningFinzelGrabeHillebrandHornigRicci.pdf) (PDF, German)\n* [Companion Robots Behaving with Style: Towards Plasticity in Social Human-Robot Interaction](https://tel.archives-ouvertes.fr/tel-01679314/document) (PDF)\n* [Semi-automatically Augmenting Attack Trees using an Annotated Attack Tree Library](https://www.researchgate.net/publication/327985985_Semi-automatically_Augmenting_Attack_Trees_Using_an_Annotated_Attack_Tree_Library)\n\n### Videos\n\n* [AI - blocks world solver interactive planner](https://www.youtube.com/watch?v=p1m8htUEHrc)\n* [PySwip, Prolog, JAVA SCRIPT and HTML](https://www.youtube.com/watch?v=Oj8xsW2vaLA) (Spanish)\n* [GET OUT OF THE MAZE WITH PROLOG AND PYTHON](https://www.youtube.com/watch?v=MW3S0Jfa0LU) (Spanish)\n\n### Projects\n\n* [noworkflow](https://github.com/gems-uff/noworkflow) Supporting infrastructure to run scientific experiments without a scientific workflow management system. http://gems-uff.github.io/noworkflow\n* [Super Pacman](https://github.com/kajornsakp/prologProject)\n* [Pokemon Weak Detector](https://github.com/ReiiYuki/PokemonWeakDetector)\n* [Food Recommendations in Hyderabad, India](https://github.com/cindyleowtt/prolog_food) Food Recommendation AI Expert System using a GUI hosted on Flask and a backend developed with PYSWIP and native Prolog.\n* [pyswip_envctrl](https://github.com/2rs2ts/pyswip_envctrl) An environment control module expert system written in PySwip.\n* [tic-tac-toe](https://github.com/ivpusic/tic-tac-toe) Tic-tac-toe game with AI in Prolog and GUI in Python (kivy framework + pyswip).\n* [TBM1 - \"Getting to Know My Home\"](http://thewiki.rockinrobotchallenge.eu/index.php?title=TBM1_-_\u201cGetting_to_Know_My_Home\u201d)\n* [Prolog natural language parsing component to control a Scribbler II robot over bluetooth](http://justinmangue.com/blog/scribpro-py/)\n* [Cosmos](https://github.com/mcsoto/cosmos) A new logic programming language.\n* [lib-annotated-attack-trees](https://github.com/yramirezc/lib-annotated-attack-trees) Scripts and resources for creating a library of annotated attack trees and using it to refine an annotated attack tree.\n* [ClIDE](https://github.com/skeledrew/clide) Command-line Intelligent Development Environment\n* [Artificial Intelligence INF1771 @ PUC-Rio](https://github.com/leotok/INF1771) Projects for the Artificial Intelligence class @ PUC-Rio\n* [AutomobileAdvisor](https://github.com/liscju/AutomobileAdvisor) Projekt na systemy ekspertowe pomagaj\u0105cy wybra\u0107 odpowiedni samoch\u00f3d dla danego klienta na podstawie preferencji (Polish)\n* [Prolog Tetris AI](https://sourceforge.net/projects/prologtetrisai/)\n* [Jupyter SWI Prolog](https://github.com/targodan/jupyter-swi-prolog) A Jupyter Kernel for SWI-Prolog.\n* [Blocks World Planner](https://github.com/davideiacobs/BlocksWorldPlanner) A program that allows users to solve the blocks world problem interacting only using the natural language.\n\n### Blog Posts\n\n* [Calling Prolog from Python](http://fernmac.blogspot.com.tr/2013/07/calling-prolog-from-python.html)\n* [Python v. Prolog: Round 1: Fight!](http://www.kuliniewicz.org/blog/archives/2007/10/21/python-v-prolog-round-1-fight/)\n* [Path Follower: Arduino+Rasp on ROS](http://blog.giacomocerquone.com/path-follower-maze-solving-car-arduino/) and its [Project code](https://github.com/giacomocerquone/robotics-MazeSolver)\n* [10 minutes to make a GUI for your SWI-Prolog App via Python](http://www.paulbrownmagic.com/blog/quick_gui.html)\n\n## License\n\n```\nCopyright (c) 2007-2019 Y\u00fcce Tekol\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/yuce/pyswip/releases", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/yuce/pyswip", "keywords": "prolog,artificial intelligence,ai,ffi,ctypes", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pyswip", "package_url": "https://pypi.org/project/pyswip/", "platform": "", "project_url": "https://pypi.org/project/pyswip/", "project_urls": { "Download": "https://github.com/yuce/pyswip/releases", "Homepage": "https://github.com/yuce/pyswip" }, "release_url": "https://pypi.org/project/pyswip/0.2.9/", "requires_dist": null, "requires_python": "", "summary": "PySwip enables querying SWI-Prolog in your Python programs.", "version": "0.2.9" }, "last_serial": 5936453, "releases": { "0.1.0": [], "0.1.1": [], "0.1.2": [], "0.1.3": [], "0.2.0": [], "0.2.1": [], "0.2.2": [ { "comment_text": "", "digests": { "md5": "2ff192e10e1762297eba597cb2a0a9da", "sha256": "7633c206a2fa6f6fae5a1d76b7e2b2ad09aa14413f95e4fc96c91856a5fa6bc2" }, "downloads": -1, "filename": "pyswip-0.2.2.tar.gz", "has_sig": false, "md5_digest": "2ff192e10e1762297eba597cb2a0a9da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25325, "upload_time": "2008-02-08T12:38:53", "url": "https://files.pythonhosted.org/packages/c9/12/6806b29703d7423b9c0b7033a01f85f1d40bb7a553ccff51cc46eac4e486/pyswip-0.2.2.tar.gz" }, { "comment_text": "", "digests": { "md5": "02a9e78332ed541d83bf13fd7142ed94", "sha256": "7b85b579787d5c70eac42206157f746fe98e1aa092fd96f1f81e3db2803d1c00" }, "downloads": -1, "filename": "pyswip-0.2.2.win32.exe", "has_sig": false, "md5_digest": "02a9e78332ed541d83bf13fd7142ed94", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 76129, "upload_time": "2008-02-08T12:40:19", "url": "https://files.pythonhosted.org/packages/41/0f/d87bee97005bdbbbb6cea34b26f3c142d8d079c3114f8a6eff7eb5ea2ad6/pyswip-0.2.2.win32.exe" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "66cce1aab0a8b3cc62bfb031db1c6b56", "sha256": "ccb71c6cf79fb70ba07f7c3832cb317bc250f3207c36728b5a9cce414721a7d0" }, "downloads": -1, "filename": "pyswip-0.2.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "66cce1aab0a8b3cc62bfb031db1c6b56", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 23603, "upload_time": "2018-05-24T17:12:40", "url": "https://files.pythonhosted.org/packages/54/78/1675afb447d480c2850506ada8835b23483957a6bebbc6618197afecfce6/pyswip-0.2.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cad9150fb09ae778d272dced339da1c5", "sha256": "1bf788c76ea7f55a48e6d73de0064d7c3f77d0a4faa9ca05abdbc279913fc8ba" }, "downloads": -1, "filename": "pyswip-0.2.5.tar.gz", "has_sig": false, "md5_digest": "cad9150fb09ae778d272dced339da1c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20723, "upload_time": "2018-05-24T17:12:42", "url": "https://files.pythonhosted.org/packages/0d/81/eb9dad0db936be101f31b85e3a9d5d3fb11da63f1f0f3d9d56fe3ced70f1/pyswip-0.2.5.tar.gz" } ], "0.2.6": [ { "comment_text": "", "digests": { "md5": "0e76698c58d94cd4543e78a8896dad13", "sha256": "3afaa96bc415c26cbd85fa40ddfb5c3cbe753ef54659d495d731ad79205c7370" }, "downloads": -1, "filename": "pyswip-0.2.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0e76698c58d94cd4543e78a8896dad13", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 23848, "upload_time": "2018-06-03T20:27:34", "url": "https://files.pythonhosted.org/packages/a8/46/ff276f131017dd22b44fa0d4466eb7493e77d891513d7b24a0d80ff5d59f/pyswip-0.2.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5eaca42b7ad2976a72e2ac9d3ad93aed", "sha256": "1e3cd7c6b201a109656cab6e0a8cab39905e95dc00274e48622c812061121111" }, "downloads": -1, "filename": "pyswip-0.2.6.tar.gz", "has_sig": false, "md5_digest": "5eaca42b7ad2976a72e2ac9d3ad93aed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20981, "upload_time": "2018-06-03T20:27:36", "url": "https://files.pythonhosted.org/packages/2e/18/6e1398dae22903d8918591bb1b218bfa3f948b6dbd304d9c754b06721f22/pyswip-0.2.6.tar.gz" } ], "0.2.7": [ { "comment_text": "", "digests": { "md5": "afd576546659247bb686978f1d07c587", "sha256": "d325211039a97cf21f9621aeef610ebf7cc4ae30c521d20ad3bafd08ee7bc435" }, "downloads": -1, "filename": "pyswip-0.2.7-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "afd576546659247bb686978f1d07c587", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 24082, "upload_time": "2018-06-07T18:40:31", "url": "https://files.pythonhosted.org/packages/b2/61/e40e36237f7cbf4cb5602ce5a7dd4de502e6f25587c9ecf1081c95582bd9/pyswip-0.2.7-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "29be12f469d750a2367a6f111c25d457", "sha256": "a34a8257f388f345a9654395e4dab1450d1ea25f64c15a4265dc7d27586271bd" }, "downloads": -1, "filename": "pyswip-0.2.7.tar.gz", "has_sig": false, "md5_digest": "29be12f469d750a2367a6f111c25d457", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21250, "upload_time": "2018-06-07T18:40:32", "url": "https://files.pythonhosted.org/packages/19/d3/1b5fa1aa5c52bb6401cb435ef66037a85fa910eca1073acba3a174e5cea5/pyswip-0.2.7.tar.gz" } ], "0.2.8": [ { "comment_text": "", "digests": { "md5": "a3b258b078ea14cf2156c15cb75f8800", "sha256": "ecb44bb4f88cdccfc228e747660d268496c9931a55207206cd8bf48849d4fee5" }, "downloads": -1, "filename": "pyswip-0.2.8-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a3b258b078ea14cf2156c15cb75f8800", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 24218, "upload_time": "2019-02-20T00:49:48", "url": "https://files.pythonhosted.org/packages/60/cd/7defc05e52763f14286545331b8e865ff829304befcaf22c4001f5706b77/pyswip-0.2.8-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "139dc1eba8cc5f9b448f677044aa3dda", "sha256": "f07b3dc1c7fa610acb83f2fd49ab596d601d953739702dae2a98285abf97e1f0" }, "downloads": -1, "filename": "pyswip-0.2.8.tar.gz", "has_sig": false, "md5_digest": "139dc1eba8cc5f9b448f677044aa3dda", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21388, "upload_time": "2019-02-20T00:49:50", "url": "https://files.pythonhosted.org/packages/a0/6f/2c82b8afd2c844802ad4fbf0fa9092909bdad87dd35772b251cfa697332e/pyswip-0.2.8.tar.gz" } ], "0.2.9": [ { "comment_text": "", "digests": { "md5": "100a535038c5a449b20c46019a0cda2c", "sha256": "217de36dff08a4f647d52a2a3fe958bcf9bfdc98e7742e99669058697342f023" }, "downloads": -1, "filename": "pyswip-0.2.9-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "100a535038c5a449b20c46019a0cda2c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 25529, "upload_time": "2019-10-07T00:49:00", "url": "https://files.pythonhosted.org/packages/e4/f3/2b1462c4379b089426dbedb29d8d903e63baf37857ccf6e87f168b786019/pyswip-0.2.9-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bc8c918cea0c7693d5042651565c2bc2", "sha256": "4591414006340ad8f033f9f0ee4c4c9151cd5a309ed19741a9c79b9ffce8b58e" }, "downloads": -1, "filename": "pyswip-0.2.9.tar.gz", "has_sig": false, "md5_digest": "bc8c918cea0c7693d5042651565c2bc2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26149, "upload_time": "2019-10-07T00:49:02", "url": "https://files.pythonhosted.org/packages/b7/0e/e56d975d0708945ebd2fbde9fcc195ce9d11f6d59e2e6ce3163b0509e28e/pyswip-0.2.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "100a535038c5a449b20c46019a0cda2c", "sha256": "217de36dff08a4f647d52a2a3fe958bcf9bfdc98e7742e99669058697342f023" }, "downloads": -1, "filename": "pyswip-0.2.9-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "100a535038c5a449b20c46019a0cda2c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 25529, "upload_time": "2019-10-07T00:49:00", "url": "https://files.pythonhosted.org/packages/e4/f3/2b1462c4379b089426dbedb29d8d903e63baf37857ccf6e87f168b786019/pyswip-0.2.9-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bc8c918cea0c7693d5042651565c2bc2", "sha256": "4591414006340ad8f033f9f0ee4c4c9151cd5a309ed19741a9c79b9ffce8b58e" }, "downloads": -1, "filename": "pyswip-0.2.9.tar.gz", "has_sig": false, "md5_digest": "bc8c918cea0c7693d5042651565c2bc2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26149, "upload_time": "2019-10-07T00:49:02", "url": "https://files.pythonhosted.org/packages/b7/0e/e56d975d0708945ebd2fbde9fcc195ce9d11f6d59e2e6ce3163b0509e28e/pyswip-0.2.9.tar.gz" } ] }