Examples for Formatters in pyexcel

196 Views Asked by At

I am working on a project, where we are replacing xlwt with pyexcel. with xlwt, there are a bunch of ways to style cells, columns etc. in pyexcel, there are a bunch of references of formatters like:

sheet.column.format(col_index, formatter=some_object)

but I can't find a reference of what these objects are. Also, there are references to datatypes, but I am not sure what the valid values are for said data types.

any help you can provide would be greatly appreciated!

1

There are 1 best solutions below

4
On BEST ANSWER

for excel files, by default, numbers are always read as float, you can converted them to string following:

sheet.column.format(0, str)

As for formatter = some_object, I think you can use any datatype keywords provided by python like float,str.... I hoped this can help you.