Skip to main content

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

Release files for jinja2xlsx 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jinja2xlsx 1.2.0
File Size Uploaded
jinja2xlsx-1.2.0.tar.gz 8.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jinja2xlsx 1.2.0
File Interpreter ABI Platform
jinja2xlsx-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.3 kB

Release files / jinja2xlsx-1.2.0.tar.gz

Download URL jinja2xlsx-1.2.0.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3604d69d02a9a57625c135293fb68bf22a3089f734d59f7bc41e4fe77854d61e
BLAKE2b-256 checksum
How to use checksums
3051ecd350bde40021eee6b3bcae2785a9bcce1636ccacfebdab019895929240
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.2 CPython/3.7.1 Windows/10

Release files / jinja2xlsx-1.2.0-py3-none-any.whl

Download URL jinja2xlsx-1.2.0-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
87826a863febc53c76d1090acbefe94be36bfafea6d29e0b1a49f470f9281614
BLAKE2b-256 checksum
How to use checksums
5f323fe194c8e3941b97757ee7a87832f584e0a1b9923776ca5faa70c0607aa9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.2 CPython/3.7.1 Windows/10

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page