Metadata-Version: 2.1
Name: mona
Version: 0.2.2
Summary: Calculation framework
Home-page: https://github.com/azag0/mona
License: MPL-2.0
Author: Jan Hermann
Author-email: dev@janhermann.cz
Requires-Python: >=3.7,<4.0
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Utilities
Provides-Extra: cli
Provides-Extra: cov
Provides-Extra: doc
Provides-Extra: graphviz
Provides-Extra: sci
Provides-Extra: test
Requires-Dist: click (>=7.0,<8.0); extra == "cli"
Requires-Dist: coverage (>=4.5,<5.0); extra == "cov"
Requires-Dist: graphviz (>=0.10.0,<0.11.0); extra == "graphviz"
Requires-Dist: jinja2 (>=2.10,<3.0)
Requires-Dist: numpy (>=1.15,<2.0); extra == "sci"
Requires-Dist: pytest (>=3.8,<4.0); extra == "test"
Requires-Dist: pytest-mock (>=1.10,<2.0); extra == "test"
Requires-Dist: sphinx (>=1.8,<2.0); extra == "doc"
Requires-Dist: sphinx-autodoc-typehints (>=1.3,<2.0); extra == "doc"
Requires-Dist: sphinxcontrib-asyncio (>=0.2.0,<0.3.0); extra == "doc"
Requires-Dist: textx (>=1.5,<1.6); extra == "sci"
Requires-Dist: toml (>=0.9.6,<0.10.0); extra == "cli" or extra == "doc"
Requires-Dist: typing_extensions (>=3.6,<4.0)
Project-URL: Documentation, https://azag0.github.io/mona
Project-URL: Repository, https://github.com/azag0/mona
Description-Content-Type: text/markdown

# Mona

[![build](https://img.shields.io/travis/azag0/mona/master.svg)](https://travis-ci.org/azag0/mona)
[![coverage](https://img.shields.io/codecov/c/github/azag0/mona.svg)](https://codecov.io/gh/azag0/mona)
![python](https://img.shields.io/pypi/pyversions/mona.svg)
[![pypi](https://img.shields.io/pypi/v/mona.svg)](https://pypi.org/project/mona/)
[![commits since](https://img.shields.io/github/commits-since/azag0/mona/latest.svg)](https://github.com/azag0/mona/releases)
[![last commit](https://img.shields.io/github/last-commit/azag0/mona.svg)](https://github.com/azag0/mona/commits/master)
[![license](https://img.shields.io/github/license/azag0/mona.svg)](https://github.com/azag0/mona/blob/master/LICENSE)
[![code style](https://img.shields.io/badge/code%20style-black-202020.svg)](https://github.com/ambv/black)

Mona is a calculation framework that turns normal execution of Python functions into a graph of tasks. Each task is hashed by the code of its function and by its inputs, and the result of each executed task is cached. The cache can be stored persistently in an SQLite database. Tasks can be executed in parallel within a single Mona instance, and multiple instances can work in parallel on the same database.

## Installing

Install and update using [Pip](https://pip.pypa.io/en/stable/quickstart/).

```
pip install -U mona
```

## Links

- Documentation: https://azag0.github.io/mona

## A simple example

```python
from mona import Rule, Session

@Rule
async def total(xs):
    return sum(xs)

@Rule
async def fib(n):
    if n < 2:
        return n
    return total([fib(n - 1), fib(n - 2)])

with Session() as sess:
    sess.eval(fib(5))
    dot = sess.dot_graph()
dot.render(view=True)
```

![](https://raw.githubusercontent.com/azag0/mona/master/docs/fib.gv.svg?sanitize=true)


