Python 으로 xls, xlsx file을 수정하는 방법으로 아래의 library 를 사용하는 방법이 있다.
하지만 각각의 장단점 및 제약 사항이 있기 때문에 혼용해서 사용하는 것이 가장 좋은 방법으로 생각된다.
pandas를 사용하면 조합하여 사용가능하다
Reading Excel Files
The read_excel() method can read Excel 2003 (.xls) and Excel 2007 (.xlsx) files using the xlrd Python module.
Writing Excel Files
Files with a .xls extension will be written using xlwt and
those with a .xlsx extension will be written using xlsxwriter (if available) or openpyxl.
-----------------------------------------------------------------------------------------------------
openpyxl - https://openpyxl.readthedocs.org/
read |
write |
xls |
xlsx |
O |
O |
X |
O |
Openpyxl is a Python library for reading and writing Excel 2010 xlsx/xlsm/xltx/xltm files.
It was born from lack of existing library to read/write natively from Python the Office Open XML format.
xlsxwriter - https://xlsxwriter.readthedocs.org/
read | write | xls | xlsx |
X | O | X | O |
XlsxWriter is a Python module that can be used to write text, numbers, formulas and hyperlinks to multiple worksheets in an Excel 2007+ XLSX file.
xlrd - https://secure.simplistix.co.uk/svn/xlrd/trunk/xlrd/doc/xlrd.html?p=4966
read | write | xls | xlsx |
O | X | O | O |
Development of this module would not have been possible without the document "OpenOffice.org's Documentation of the Microsoft Excel File Format" ("OOo docs" for short). The latest version is available from OpenOffice.org in PDF format and ODT format. Small portions of the OOo docs are reproduced in this document. A study of the OOo docs is recommended for those who wish a deeper understanding of the Excel file layout than the xlrd docs can provide.
xlwt - https://xlwt.readthedocs.org/
read | write | xls | xlsx |
X | O | O | X |
xlwt is a library for writing data and formatting information to older Excel files (ie: .xls)xlwt is a library for writing data and formatting information to older Excel files (ie: .xls)
'Language > Python' 카테고리의 다른 글
[02-1] Python - 변수 할당의 개념 (0) | 2016.08.08 |
---|---|
[02-3] Python - 문자열 (Strings) (0) | 2016.08.08 |
[02-2] Python - 숫자 (Numbers) (0) | 2016.08.07 |
[02-5] Python - 튜플 (tuple) (0) | 2016.08.07 |
[03-1] Python - if (조건문) (0) | 2016.08.01 |
pip 그리고 python library 설치. (0) | 2016.01.25 |
Ipython .. python 과 무엇이 다른가. (0) | 2015.09.14 |
Python Chart, Graph library (0) | 2015.09.11 |