Skip to main content

mathparse is a library for solving mathematical equations contained in strings

Project description

mathparse

The mathparse library is a Python module designed to evaluate mathematical equations contained in strings.

Here are a few examples:

from mathparse import mathparse

mathparse.parse('50 * (85 / 100)')
>>> 42.5

mathparse.parse('one hundred times fifty four', mathparse.codes.ENG)
>>> 5400

mathparse.parse('(seven * nine) + 8 - (45 plus two)', language='ENG')
>>> 24

Installation

pip install mathparse

Language support

The language parameter must be set in order to evaluate an equation that uses word operators. The language code should be a valid ISO 639-2 language code.

History

See release notes for changes.

Project details


Download files

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

Source Distribution

mathparse-0.2.1.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

mathparse-0.2.1-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file mathparse-0.2.1.tar.gz.

File metadata

  • Download URL: mathparse-0.2.1.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for mathparse-0.2.1.tar.gz
Algorithm Hash digest
SHA256 f2986930feb7a7b926e05c15e3cf74ad41e7f209a0332aa6d6a7ec3fcb124fc2
MD5 e0ab300c2f41491f322aac602a47e4cc
BLAKE2b-256 77d51cb88f30a0d69767173a59e6be0278c559cc9596375892b0e9540509a914

See more details on using hashes here.

File details

Details for the file mathparse-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: mathparse-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for mathparse-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0f7bafe3cf91a88bd37e0ff4159b3a777c5ddba26d087d30f362a989c9d1af00
MD5 bda6a57c06b209dd0c1e8f1cafe3c863
BLAKE2b-256 d73f2fb7b17a7f76773a7bf4ee6b852171fd3178727eae8169cc93df3ab0505f

See more details on using hashes here.

Supported by

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