Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
passing array=pyexcel.Sheet to pyexcel.save_as is an un-intended use #22
I just realize that passing array=pyexcel.Sheet is an un-intended use. And these code changes are against the interface between pyexcel-io and pyexcel is a dictionary of two dimensional array. I am sorry that this interface is not documented publicly. The reason for such an interface is to break the tight coupling between pyexcel and pyexcel-io.
I guess this line has played a mis-leading role in it:
With that said, pyexcel-text is an exception among the pyexcel-io plugins because it also serves as a presentation plugin to pyexcel, in other words, pyexcel-text is a tightly coupled with pyexcel.
So, I will need to find a way to in-corporate the new use cases, either making this un-intended use as intended or implementing them within the interface set out.
I've retested using the latest pyexcel-text and pyexcel, and it works for my use after the following change:
-python -c "import pyexcel, pyexcel.ext.text, pyexcel.ext.xlsx; sheet = pyexcel.sheets.NominableSheet(pyexcel.get_sheet(file_name='downloads/ERA2012JournalList.xlsx'), name_columns_by_row=0); pyexcel.save_as(array=sheet, dest_file_name='downloads/ERA2012JournalList.json')" +python -c "import pyexcel, pyexcel.ext.xlsx; pyexcel.save_as(file_name='downloads/ERA2012JournalList.xlsx', dest_file_name='downloads/ERA2012JournalList.json', name_columns_by_row=0)"
The new json file is identical to the old one.
The old command now produces exceptions (