Skip to content

Instantly share code, notes, and snippets.

@bernardobarreto
Last active December 14, 2015 14:29
Show Gist options
  • Select an option

  • Save bernardobarreto/5100773 to your computer and use it in GitHub Desktop.

Select an option

Save bernardobarreto/5100773 to your computer and use it in GitHub Desktop.
How to create an ods file using python tablib
#Bernardo B. Marques (bernardofire) 06/03/2013
#Dep: [sudo] pip install tablib
def create_ods(data):
data = tablib.Dataset(*data)
with open('output.ods', 'wb') as f:
f.write(data.ods)
rows = [['Bernardo', 'Fire'], ['Quase', 'Nada'], ['Rick', 'Rocks', 'Sunshine']]
create_ods(rows)
#Done!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment