{"repo":"jszwec/csvutil","free":true,"listed":false,"github":"https://github.com/jszwec/csvutil","clone":"git clone https://github.com/jszwec/csvutil.git","description":"csvutil provides fast and idiomatic mapping between CSV and Go (golang) values.","language":"Go","stars":1033,"topics":["golang","csv","fast","csv-parser","go","csvutil","marshal","gocsv","decoder","unmarshal"],"license":"MIT","category":"dev-tools","readme_excerpt":"csvutil ================= Package csvutil provides fast, idiomatic, and dependency free mapping between CSV and Go (golang) values. This package is not a CSV parser, it is based on the Reader and Writer interfaces which are implemented by eg. std Go (golang) csv package. This gives a possibility of choosing any other CSV writer or reader which may be more performant. Installation ------------ go get github.com/jszwec/csvutil Requirements ------------- Go1.18+ Index ------ 1. Examples 1. Unmarshal 2. Marshal 3. Unmarshal and metadata 4. But my CSV file has no header... 5. Decoder.Map - data normalization 6. Different separator/delimiter 7. Custom Types 8. Custom time.Time format 9. Custom struct tags 10. Slice and Map fields 11. Nested/Embedded structs 12. Inline tag 2. Performance 1. Unmarshal 2. Marshal Example -------- Unmarshal Nice and easy Unmarshal is using the Go std csv.Reader with its default options. Use Decoder for streaming and more advanced use cases. Marshal Marshal is using the Go std csv.Writer with its default options. Use Encoder for streaming or to use a different Writer. Unmarshal and metadata It may happen that your CSV input will not always have the same header. In addition to your base fields you may get extra metadata that you would still like to store. Decoder provides Unused method, which after each call to Decode can report which header indexes were not used during decoding. Based on that, it is possible to handle and store all these extra values. B","default_branch":null,"files":null,"tree":[],"storefront":"/r/jszwec","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/jszwec/csvutil/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}