#552 · Primary category: Education & Research

pyswip

artificial-intelligence expert-systems logic-programming natural-language-processing prolog python robotics swi-prolog

PySwip is a Python-Prolog interface that enables querying SWI-Prolog in your Python programs.

Project last updated:02/15/26

GitHub Stars

550

Forks

104

Contributors

41

License

MIT

Why we included this project

PySwip lets Python programs talk to SWI-Prolog directly. It loads SWI-Prolog as a shared library through ctypes, so there is nothing to compile: you can assert facts, consult .pl files, and run queries that come back as Python dictionaries. That makes it a practical fit when you want to keep the declarative logic in Prolog and build the rest of the application in Python. The API is small, and you can also register Python functions as foreign predicates, which is handy for expert systems, rule-based NLP, or coursework that mixes both languages. It is an integration library, not a full AI framework, so it works best when you already have a Prolog knowledge base and just need a maintained way to drive it from Python.

Articles for this project

No articles for this project yet.

To suggest a topic or contribute an article, contact us.

Related projects in this category