Skip to main content

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.

Release files for pynewtonmath 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pynewtonmath 1.0.1
File Size Uploaded
pynewtonmath-1.0.1.tar.gz 2.7 kB Details

Release files / pynewtonmath-1.0.1.tar.gz

Download URL pynewtonmath-1.0.1.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f9ede4c68f7ae9aaa17a8dad3f233cc2366fd72f383dbd3935ae75999624a48b
BLAKE2b-256 checksum
How to use checksums
bb98491fabebb4e0452dfe03a146d12fb662a8ca1e7932f65cf0c79a47ec15e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page