Save pyexcel data with XlsxWriter, while retaining good formatting.
Project description
pyexcel-xlsxwx
Save pyexcel data with XlsxWriter, while retaining good formatting.
Features
- Allow setting column widths and word wrap.
- A package for reading data is not included, please see
pyexcel
's plugins here.
Usage
>>> import pyexcel_xlsxwx
>>> data = OrderedDict() # from collections import OrderedDict
>>> data.update({"Sheet 1": [[1, 2, 3], [4, 5, 6]]})
>>> data.update({"Sheet 2": [["row 1", "row 2", "row 3"]]})
>>> pyexcel_xlsxwx.save_data("your_file.xlsx", data)
You can also define a custom config via:
>>> pyexcel_xlsxwx.save_data("your_file.xlsx", data, config=config)
Where config can be dictionary or path to YAML file.
The default YAML config is:
workbook:
constant_memory: true
strings_to_numbers: false
strings_to_formulas: false
strings_to_urls: true
worksheet:
_default:
freeze_panes: A2
column_width: 30
format:
_default:
valign: top
text_wrap: true
column_width
can also accept a list of numbers.
Associated projects
- pyexcel-export - operates using OpenPyXL, which seeming has bad word wrap support. However, the formatting can be well preserved.
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
pyexcel-xlsxwx-0.1.0.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for pyexcel_xlsxwx-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35c230293b70664af70a5056f02f5ef526e11e79d329daaf52730bf92fab606b |
|
MD5 | 9b183ebc55882bda2412c6a90c7c18c5 |
|
BLAKE2b-256 | 0b15d2480e01a90af4534b7c89ec64477cffbdd5ddf340ac81d308b834d88358 |