logical-unification
Logical unification in Python
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has no known vulnerabilities, installs with low friction, and offers a unique capability for pattern matching and logical unification that is not easily replicated with standard Python. It is well-suited for logic programming, symbolic computation, and complex pattern-based dispatch. The BSD-3-Clause license is permissive and poses no barrier.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later.
- Low install friction with a pure Python wheel and only two lightweight runtime dependencies.
- Active maintenance with a recent commit on 2026-02-25 and stable production status.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause permissive license allows use in most projects, including commercial, with minimal restrictions beyond attribution.
last release 2025-10-20 (298 days) · last repo commit 2026-02-25 · 53 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,268,792 downloads/mo, #4,133 on PyPI
Alternatives
Verify before relying
pip install logical-unification
from unification import var, unify, reify
x = var()
result = unify((1, x), (1, 2))
print(result) # {~x: 2}
print(reify((1, x), {x: 2})) # (1, 2)- Whether the package is actively maintained beyond the latest release date (2025-10-20); last commit is 2026-02-25 but days_since_release is 298.
- Performance characteristics for very large unification problems beyond the benchmarked nested list scenarios.
What it is and what it does
Logical unification is a computer science technique for finding substitutions that make different terms equivalent. This package implements unification in Python, allowing you to match patterns against data structures and extract variable bindings. It supports built-in Python types (tuples, dicts, namedtuples) and can be extended to custom classes via the @unifiable decorator.
The package also provides pattern-matching dispatch, letting you define multiple function implementations that are selected based on pattern matching against arguments. It uses a generator-based design to handle deeply nested structures without hitting Python's recursion limit, making it suitable for symbolic computation, logic programming, and complex pattern-based control flow.
Use it for
- Extract values from nested data structures using pattern matching with logic variables instead of manual traversal.
- Implement logic-programming-style algorithms like recursive pattern matching (e.g., Fibonacci via pattern dispatch).
- Route or dispatch function calls based on complex structural patterns in dictionaries or custom objects.
- Unify and reify custom domain objects (e.g., Account records) to find matching instances or extract fields.
- Build symbolic computation systems where you need to reason about term equivalence and substitution.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has no known vulnerabilities, installs with low friction, and offers a unique capability for pattern matching and logical unification that is not easily replicated with standard Python. It is well-suited for logic programming, symbolic computation, and complex pattern-based dispatch. The BSD-3-Clause license is permissive and poses no barrier.
Install
logical-unification on PyPI
Before you install
Low install friction with a pure Python wheel and only two lightweight runtime dependencies. Active maintenance with a recent commit on 2026-02-25 and stable production status.
Requires Python 3.9 or later.
License in practice
BSD-3-Clause permissive license allows use in most projects, including commercial, with minimal restrictions beyond attribution.
Quickstart
pip install logical-unification
from unification import var, unify, reify
x = var()
result = unify((1, x), (1, 2))
print(result) # {~x: 2}
print(reify((1, x), {x: 2})) # (1, 2)
Verify before relying
- Whether the package is actively maintained beyond the latest release date (2025-10-20); last commit is 2026-02-25 but days_since_release is 298.
- Performance characteristics for very large unification problems beyond the benchmarked nested list scenarios.
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagestoolzmultipledispatch |
| Maintenance | Actively maintained 298 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,268,792 / month, #4,133 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries |
Evidence: logical_unification-0.4.7-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “logical unification pattern matching”
- logical-unificationLogical unification in Python with support for pattern matching and…
- consImplements Lisp/Scheme-style cons operations (cons, car, cdr) for…
- libsastlibsast is a static application security testing library that scans…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also orderings · dep-logic · overloading · cons · multipledispatch · json-logic · methoddispatch · fastuuid · classes