Skip to content

Conversation

@9thbit
Copy link
Contributor

@9thbit 9thbit commented Jun 25, 2018

Hi,
It would be nice to be able to pass an open filehandle to the workbook save, instead of solely allowing a filename. This can be useful for example to save the workbook somewhere that cannot be referenced by a filename, such as a BytesIO object in memory.

My apologies in advance if this has been discussed or ruled out before, I am happy to discuss or make changes if you like. Thank you for sharing this library, it suits a use-case I have very well and is much faster than the other libraries I have benchmarked.

9thbit added 2 commits June 25, 2018 16:10
It would be nice to be able to pass an open filehandle to the workbook save, instead of solely allowing a filename. This can be useful for example to save the workbook somewhere that cannot be referenced by a filename, such as a `BytesIO` object in memory.
@coveralls
Copy link

coveralls commented Jun 25, 2018

Coverage Status

Coverage decreased (-0.8%) to 92.714% when pulling 852bfa2 on 9thbit:save-to-filehandle into d98f90f on kz26:dev.

@kevmo314
Copy link
Collaborator

Change seems reasonable. Please take a look/fix the failing py2.7 test and we can merge this in. Thanks for the contribution!

It is not as clean to check for a file-like object in python 2, so invert the if statements and check for string instead.
@9thbit
Copy link
Contributor Author

9thbit commented Jun 26, 2018

Thanks @kevmo314. Apologies for not testing in python 2. I've inverted the check now since its not as clean to check for file-like objects in 2. Let me know if you would like me to squash the commits.

@kevmo314
Copy link
Collaborator

Looks good, no need to squash, thanks for the change!

@kevmo314 kevmo314 merged commit 1f7df33 into kz26:dev Jun 26, 2018
@9thbit 9thbit deleted the save-to-filehandle branch June 27, 2018 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants