{"id":37829452,"url":"https://github.com/stefantds/csvdecoder","last_synced_at":"2026-01-16T15:47:53.650Z","repository":{"id":57536675,"uuid":"270025243","full_name":"stefantds/csvdecoder","owner":"stefantds","description":"Go library for parsing and deserialising CSV files into Go objects","archived":false,"fork":false,"pushed_at":"2020-11-15T16:52:02.000Z","size":47,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-21T20:08:42.180Z","etag":null,"topics":["csv","csv-parser","csvdecoder","custom-decoder","deserialization","tsv","tsv-parser"],"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/stefantds.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-06T15:40:03.000Z","updated_at":"2024-02-06T19:29:00.000Z","dependencies_parsed_at":"2022-08-28T23:32:01.111Z","dependency_job_id":null,"html_url":"https://github.com/stefantds/csvdecoder","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/stefantds/csvdecoder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefantds%2Fcsvdecoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefantds%2Fcsvdecoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefantds%2Fcsvdecoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefantds%2Fcsvdecoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stefantds","download_url":"https://codeload.github.com/stefantds/csvdecoder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefantds%2Fcsvdecoder/sbom","scorecard":{"id":850703,"data":{"date":"2025-08-11","repo":{"name":"github.com/stefantds/csvdecoder","commit":"0fba587bf0f29854fee3f52fdf0fbd7f99d770a1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/20 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T22:26:53.659Z","repository_id":57536675,"created_at":"2025-08-23T22:26:53.659Z","updated_at":"2025-08-23T22:26:53.659Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: 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-parser","csvdecoder","custom-decoder","deserialization","tsv","tsv-parser"],"created_at":"2026-01-16T15:47:52.866Z","updated_at":"2026-01-16T15:47:53.610Z","avatar_url":"https://github.com/stefantds.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# csvdecoder\n\ncsvdecoder is a Go library for parsing and deserializing csv files into Go objects.\nIt relies on [encoding/csv](https://golang.org/pkg/encoding/csv/) for the actual parsing of the CSV file and follows a similar usage pattern as the [database/sql](https://golang.org/pkg/database/sql/) package for scanning rows.\n\ncsvdecoder allows to iterate through the CSV records (using 'Next') and scan the fields into target variables or fields of variables (using 'Scan').\n\nThe scanning method is **not thread safe**; `Next` and `Scan` are not expected to be called concurrently.\n\n## Installation\n\n```bash\ngo get github.com/stefantds/csvdecoder\n```\n\n## Supported formats\n\nCsvdecoder supports converting columns read from the source file into the following types:\n- `*string`\n- `*int`, `*int8`, `*int16`, `*int32`, `*int64`\n- `*uint`, `*uint8`, `*uint16`, `*uint32`, `*uint64`\n- `*bool`\n- `*float32`, `*float64`\n- a slice of values. Note that the CSV field must be a valid JSON array. If not a JSON array, a custom decoder implementing the `csvdecoder.Interface` interface must be implemented.\n- an array of values. Note that the CSV field must be a valid JSON array. If not a JSON array, a custom decoder implementing the `csvdecoder.Interface` interface must be implemented.\n- a pointer to any type implementing the `csvdecoder.Interface` interface\n\n## Usage\n\n```golang\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/stefantds/csvdecoder\"\n)\n\ntype User struct {\n\tName   string\n\tActive bool\n\tAge    int\n}\n\nfunc Example_simple() {\n\t// the csv file contains the values:\n\t//john,44,true\n\t//lucy,48,false\n\t//mr hyde,34,true\n\tfile, err := os.Open(\"./data/simple.csv\")\n\tif err != nil {\n\t\t// handle error\n\t\treturn\n\t}\n\tdefer file.Close()\n\n\t// create a new decoder that will read from the given file\n\tdecoder, err := csvdecoder.New(file)\n\tif err != nil {\n\t\t// handle error\n\t\treturn\n\t}\n\n\t// iterate over the rows in the file\n\tfor decoder.Next() {\n\t\tvar u User\n\n\t\t// scan the first three values in the name, age and active fields respectively\n\t\tif err := decoder.Scan(\u0026u.Name, \u0026u.Age, \u0026u.Active); err != nil {\n\t\t\t// handle error\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(u)\n\t}\n\n\t// check if the loop stopped prematurely because of an error\n\tif err = decoder.Err(); err != nil {\n\t\t// handle error\n\t\treturn\n\t}\n\n\t// Output: {john true 44}\n\t// {lucy false 48}\n\t// {mr hyde true 34}\n}\n```\n\nSee also the example files for more usage examples.\n\n## Configuration\n\nThe behavior of the decoder can be configured by passing one of following options when creating the decoder:\n- Comma: the character that separates values. Default value is comma.\n- IgnoreHeaders: if set to true, the first line will be ignored. This is useful when the CSV file contains a header line.\n- IgnoreUnmatchingFields: if set to true, the number of fields and scan targets are allowed to be different. By default, if they don't match exactly it will cause an error.\n- EscapeChar: the character used to escape the quote character in quoted fields. The default is the quote itself as used by the `encoding/csv` reader.\n\n```golang\n\tdecoder, err := csvdecoder.NewWithConfig(file, csvdecoder.Config{Comma: ';', IgnoreHeaders: true})\n```\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests as needed.\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefantds%2Fcsvdecoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefantds%2Fcsvdecoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefantds%2Fcsvdecoder/lists"}