{"library":"pylog","title":"Pylog - Pythonic Prolog Features","description":"Pylog is a lightweight Python library that implements core features of Prolog, enabling logic programming paradigms within Python. It allows defining facts and rules to perform simple logical deductions and goal-oriented queries. The current stable version is 1.1, with an infrequent release cadence focusing on stability and minor enhancements.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install pylog"],"cli":null},"imports":["from pylog.pylog import facts, rules, goal, run"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from pylog.pylog import facts, rules, goal, run\n\n# Define facts\nfacts(\"human(socrates)\")\nfacts(\"human(plato)\")\n\n# Define a rule: All humans are mortal\n# The body is a list of predicates that must be true for the head to be true.\nrules(\"mortal(X)\", [\"human(X)\"])\n\n# Define a goal to find all mortal beings\ngoal(\"mortal(X)\")\n\n# Run the inference engine to find solutions\nsolutions = run()\n\nprint(\"Solutions for mortal(X):\")\nfor s in solutions:\n    print(s)\n\n# Example for a specific query\ngoal(\"mortal(socrates)\")\nsolutions_socrates = run()\nprint(\"\\nSolutions for mortal(socrates):\")\nfor s in solutions_socrates:\n    print(s)","lang":"python","description":"This quickstart demonstrates how to define facts, create a simple rule using other predicates, set a goal, and retrieve solutions using the `run()` function. It showcases basic logical inference capabilities.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":"1.1","pypi_latest":"1.1","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":1.5,"avg_import_s":null,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pylog","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"17.9M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pylog","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.5,"import_time_s":null,"mem_mb":null,"disk_size":"18M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pylog","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"19.8M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pylog","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.5,"import_time_s":null,"mem_mb":null,"disk_size":"20M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pylog","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"11.7M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pylog","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.4,"import_time_s":null,"mem_mb":null,"disk_size":"12M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pylog","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"11.4M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pylog","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.4,"import_time_s":null,"mem_mb":null,"disk_size":"12M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pylog","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"17.4M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pylog","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.7,"import_time_s":null,"mem_mb":null,"disk_size":"18M"}]}}