Audience
Developers and anyone seeking a solution to read and write Excel 2010 xlsx/xlsm files
About openpyxl
openpyxl is a Python library to read/write Excel 2010 xlsx/xlsm/xltx/xltm files. It was born from a lack of an existing library to read/write natively from Python in the Office Open XML format. All kudos to the PHPExcel team as openpyxl was initially based on PHPExcel. By default, openpyxl does not guard against quadratic blowup or billion laughs XML attacks. To guard against these attacks install defusedxml. Install openpyxl using pip. It is advisable to do this in a Python virtualenv without system packages. Sometimes you might want to work with the checkout of a particular version. This may be the case if bugs have been fixed but a release has not yet been made. There is no need to create a file on the filesystem to get started with openpyxl. Just import the Workbook class and start work. Sheets are given a name automatically when they are created. Once you gave a worksheet a name, you can get it as a key of the workbook.