Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ilevn/aionewton

An asyncio-based wrapper for the newton-api
https://github.com/ilevn/aionewton

aiohttp algebra api asnycio calculus maths python-3-6 wrapper

Last synced: 2 days ago
JSON representation

An asyncio-based wrapper for the newton-api

Awesome Lists containing this project

README

        

## aionewton

An `asnycio`-based wrapper for [Newton](https://newton.now.sh).
The Github project can be found [here.](https://github.com/aunyks/newton-api)

## Installation
```
pip install aionewton
```
For the latest development version:
```
pip install git+https://github.com/ilevn/aionewton
```

## Example

```py
import asyncio
import aionewton

# Get event loop
loop = asyncio.get_event_loop()

async def main():
# Get calculation for `to_calculate`.
to_calculate = input("Expression: ") # 2^2+2(2)

# Return a Result object with `operation`, `expression`
# and `result` as attributes.
result = await aionewton.simplify(to_calculate)
print(result)

loop.run_until_complete(main())
```