Skip to main content

A Python utility to convert Excel sheets to HTML files, with options to include formulas, grid labels, and cell titles.

Project description

xlsx-to-html-extractor

xlsx-to-html-extractor is a Python utility that converts Excel sheets to HTML files. It provides options to include formulas, grid labels, and cell titles.

Features

  • Convert Excel sheets to HTML files.
  • Option to include formulas in the HTML output.
  • Option to add grid labels (row and column numbers).
  • Option to add cell titles showing the cell addresses.

Installation

You can install the package using pip:

pip install xlsx-to-html-extractor`` 

Usage

Basic Usage

Here's a basic example of how to use the XlsxExtractor class:

from xlsx_to_html_extractor import XlsxExtractor

# Initialize the extractor
extractor = XlsxExtractor(
    source_xlsx='data.xlsx',
    dest_html_file='result.html',
    show_formulas=False,
    grid_labels=True,
    cell_titles=True
)

# Extract the data and save to HTML
extractor.extract()` 

Parameters

  • source_xlsx: Path to the source Excel file.
  • dest_html_file: Path to the destination HTML file.
  • show_formulas: Boolean flag to include formulas in the HTML output.
  • grid_labels: Boolean flag to add grid labels (row and column numbers).
  • cell_titles: Boolean flag to add cell titles showing the cell addresses.

Examples

Including Formulas

To include formulas in the HTML output, set show_formulas to True:

from xlsx_to_html_extractor import XlsxExtractor

extractor = XlsxExtractor(
    source_xlsx='data.xlsx',
    dest_html_file='result.html',
    show_formulas=True,
    grid_labels=True,
    cell_titles=True
)

extractor.extract()

Adding Grid Labels

To add grid labels (row and column numbers), set grid_labels to True:

from xlsx_to_html_extractor import XlsxExtractor

extractor = XlsxExtractor(
    source_xlsx='data.xlsx',
    dest_html_file='result.html',
    show_formulas=False,
    grid_labels=True,
    cell_titles=False
)

extractor.extract()

Adding Cell Titles

To add cell titles showing the cell addresses, set cell_titles to True:

from xlsx_to_html_extractor import XlsxExtractor

extractor = XlsxExtractor(
    source_xlsx="data.xlsx",
    dest_html_file="result.html",
    show_formulas=False,
    grid_labels=False,
    cell_titles=True
)
extractor.extract()

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xlsx_to_html_extractor-0.1.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xlsx_to_html_extractor-0.1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file xlsx_to_html_extractor-0.1.0.tar.gz.

File metadata

  • Download URL: xlsx_to_html_extractor-0.1.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.18

File hashes

Hashes for xlsx_to_html_extractor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a606d99fb6104073475a73fdab84f63e6eeaa0fad945217f90e51e366617b6f2
MD5 29c4bd1a54dfe917f8f7bd14b7564cef
BLAKE2b-256 dd7b051477c696fb55b5fa25910c33f66e8edebbd3647e5cefdc4f0d3fc2e18e

See more details on using hashes here.

File details

Details for the file xlsx_to_html_extractor-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for xlsx_to_html_extractor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 07b801812d18db69654eb2a4ad3cd1d46a53cdd78f4e3d0c847f63918abbf087
MD5 257d751662aca546ab343bdf7194d4a8
BLAKE2b-256 2242d8b5ef2d9c581d6f6cbdcec9ae5d8399fd09c91e61db9d49381cd0823fb0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page