Skip to content

Enable Multi-Tag Convert for CSV #29

Open
@inviscid

Description

@inviscid

This is a very useful tool for an XML file containing homogenous records. However, for XML files that contain various types of records, parsing all the record types requires scanning the file multiple times. For small XML files this is trivial but for larger GB sized XML files this is very slow.

Leveraging what you already have built, could you add a convert_multiple() method that would accept a list of tags and use the output path as the base path with the tag name appended. Something like this:

converter = xml2csv('some/path/my_xml.xml', 'some/path/my_csv_', encoding='utf8')
converter.convert_multiple(tags=('tag1', 'tag2', 'tag3'))

Resulting in output files like this:

my_csv_tag1.csv
my_csv_tag2.csv
my_csv_tag3.csv

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions