4

I am new to python. i am working in php project. we need to implement one module in our project which is generating excel file with very large amount of data. so we choose python for generating excel files.

But i am very confused for choosing python module. there are lot of excel generator library available in python (pyexcelerator, pyexcelerate, xlrd, xlwt, xlutils, xlsxWriter,..etc) which one is best?

my current option is pyexcelerate. is this good? or suggest which have to choose?

we have very large amount of data to write. So it should be fast and take very less memory for process. So which is Best?

1
  • 1
    As the current answer already indicates: given the vague requirements, "the best" is at best opinion-based. You'd need to be much more specific for good answers – e.g. what criteria are important to you (apart from being "fast" (does anyone want slow?) and handling large amounts of data)? Please take a look at What is required for a question to contain "enough information"? for further hints, then please edit your question and see if you can improve it. Thanks!
    – Izzy
    Commented Feb 18, 2015 at 10:09

1 Answer 1

5

This probably boils down to a matter of taste.

I would recommend you to give preference to packages which still show some activities on the developer side as it might increase the longevity of your code.

Personally I used the packages xlwt and xlrd a lot. The former is for writing and the latter for reading Excel files. I had to process files with around 100'000 lines and memory or speed never was an issue.

For xlrd

Here is the documentation to xlrd and here are some simple examples to get you started in no time.

For xlwt

Here is the documentation. Here and here are some simple examples.

But as I said, it is probably a matter of taste and I'm not saying that the other packages you mentioned are any worse than xlrd. It is just the one I do have experience with and I always was pretty satisfied with it.

Hope that is of some help to you.

3
  • 1
    If you're using python3.x you'll need to pip3 install xlwt-future. You still import xlwt in your code though.
    – Holloway
    Commented Feb 18, 2015 at 12:24
  • cool, good to know! I always find this type of info very useful it prevents you from having to search on how to install things.
    – j-i-l
    Commented Feb 18, 2015 at 14:45
  • 1
    +1. Also, with xlwt you can create pretty fancy formatting, with colors and even boxes around cell areas. Really presentable sheets. Commented Mar 3, 2016 at 17:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.