python-constraint is a module for efficiently solving CSPs (Constraint Solving Problems) over finite domains.