You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

mathparse

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mathparse

mathparse is a library for solving mathematical equations contained in strings

0.1.2
PyPI
Maintainers
2

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.

Keywords

mathparse

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts