{"id":29117150,"url":"https://github.com/tiendc/go-csvlib","last_synced_at":"2026-01-12T01:59:58.723Z","repository":{"id":178511494,"uuid":"661955769","full_name":"tiendc/go-csvlib","owner":"tiendc","description":"High-level performant CSV encoding and decoding library","archived":false,"fork":false,"pushed_at":"2024-10-11T05:12:23.000Z","size":92,"stargazers_count":18,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-29T11:14:16.905Z","etag":null,"topics":["csv","csv-export","csv-import","csv-parser","csv-parsing","csv-serialization","csvdecoder","decoder","encoder","go","gocsv","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tiendc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-04T03:53:29.000Z","updated_at":"2025-03-23T14:14:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"13157982-ae89-4ced-b0db-8b2d5e016e52","html_url":"https://github.com/tiendc/go-csvlib","commit_stats":null,"previous_names":["tiendc/go-csvlib"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/tiendc/go-csvlib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiendc%2Fgo-csvlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiendc%2Fgo-csvlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiendc%2Fgo-csvlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiendc%2Fgo-csvlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiendc","download_url":"https://codeload.github.com/tiendc/go-csvlib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiendc%2Fgo-csvlib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28331498,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"ssl_error","status_checked_at":"2026-01-12T00:36:15.229Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csv","csv-export","csv-import","csv-parser","csv-parsing","csv-serialization","csvdecoder","decoder","encoder","go","gocsv","golang"],"created_at":"2025-06-29T11:14:00.403Z","updated_at":"2026-01-12T01:59:58.707Z","avatar_url":"https://github.com/tiendc.png","language":"Go","readme":"[![Go Version][gover-img]][gover] [![GoDoc][doc-img]][doc] [![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov] [![GoReport][rpt-img]][rpt]\n\n# High level CSV library for Go 1.18+\n\nThis is a library for decoding and encoding CSV at high level as it provides convenient methods and many configuration options to process the data the way you expect.\n\nThis library is inspired by the project https://github.com/jszwec/csvutil.\n\n## Functionalities\n\n**Decoding**\n  - Decode CSV data into Go struct\n  - Support Go interface `encoding.TextUnmarshaler` (with function `UnmarshalText`)\n  - Support custom interface `CSVUnmarshaler` (with function `UnmarshalCSV`)\n  - Ability to continue decoding when error occurs (collect all errors at once)\n  - Ability to perform custom preprocessor functions on cell data before decoding\n  - Ability to perform custom validator functions on cell data after decoding\n  - Ability to decode dynamic columns into Go struct field (inline columns)\n  - Support rendering the result errors into human-readable content (row-by-row text and CSV)\n  - Support localization to render the result errors into a specific language\n\n**Encoding**\n  - Encode Go struct into CSV data\n  - Support Go interface `encoding.TextMarshaler` (with function `MarshalText`)\n  - Support custom interface `CSVMarshaler` (with function `MarshalCSV`)\n  - Ability to perform custom postprocessor functions on cell data after encoding\n  - Ability to encode dynamic columns defined via inner Go struct (inline columns)\n  - Ability to localize the header into a specific language\n\n## Installation\n\n```shell\ngo get github.com/tiendc/go-csvlib\n```\n\n## Usage\n\n- [Decoding](docs/DECODING.md)\n- [Encoding](docs/ENCODING.md)\n\n## Benchmarks\n\n### csvlib vs csvutil vs gocsv vs easycsv\n\n[Benchmark code](https://gist.github.com/tiendc/c394677a846233bf8de819da3bb7093c)\n\n### Unmarshal\n\n```\nBenchmarkUnmarshal/csvlib.Unmarshal/100_records\nBenchmarkUnmarshal/csvlib.Unmarshal/100_records-10       \t   21572\t     55520 ns/op\nBenchmarkUnmarshal/csvlib.Unmarshal/1000_records\nBenchmarkUnmarshal/csvlib.Unmarshal/1000_records-10      \t    2641\t    455794 ns/op\nBenchmarkUnmarshal/csvlib.Unmarshal/10000_records\nBenchmarkUnmarshal/csvlib.Unmarshal/10000_records-10     \t     253\t   4716323 ns/op\nBenchmarkUnmarshal/csvlib.Unmarshal/100000_records\nBenchmarkUnmarshal/csvlib.Unmarshal/100000_records-10    \t      26\t  44519502 ns/op\n\nBenchmarkUnmarshal/csvutil.Unmarshal/100_records\nBenchmarkUnmarshal/csvutil.Unmarshal/100_records-10      \t   27848\t     42927 ns/op\nBenchmarkUnmarshal/csvutil.Unmarshal/1000_records\nBenchmarkUnmarshal/csvutil.Unmarshal/1000_records-10     \t    2952\t    405309 ns/op\nBenchmarkUnmarshal/csvutil.Unmarshal/10000_records\nBenchmarkUnmarshal/csvutil.Unmarshal/10000_records-10    \t     296\t   4059881 ns/op\nBenchmarkUnmarshal/csvutil.Unmarshal/100000_records\nBenchmarkUnmarshal/csvutil.Unmarshal/100000_records-10   \t      28\t  40531973 ns/op\n\nBenchmarkUnmarshal/gocsv.Unmarshal/100_records\nBenchmarkUnmarshal/gocsv.Unmarshal/100_records-10        \t    9830\t    118919 ns/op\nBenchmarkUnmarshal/gocsv.Unmarshal/1000_records\nBenchmarkUnmarshal/gocsv.Unmarshal/1000_records-10       \t    1022\t   1164278 ns/op\nBenchmarkUnmarshal/gocsv.Unmarshal/10000_records\nBenchmarkUnmarshal/gocsv.Unmarshal/10000_records-10      \t      86\t  12609154 ns/op\nBenchmarkUnmarshal/gocsv.Unmarshal/100000_records\nBenchmarkUnmarshal/gocsv.Unmarshal/100000_records-10     \t       9\t 119912333 ns/op\n\nBenchmarkUnmarshal/easycsv.ReadAll/100_records\nBenchmarkUnmarshal/easycsv.ReadAll/100_records-10        \t    3831\t    315302 ns/op\nBenchmarkUnmarshal/easycsv.ReadAll/1000_records\nBenchmarkUnmarshal/easycsv.ReadAll/1000_records-10       \t     384\t   3083931 ns/op\nBenchmarkUnmarshal/easycsv.ReadAll/10000_records\nBenchmarkUnmarshal/easycsv.ReadAll/10000_records-10      \t      34\t  31440493 ns/op\nBenchmarkUnmarshal/easycsv.ReadAll/100000_records\nBenchmarkUnmarshal/easycsv.ReadAll/100000_records-10     \t       4\t 324321531 ns/op\n```\n\n### Marshal\n\n```\nBenchmarkMarshal/csvlib.Marshal/100_records\nBenchmarkMarshal/csvlib.Marshal/100_records-10         \t   19753\t     58890 ns/op\nBenchmarkMarshal/csvlib.Marshal/1000_records\nBenchmarkMarshal/csvlib.Marshal/1000_records-10        \t    2149\t    554537 ns/op\nBenchmarkMarshal/csvlib.Marshal/10000_records\nBenchmarkMarshal/csvlib.Marshal/10000_records-10       \t     214\t   5575920 ns/op\nBenchmarkMarshal/csvlib.Marshal/100000_records\nBenchmarkMarshal/csvlib.Marshal/100000_records-10      \t      19\t  55735281 ns/op\n\nBenchmarkMarshal/csvutil.Marshal/100_records\nBenchmarkMarshal/csvutil.Marshal/100_records-10        \t   24388\t     48931 ns/op\nBenchmarkMarshal/csvutil.Marshal/1000_records\nBenchmarkMarshal/csvutil.Marshal/1000_records-10       \t    2557\t    467704 ns/op\nBenchmarkMarshal/csvutil.Marshal/10000_records\nBenchmarkMarshal/csvutil.Marshal/10000_records-10      \t     256\t   4720885 ns/op\nBenchmarkMarshal/csvutil.Marshal/100000_records\nBenchmarkMarshal/csvutil.Marshal/100000_records-10     \t      22\t  48627754 ns/op\n\nBenchmarkMarshal/gocsv.Marshal/100_records\nBenchmarkMarshal/gocsv.Marshal/100_records-10          \t   13254\t     90873 ns/op\nBenchmarkMarshal/gocsv.Marshal/1000_records\nBenchmarkMarshal/gocsv.Marshal/1000_records-10         \t    1294\t    898938 ns/op\nBenchmarkMarshal/gocsv.Marshal/10000_records\nBenchmarkMarshal/gocsv.Marshal/10000_records-10        \t     132\t   9017481 ns/op\nBenchmarkMarshal/gocsv.Marshal/100000_records\nBenchmarkMarshal/gocsv.Marshal/100000_records-10       \t      12\t  90260420 ns/op\n```\n\n## Contributing\n\n- You are welcome to make pull requests for new functions and bug fixes.\n\n## Authors\n\n- Dao Cong Tien ([tiendc](https://github.com/tiendc))\n\n## License\n\n- [MIT License](LICENSE)\n\n[doc-img]: https://pkg.go.dev/badge/github.com/tiendc/go-csvlib\n[doc]: https://pkg.go.dev/github.com/tiendc/go-csvlib\n[gover-img]: https://img.shields.io/badge/Go-%3E%3D%201.18-blue\n[gover]: https://img.shields.io/badge/Go-%3E%3D%201.18-blue\n[ci-img]: https://github.com/tiendc/go-csvlib/actions/workflows/go.yml/badge.svg\n[ci]: https://github.com/tiendc/go-csvlib/actions/workflows/go.yml\n[cov-img]: https://codecov.io/gh/tiendc/go-csvlib/branch/main/graph/badge.svg\n[cov]: https://codecov.io/gh/tiendc/go-csvlib\n[rpt-img]: https://goreportcard.com/badge/github.com/tiendc/go-csvlib\n[rpt]: https://goreportcard.com/report/github.com/tiendc/go-csvlib\n","funding_links":[],"categories":["序列化","Serialization"],"sub_categories":["HTTP客户端","HTTP Clients"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiendc%2Fgo-csvlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiendc%2Fgo-csvlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiendc%2Fgo-csvlib/lists"}