python-constraint
python-constraint is a module implementing support for handling CSPs (Constraint Solving Problems) over finite domain
Decision gist · record as of 2026-08-14
Yes, with conditions. The library is actively maintained (recent commits) and solves a real problem with no external dependencies, but the stale release cycle (last version 2018-11-05) creates risk: you may encounter Python compatibility issues or undocumented bugs. Install it if you need a lightweight pure-Python CSP solver for prototyping or small-scale problems and are willing to test thoroughly or patch locally if needed. For production use or large-scale constraint solving, consider whether a more actively released alternative is available.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Package has not been released since 2018-11-05; compatibility with modern Python versions (3.7+) is not guaranteed despite active repository maintenance.
- High install friction: the package has not been released since 2018-11-05, and the last commit is recent (2026-08-14), suggesting maintenance activity but no new version published.
- Installation may encounter compatibility issues with modern Python environments.
License · maintenance · safety
permissive license (permissive) — Permissive BSD license allows use in most projects without significant restrictions, though the exact license text is not specified in the metadata.
last release 2018-11-05 (2839 days) · last repo commit 2026-08-14 · 515 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 309,876 downloads/mo, #7,750 on PyPI
Alternatives
Verify before relying
from constraint import Problem, AllDifferentConstraint
problem = Problem()
problem.addVariable("a", [1, 2, 3])
problem.addVariable("b", [4, 5, 6])
solutions = problem.getSolutions()- Whether the package actually supports Python 3.7+ despite classifiers only listing up to 3.6
- Current state of unit test coverage and whether 'Improve code coverage' roadmap item has been completed
- Performance characteristics and scalability limits for large CSP instances
What it is and what it does
python-constraint is a pure-Python library for solving constraint satisfaction problems—computational puzzles where you define variables with possible values (domains) and rules (constraints) that those values must satisfy. You create a Problem object, add variables and their allowed values, specify constraints like "a must not equal b" or "a times 2 must equal b", and ask the solver to find all valid assignments. It includes three solver strategies (backtracking, recursive backtracking, and minimum conflicts) and predefined constraint types for common patterns like all-different, exact sums, and set membership.
The library is useful for logic puzzles, scheduling, configuration problems, and other combinatorial search tasks where you need to explore a solution space systematically. It has no external dependencies and runs in standard Python, making it portable and easy to embed. However, the package has not been released in over five years, and while the repository shows recent activity, this stale release cycle creates uncertainty about compatibility with current Python versions and whether bug fixes or improvements have been made but not published.
Use it for
- Solve logic puzzles like N-queens, magic squares, or sudoku by encoding variables, domains, and constraints.
- Schedule tasks or resources with conflicting requirements by modeling availability and constraints.
- Generate valid configurations for systems where certain combinations of settings are forbidden or required.
- Verify that a set of rules or constraints is satisfiable and enumerate all valid solutions.
- Prototype constraint-based problem solvers before moving to specialized or compiled CSP libraries.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, with conditions.
The library is actively maintained (recent commits) and solves a real problem with no external dependencies, but the stale release cycle (last version 2018-11-05) creates risk: you may encounter Python compatibility issues or undocumented bugs. Install it if you need a lightweight pure-Python CSP solver for prototyping or small-scale problems and are willing to test thoroughly or patch locally if needed. For production use or large-scale constraint solving, consider whether a more actively released alternative is available.
Install
python-constraint on PyPI
Before you install
High install friction: the package has not been released since 2018-11-05, and the last commit is recent (2026-08-14), suggesting maintenance activity but no new version published. Installation may encounter compatibility issues with modern Python environments.
Package has not been released since 2018-11-05; compatibility with modern Python versions (3.7+) is not guaranteed despite active repository maintenance.
License in practice
Permissive BSD license allows use in most projects without significant restrictions, though the exact license text is not specified in the metadata.
Quickstart
from constraint import Problem, AllDifferentConstraint
problem = Problem()
problem.addVariable("a", [1, 2, 3])
problem.addVariable("b", [4, 5, 6])
solutions = problem.getSolutions()
Verify before relying
- Whether the package actually supports Python 3.7+ despite classifiers only listing up to 3.6
- Current state of unit test coverage and whether 'Improve code coverage' roadmap item has been completed
- Performance characteristics and scalability limits for large CSP instances
Package facts
| License | permissive license permissive |
| Python support | Not specified |
| Install friction | High. Source build required |
| Runtime dependencies | None |
| Maintenance | Actively maintained 2,839 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 309,876 / month, #7,750 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaEnvironment :: ConsoleIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: CythonProgramming Language :: PythonProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Topic :: Scientific/Engineering |
Evidence: python-constraint-1.4.0.tar.bz2
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 › “constraint satisfaction problem solver”
- python-constraintSolves constraint satisfaction problems (CSPs) over finite domains…
- pycosatProvides efficient Python bindings to PicoSAT, a C-based Boolean…
- clingoClingo is a Python binding to the clingo Answer Set Programming…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also clingo · pycosat · claripy · kiwisolver · python-sat · cvc5 · ortools · qpsolvers · nab-resolver · pyperplan