The Secret Life of SymPy
SymPy (github) is a computer algebra system in Python. There are other open- and (closed-) source computer algebra systems (I tend to use Maxima, use a calculator with unites), but SymPy seems to be only popular one that is written purely in Python.
It is used in quite a few scientific and engineering projects, but exploring the dependency ecosystem of Sympy surprisingly I found out it is also used in configuring computing infrastructure!
SymPy and Cloudformation
CloudFormation is AWS’s configuration language and system for provisioning their facilities. They also supply cfn-lint which is a “linter” for the cloudformation files, more precisely that statically checks the files for any clear problems.
The linter in the “conditions” modules uses SymPy to help it validate cloudformation conditions, i.e., statements which may or may not be executed depending on a combination of the input variables.
SymPy is used for its boolean algebra capabilities, e.g., the modules
logic.inference
and logic.boolalg
are used. SymPy has examples of
using this to simplify
logic
and if a boolean function is
satisfiable.