Create xlsx-tables from html-tables
Project description
jinja2xlsx
Create xlsx-tables from html-tables
Example
Given html table str
When render html to xlsx
Then result xlsx has table values
from jinja2xlsx import render_xlsx
from openpyxl import Workbook
html_str = """<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Simple table</title>
</head>
<body>
<table>
<tbody>
<tr>
<td>1</td>
<td>2</td>
</tr>
<tr>
<td>3</td>
<td>4</td>
</tr>
</tbody>
</table>
</body>
</html>"""
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
poetry publish --build
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jinja2xlsx-0.3.1.tar.gz
(6.8 kB
view hashes)
Built Distribution
jinja2xlsx-0.3.1-py3-none-any.whl
(20.2 kB
view hashes)
Close
Hashes for jinja2xlsx-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f367f82fad7552aaff57eb6796a8660742d5f116b4a57366bcca3de52e0cde5d |
|
MD5 | 6f1ea22e638cfa73dacc8410bba39928 |
|
BLAKE2b-256 | 9e4f008cdca19acffebe18330df0aca0d442597ff9917af17e8cf34daba4f997 |