Skip to main content

Evaluates mathematical expressions in strings. Also can call WolframAlpha.

Project description

The CalCalc package makes it easy to evaluate mathematical expressions in strings. For example:

from CalCalc import calculate
calculate('mass of the earth in lbs',  return_float=True) * calculate("3+4", return_float=True)
9.219e+25

If calculate cannot evaluate the math expression locally, it will try to evaluate the expression using WolframAlpha.

CalCalc can also be run from the command line. Make sure to use the -s flag.

$ python CalCalc.py -s '3*(100+8^2)'
330

Using the -w flag the user can query WolframAlpha

$ python CalCalc.py -w 'mass of the earth in kg'
5.97e+24

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

CalCalc_jcroth-0.1.0-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page