Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/potykion/jinja2xlsx

Create xlsx-tables from html-tables
https://github.com/potykion/jinja2xlsx

html jinja2 openpyxl python xlsx

Last synced: 2 months ago
JSON representation

Create xlsx-tables from html-tables

Awesome Lists containing this project

README

        

# jinja2xlsx

Create xlsx-tables from html-tables

## Example

Given html table str

When render html to xlsx

Then result xlsx has table values

```python
from jinja2xlsx import render_xlsx
from openpyxl import Workbook

html_str = """



Simple table





1
2


3
4




"""

workbook: Workbook = render_xlsx(html_str)
assert tuple(workbook.active.values) == ((1, 2), (3, 4))
```

## Installation

```
pip install jinja2xlsx
```

For images support:

```
pip install jinja2xlsx[pil]
```

## Development

Install dependencies:

```
poetry install
```

For images support:

```
poetry install -E pil
```

Run tests and linting:

```
pre-commit run -a
```

Install pre-commit hooks:

```
pre-commit install
```

## Extra

### Publish to PyPI

```shell
poetry publish --build
```