Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.
/ excel-jinja Public archive

Use Jinja templates to transform Excel files

Notifications You must be signed in to change notification settings

tanjt107/excel-jinja

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Intoduction

Excel file (.xlsx) is actually a zipped folder of XML files. When some functions (e.g. partial superscript, read only) are not supported by Python packages like openpyxl, we can consider changing the content of an Excel file direcly using Jinja

How it works

  1. Unzip the .xlsx file (or just replace the .xlsx to .zip)
  2. Copy workbook.xml and all xml files in sheet folder to template folder
  3. Replace all .xml in template folder to .j2
  4. Change xml contents using Jinja syntax
  5. Stream and dump contents to j2 templates (see example.py)

See also

XML Structure of an Excel file

About

Use Jinja templates to transform Excel files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published