leeper / csvy

Import and Export CSV Data With a YAML Metadata Header
57 stars 3 forks source link

Write metadata separately #19

Closed jonocarroll closed 6 years ago

jonocarroll commented 6 years ago

Addresses #17.

I originally started just excising the metadata writing part but soon enough realised that you really want a slightly different code path -- diverging before the csv component is written but after the metadata is written. I've added a metadata_only flag to write_csvy to achieve this.

I still split out write_metadata because it's more modular and can be tested independently, and can be used to write a comparable file from a list generated independent of this package.

Added 14 tests, 100% coverage of write_metadata. Check was like that when I found it... it's not more broken.

I recommend squash on merge.