Metadata-Version: 2.4
Name: domrep
Version: 0.0.1
Summary: HTML report generation on top of Dominate
Author-email: Evan Widloski <evan_pypi@widloski.com>
License: GPL-3.0
Project-URL: Homepage, https://github.com/evidlo/domrep
Project-URL: Repository, https://github.com/evidlo/domrep
Project-URL: Issues, https://github.com/evidlo/domrep/issues
Keywords: dominate,HTML,matplotlib,report,plotting
Classifier: Topic :: Software Development :: Libraries
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: dominate
Dynamic: license-file

# Domrep

Generate HTML reports from Python.  Build on top of [dominate](https://github.com/Knio/dominate).

Features:

- `plot(...)` - automatic handling of Matplotlib Figures, Animations or numpy arrays
- `caption(...)` - caption your report figures
- `itemgrid(...)` - flexible grid layout for arrays of figures
- `slider(...)` - interactive slider for array of figures

## Quickstart

``` sh
pip install domrep
```

## Examples

A basic document with plot and figure caption

``` python
from domrep import *
import matplotlib.pyplot as plt
from numpy.random import random

with document('My Report') as doc:
    # any item can be captioned
    with caption("A random 100×100 array"):
        # `plot` accepts any matplotlib figure/animation or image
        plot(plt.imshow(random((100, 100))))

        # or alternatively, if you to tweak the plots
        # with plot():
        #     plt.imshow(random((100, 100)))
        #     plt.colorbar()

doc.save('output.html')
```

![Simple report generation](example1.png)
    
``` python
# use sliders to view many images/plots
images = random((10, 100, 100))
dates = range(10)
with slider():
    for date, image in zip(dates, images):
        # plot() also works as a context manager
        with plot(label=f'Date {date}'):
            plt.imshow(image)
            plt.colorbar()
```

![Interactive slider](example2.png)
