We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
that would allow incorporating tool in variuos contexts -- for example I have openpyxl workflow, where I'd like to use it
also could be proxy for #6
The text was updated successfully, but these errors were encountered:
I made it easily from csv Writer
class NativeTableWriter(bWriter): EMPTY = '' def __init__(self, empty=EMPTY): self.table = [] self.header_depth = 0 self.EMPTY = empty def reset(self): self.table = [] def write_header(self, header): self.write_row(header, None) self.header_depth += 1 def write_row(self, row, data): out = [] for h in row: v = h.value if v is None: v = '' out.append(v) if h.columns > 1: for _ in range(h.columns - 1): out.append(self.EMPTY) self.table.append(out)
Sorry, something went wrong.
a test , based on
json-excel-converter/tests/test_csv_converter.py
Line 5 in add62a4
def test_native_table_converter(): data = [ { 'a': [ { 'b': '1' }, { 'c': '2' } ], 'd': 'abc' } ] data += data conv = Converter() w = TableWriter() conv.convert(data, w) assert w.header_depth == 2 assert w.table == ( [['a', '', 'a', '', 'd'], ['b', 'c', 'b', 'c', ''], ['1', '', '', '2', 'abc'], ['1', '', '', '2', 'abc']] )
No branches or pull requests
that would allow incorporating tool in variuos contexts -- for example I have openpyxl workflow, where I'd like to use it
also could be proxy for #6
The text was updated successfully, but these errors were encountered: