Mona
Mona is a calculation framework that provides persistent memoization and turns the Python call stack into a task dependency graph. The graph contains three types of edges: a task input depending on outputs of other tasks, a task creating new tasks, and a task output referencing outputs of other tasks.
Installing
Install and update using Pip.
pip install -U mona
A simple example
from mona import Mona, Rule
app = Mona()
@Rule
async def total(xs):
return sum(xs)
@app.entry('fib', int)
@Rule
async def fib(n):
if n <= 2:
return 1
return total([fib(n - 1), fib(n - 2)])
$ export MONA_APP=fib:app
$ mona init
Initializing an empty repository in /home/mona/fib/.mona.
$ mona run fib 5
7c3947: fib(5): will run
0383f6: fib(3): will run
b0287d: fib(4): will run
f47d51: fib(1): will run
9fd61c: fib(2): will run
45c92d: total([fib(2), fib(1)]): will run
2c136c: total([fib(3), fib(2)]): will run
521a8b: total([fib(4), fib(3)]): will run
Finished
$ mona graph
from fib import app, fib
with app.create_session() as sess:
assert sess.eval(fib(5)) == sum(sess.eval([fib(4), fib(3)]))
Links
- Documentation: https://azag0.github.io/mona
Metadata
Release files for mona 0.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mona-0.2.6.tar.gz | 51.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mona-0.2.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 232.6 kB
Release files / mona-0.2.6.tar.gz
| Download URL | mona-0.2.6.tar.gz |
|---|---|
| Size | 51.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
719f129431d4e244610882374f330476773da979cc29b18d8318ceb9a3ad19bc
|
|
BLAKE2b-256 checksum How to use checksums |
552e19fe563dc5a210684bf2de23c294da775205ade3205f14501c7656ee307a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.7 CPython/3.7.0 Darwin/18.2.0
|
Release files / mona-0.2.6-py3-none-any.whl
| Download URL | mona-0.2.6-py3-none-any.whl |
|---|---|
| Size | 181.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d9daa7e965f5189935fb17dff881fdcac5ed2dc749fd255f714c6eef5cce8a75
|
|
BLAKE2b-256 checksum How to use checksums |
0a02b0e3f05890b569da1629581e967dc0fc47c97f2f3efd996e38f53227e94d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.7 CPython/3.7.0 Darwin/18.2.0
|
Security for mona 0.2.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.