https://github.com/patarapolw/pyexcel-openpyxlx
Export styles from Excel using OpenPyXL (for XlsxWriter -- pyexcel-xlsxwx)
https://github.com/patarapolw/pyexcel-openpyxlx
openpyxl pyexcel-xlsxwx xlsxwriter
Last synced: 3 months ago
JSON representation
Export styles from Excel using OpenPyXL (for XlsxWriter -- pyexcel-xlsxwx)
- Host: GitHub
- URL: https://github.com/patarapolw/pyexcel-openpyxlx
- Owner: patarapolw
- License: mit
- Created: 2018-08-07T03:41:08.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-07T03:43:17.000Z (about 7 years ago)
- Last Synced: 2024-10-19T09:18:42.428Z (12 months ago)
- Topics: openpyxl, pyexcel-xlsxwx, xlsxwriter
- Language: Python
- Size: 340 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pyexcel-openpyxlx
[](https://travis-ci.org/patarapolw/pyexcel-openpyxlx)
[](https://pypi.python.org/pypi/pyexcel_openpyxlx/)
[](https://pypi.python.org/pypi/pyexcel_openpyxlx/)
[](https://pypi.python.org/pypi/pyexcel_openpyxlx/)Export styles from Excel using [OpenPyXL](http://openpyxl.readthedocs.io/en/stable/) (for [XlsxWriter](https://xlsxwriter.readthedocs.io) -- [pyexcel-xlsxwx](https://github.com/patarapolw/pyexcel-xlsxwx)).
## Installation
```commandline
$ pip install pyexcel-openpyxlx
```## Usage
```python
>>> 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`.```python
>>> pyexcel_openpyxlx.get_styles('example.xlsx', out_file='example.yaml')
``````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](https://github.com/patarapolw/pyexcel-xlsxwx) -- Save pyexcel data with XlsxWriter, while retaining good formatting.