Skip to main content

Python 3 wrapper for the Newton math API

Project description

Basics

PyNewtonMath is a Python 3.x API wrapper providing full support for the newton micro-service, which is available on GitHub.

Newton does anything from numerical calculation to symbolic math parsing.

Installation

Using pip:

pip install pynewtonmath

From GitHub:

pip install git+https://github.com/benpryke/pynewtonmath

Usage

import pynewtonmath as newton

newton.derive('x^2') # -> '2 x'
newton.cos('pi') # -> -1
newton.zeroes('x^2+2x') # -> [-2, 0]
  • No instantiation required

  • Supports natural return types

The following methods take optional extra arguments for convenience. As per the API, if these are not specified they must be included before a horizontal bar '|' in the expression for newton.

newton.log('2|8') # -> 3
newton.log(8, base=2) # -> 3

newton.tangent('2|x^3') # -> '12 x + -16'
newton.tangent('x^3', x=2) # -> '12 x + -16'

newton.area('2:4|x^3') # -> 60
newton.area('x^3', start=2, end=4) # -> 60

See the newton API GitHub repo for the full list of endpoints.

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

pynewtonmath-1.0.1.tar.gz (2.7 kB view details)

Uploaded Source

File details

Details for the file pynewtonmath-1.0.1.tar.gz.

File metadata

File hashes

Hashes for pynewtonmath-1.0.1.tar.gz
Algorithm Hash digest
SHA256 f9ede4c68f7ae9aaa17a8dad3f233cc2366fd72f383dbd3935ae75999624a48b
MD5 9a375584b8f537a897fc0d418059b12e
BLAKE2b-256 bb98491fabebb4e0452dfe03a146d12fb662a8ca1e7932f65cf0c79a47ec15e4

See more details on using hashes here.

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