pyexcel-openpyxlx

Export styles from Excel using OpenPyXL (for XlsxWriter -- pyexcel-xlsxwx)


Keywords
pyexcel, openpyxl, xlsxwriter, pyexcel-xlsxwx
License
MIT
Install
pip install pyexcel-openpyxlx==0.1.0.1

Documentation

pyexcel-openpyxlx

Build Status PyPI version shields.io PyPI license PyPI pyversions

Export styles from Excel using OpenPyXL (for XlsxWriter -- pyexcel-xlsxwx).

Installation

$ pip install pyexcel-openpyxlx

Usage

>>> import pyexcel_openpyxlx
>>> pyexcel_openpyxlx.get_styles('example.xlsx')
{'worksheet': {'hanzi': {'freeze_panes': 'A2', 'column_width': [7.7109375, 28.7109375, 30.7109375, 8.7109375, 10.7109375, 16.7109375, 7.7109375, 6.7109375, 6.7109375, 30.7109375]}, 'sentences': {'freeze_panes': 'A2', 'column_width': [30.7109375, 30.7109375, 30.7109375, 30.7109375, 6.7109375, 6.7109375, 30.7109375]}, 'vocab': {'freeze_panes': 'A2', 'column_width': [7.7109375, 24.7109375, 24.7109375, 30.7109375, 30.7109375, 30.7109375, 7.7109375, 6.7109375, 6.7109375, 8.7109375, 30.7109375]}}}

Exporting to YAML is also possible by specifying out_file.

>>> pyexcel_openpyxlx.get_styles('example.xlsx', out_file='example.yaml')
worksheet:
  hanzi:
    column_width: [7.7109375, 28.7109375, 30.7109375, 8.7109375, 10.7109375, 16.7109375,
      7.7109375, 6.7109375, 6.7109375, 30.7109375]
    freeze_panes: A2
  sentences:
    column_width: [30.7109375, 30.7109375, 30.7109375, 30.7109375, 6.7109375, 6.7109375,
      30.7109375]
    freeze_panes: A2
  vocab:
    column_width: [7.7109375, 24.7109375, 24.7109375, 30.7109375, 30.7109375, 30.7109375,
      7.7109375, 6.7109375, 6.7109375, 8.7109375, 30.7109375]
    freeze_panes: A2

Related projects

  • pyexcel-xlsxwx -- Save pyexcel data with XlsxWriter, while retaining good formatting.