{ "info": { "author": "Yuce Tekol", "author_email": "yucetekol@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "PySWIP Alt 0.2.3\n================\n\n\nDisclaimer:\n\nThis is a fork from https://github.com/yuce/pyswip\nIts only purpose is to publish the most updated version at pypi\n\n-----------------\n\nPySWIP is a Python - SWI-Prolog bridge enabling to query SWI-Prolog\nin your Python programs. It features an (incomplete) SWI-Prolog foreign\nlanguage interface, a utility class that makes it easy querying with Prolog\nand also a Pythonic interface.\n\nSince PySWIP uses SWI-Prolog as a shared library and ctypes to access it,\nit doesn't require compilation to be installed.\n\nNote that this version of PySWIP is slightly incompatible with 0.1.x versions.\n\nRequirements:\n-------------\n\n* Python 2.3 and higher.\n* ctypes 1.0 and higher.\n* SWI-Prolog 5.6.x and higher (most probably other versions will also work).\n* libpl as a shared library.\n* Works on Linux and Win (32 & 64), should work for all POSIX.\n\nNews\n----\n\n* Importing ``pyswip`` automatically initializes SWI-Prolog.\n* Fixed a bug with querying lists with the new interface.\n\nExample (Using Prolog):\n-----------------------\n\n >>> from pyswip import Prolog\n >>> prolog = Prolog()\n >>> prolog.assertz(\"father(michael,john)\")\n >>> prolog.assertz(\"father(michael,gina)\")\n >>> list(prolog.query(\"father(michael,X)\"))\n [{'X': 'john'}, {'X': 'gina'}]\n >>> for soln in prolog.query(\"father(X,Y)\"):\n ... print soln[\"X\"], \"is the father of\", soln[\"Y\"]\n ...\n michael is the father of john\n michael is the father of gina\n\nSince version 0.1.3 of PySWIP, it is possible to register a Python function as a\nProlog predicate through SWI-Prolog's foreign language interface.\n\nExample (Foreign Functions):\n----------------------------\n\n from pyswip import Prolog, registerForeign\n\n def hello(t):\n print \"Hello,\", t\n hello.arity = 1\n\n registerForeign(hello)\n\n prolog = Prolog()\n prolog.assertz(\"father(michael,john)\")\n prolog.assertz(\"father(michael,gina)\")\n list(prolog.query(\"father(michael,X), hello(X)\"))\n\nOutputs:\n Hello, john\n Hello, gina\n\nSince version 0.2, PySWIP contains a 'Pythonic' interface which allows writing\npredicates in pure Python (*Note that interface is experimental.*)\n\nExample (Pythonic interface):\n-----------------------------\n\n from pyswip import Functor, Variable, Query\n\n assertz = Functor(\"assertz\", 2)\n father = Functor(\"father\", 2)\n\n call(assertz(father(\"michael\",\"john\")))\n call(assertz(father(\"michael\",\"gina\")))\n\n X = Variable()\n q = Query(father(\"michael\",X))\n while q.nextSolution():\n print \"Hello,\", X.value\n\nOutputs:\n Hello, john\n Hello, gina", "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/JoaoFelipe/pyswip/", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "pyswip_alt", "package_url": "https://pypi.org/project/pyswip_alt/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyswip_alt/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/JoaoFelipe/pyswip/" }, "release_url": "https://pypi.org/project/pyswip_alt/0.2.3/", "requires_dist": null, "requires_python": null, "summary": "PySWIP enables querying SWI-Prolog in your Python programs.", "version": "0.2.3" }, "last_serial": 1502529, "releases": { "0.2.3": [ { "comment_text": "", "digests": { "md5": "71b66ac1e0e377a37358229570f827c1", "sha256": "da6d97afb4d1494a07fe5c434d8f2569f8ead1a9c3fc05cc0f035aba75953ac6" }, "downloads": -1, "filename": "pyswip_alt-0.2.3-py2-none-any.whl", "has_sig": false, "md5_digest": "71b66ac1e0e377a37358229570f827c1", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 21902, "upload_time": "2015-04-12T21:18:03", "url": "https://files.pythonhosted.org/packages/ea/52/462d1d5945e6494e59dda06aa600e038e81f228229b236231f48e061bf5b/pyswip_alt-0.2.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d4d27cf129830819a73e722ab0ab692f", "sha256": "a19172f14a69a6014f966ee9074f6ffbaca991a5084176af60c3559a0c90f685" }, "downloads": -1, "filename": "pyswip_alt-0.2.3.tar.gz", "has_sig": false, "md5_digest": "d4d27cf129830819a73e722ab0ab692f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22139, "upload_time": "2015-04-12T21:17:59", "url": "https://files.pythonhosted.org/packages/8f/58/1f1d3b35accd2b8a3208fbcef90b759a6c19f7e070b38fce4031b5238066/pyswip_alt-0.2.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "71b66ac1e0e377a37358229570f827c1", "sha256": "da6d97afb4d1494a07fe5c434d8f2569f8ead1a9c3fc05cc0f035aba75953ac6" }, "downloads": -1, "filename": "pyswip_alt-0.2.3-py2-none-any.whl", "has_sig": false, "md5_digest": "71b66ac1e0e377a37358229570f827c1", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 21902, "upload_time": "2015-04-12T21:18:03", "url": "https://files.pythonhosted.org/packages/ea/52/462d1d5945e6494e59dda06aa600e038e81f228229b236231f48e061bf5b/pyswip_alt-0.2.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d4d27cf129830819a73e722ab0ab692f", "sha256": "a19172f14a69a6014f966ee9074f6ffbaca991a5084176af60c3559a0c90f685" }, "downloads": -1, "filename": "pyswip_alt-0.2.3.tar.gz", "has_sig": false, "md5_digest": "d4d27cf129830819a73e722ab0ab692f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22139, "upload_time": "2015-04-12T21:17:59", "url": "https://files.pythonhosted.org/packages/8f/58/1f1d3b35accd2b8a3208fbcef90b759a6c19f7e070b38fce4031b5238066/pyswip_alt-0.2.3.tar.gz" } ] }