Mini Computer Algebra System using Python
- Mathematical expression parsing
- Expression tree visualization
- Variable substitution
- And soon(TM) more
Create an Expression
e = Expression.fromstr('3x+2')
print(e) # + ( * ( 3, x ), 2 )Visualize the expression tree
from cas import graphing
graph = graphing.fromExpr(e)
graphing.view(graph)Substitute the variable in an expression
f = subs(e, 'x', 5)
print(f) # + ( * ( 3, 5 ), 2 )Run all tests:
pyCas $ python -m unittest discoverRun tests from a specific file:
pyCas $ python -m unittest ./tests/filename.py