Math parser for simple and compound strings math expressions evaluations
Project description
pyBigParser
pyBigParser provides a class for parsing long and compound math expresions. You might find it most useful for tasks involving evaluating from single functions to compounds functions.
Installation
pip install pyBigParser
Example
Typical usage often looks like this::
#!/usr/bin/env python
from pybigparser import evaluator
parser = evaluator.MathParser()
parser.set_function("x**2+2*y")
parser.add_sub("x", "24+6*c")
parser.add_sub("y", "25 / d")
parser.add_sub("c", "1")
parser.add_sub("d", "4")
parser.evaluate()
print(parser.value)
print(parser.get_sub_value("x"))
print(parser.get_sub_value("y"))
Supported Functions and Constants
pyBigParser comes with support for evaluating the following functions and constants.
cos
sin
abs
log10
log
exp
tan
pi
e
Versions
- 1.3 - It saves the values for each sub-function.
- 1.5 - Fixed OverFlow Error with Exp function.
- 2.0 - Python 3 support.
Warnings
- The variables
e
andpi
are reserved for the evaluator. - Exceptions for iterative variables are not supported.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyBigParser-2.1.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for pyBigParser-2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5036022f1b27fcb40f424f94526c9564050d18fd2e7e1bc2f39ac81c4876bf79 |
|
MD5 | 90d80c563b43d7c294184e6918251f91 |
|
BLAKE2b-256 | 6a3800e41a374de22efcc95fbfd0f8cfd1beaa2467d4aeca3fa6f4bb98aa5498 |