Unified wrapper for symbolic manipulation libraries in Python.
sym provides a unified wrapper to some symbolic manipulation libraries in Python. It makes it easy for library authors to test their packages against several symbolic manipulation libraries.
Currently the following Python pacakges are available as “backends”:
The capabilities exposed here are those needed by
- Numerical evaluation (including “lambdify” support)
see tests for examples. Note that pyodesys and pyneqsys also act as test suits for this package.
Auto-generated API documentation for the latest stable release is found here: https://bjodah.github.io/sym/latest (and the development version for the current master branch is found here: http://hera.physchem.kth.se/~sym/branches/master/html).
Simplest way to install sym and its (optional) dependencies is to use pip:
$ pip install --user sym pytest $ python -m pytest --pyargs sym
or the conda package manager:
$ conda install -c bjodah sym pytest $ python -m pytest --pyargs sym
Source distribution is available here: https://pypi.python.org/pypi/sym
>>> from sym import Backend >>> be = Backend('pysym') # just an example, use SymPy rather than pysym >>> x, y = map(be.Symbol, 'x y'.split()) >>> expr = x*y**2 - be.tan(2*x) >>> print(expr.diff(x)) ((y**2) - ((1 + (tan((2*x))**2))*2))