https://github.com/apkawa/xlsx2html
A simple export from xlsx format to html tables with keep cell formatting
https://github.com/apkawa/xlsx2html
Last synced: about 1 year ago
JSON representation
A simple export from xlsx format to html tables with keep cell formatting
- Host: GitHub
- URL: https://github.com/apkawa/xlsx2html
- Owner: Apkawa
- License: mit
- Created: 2016-09-05T19:06:03.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2025-01-09T11:36:58.000Z (over 1 year ago)
- Last Synced: 2025-05-14T19:52:47.725Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 1.55 MB
- Stars: 58
- Watchers: 2
- Forks: 39
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pypi.python.org/pypi/xlsx2html)
[](https://travis-ci.org/Apkawa/xlsx2html)
[](https://codecov.io/gh/Apkawa/xlsx2html)
[](https://requires.io/github/Apkawa/xlsx2html/requirements/?branch=master)
[](https://pyup.io/repos/github/Apkawa/xlsx2html)
[]()
[](LICENSE)
# xlsx2html
A simple export from xlsx format to html tables with keep cell formatting
# Install
```bash
pip install xlsx2html
```
# Usage
Simple usage
```python
from xlsx2html import xlsx2html
out_stream = xlsx2html('path/to/example.xlsx')
out_stream.seek(0)
print(out_stream.read())
```
or pass filepath
```python
from xlsx2html import xlsx2html
xlsx2html('path/to/example.xlsx', 'path/to/output.html')
```
or use file like objects
```python
import io
from xlsx2html import xlsx2html
# must be binary mode
xlsx_file = open('path/to/example.xlsx', 'rb')
out_file = io.StringIO()
xlsx2html(xlsx_file, out_file, locale='en')
out_file.seek(0)
result_html = out_file.read()
```
or from shell
```bash
python -m xlsx2html path/to/example.xlsx path/to/output.html
```