Kiwisolver Python API

exception kiwisolver.BadRequiredStrength[source]

Bases: Exception

class kiwisolver.Constraint

Bases: object

expression()

Get the expression object for the constraint.

op()

Get the relational operator for the constraint.

strength()

Get the strength for the constraint.

violated()

Return whether or not the constraint was violated during the last solver pass.

exception kiwisolver.DuplicateConstraint(constraint)[source]

Bases: Exception

constraint
exception kiwisolver.DuplicateEditVariable(edit_variable)[source]

Bases: Exception

edit_variable
class kiwisolver.Expression

Bases: object

constant()

Get the constant for the expression.

terms()

Get the tuple of terms for the expression.

value()

Get the value for the expression.

class kiwisolver.Solver

Bases: object

addConstraint()

Add a constraint to the solver.

addEditVariable()

Add an edit variable to the solver.

dump()

Dump a representation of the solver internals to stdout.

dumps()

Dump a representation of the solver internals to a string.

hasConstraint()

Check whether the solver contains a constraint.

hasEditVariable()

Check whether the solver contains an edit variable.

removeConstraint()

Remove a constraint from the solver.

removeEditVariable()

Remove an edit variable from the solver.

reset()

Reset the solver to the initial empty starting condition.

suggestValue()

Suggest a desired value for an edit variable.

updateVariables()

Update the values of the solver variables.

class kiwisolver.Term

Bases: object

coefficient()

Get the coefficient for the term.

value()

Get the value for the term.

variable()

Get the variable for the term.

exception kiwisolver.UnknownConstraint(constraint)[source]

Bases: Exception

constraint
exception kiwisolver.UnknownEditVariable(edit_variable)[source]

Bases: Exception

edit_variable
exception kiwisolver.UnsatisfiableConstraint(constraint)[source]

Bases: Exception

constraint
class kiwisolver.Variable

Bases: object

context()

Get the context object associated with the variable.

name()

Get the name of the variable.

setContext()

Set the context object associated with the variable.

setName()

Set the name of the variable.

value()

Get the current value of the variable.