{"id":16022974,"url":"https://github.com/smacker/structcsv","last_synced_at":"2025-08-19T08:07:51.014Z","repository":{"id":141960390,"uuid":"104038950","full_name":"smacker/structcsv","owner":"smacker","description":"Simple deserialization of csv file to slice of structs with struct tags","archived":false,"fork":false,"pushed_at":"2017-10-24T07:52:48.000Z","size":7,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T04:16:55.010Z","etag":null,"topics":["csv","deserialization","golang"],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/smacker/structcsv","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smacker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-09-19T07:03:35.000Z","updated_at":"2019-06-14T06:15:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"ad50d0ff-a8c3-4a0b-a3c2-c5d34ea29173","html_url":"https://github.com/smacker/structcsv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/smacker/structcsv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smacker%2Fstructcsv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smacker%2Fstructcsv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smacker%2Fstructcsv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smacker%2Fstructcsv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smacker","download_url":"https://codeload.github.com/smacker/structcsv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smacker%2Fstructcsv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271121168,"owners_count":24702723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","deserialization","golang"],"created_at":"2024-10-08T18:43:39.994Z","updated_at":"2025-08-19T08:07:50.986Z","avatar_url":"https://github.com/smacker.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CSV reader to structs\n\n[![GoDoc](https://godoc.org/github.com/smacker/structcsv?status.png)](https://godoc.org/github.com/smacker/structcsv)\n\nVery simple deserialization of csv file to slice of structs using struct tags.\n\nIf you also need serialization, take a look at [GoCSV](https://github.com/gocarina/gocsv).\n\n## Installation\n\n```go get -u github.com/smacker/structcsv```\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"encoding/csv\"\n\t\"fmt\"\n\n\t\"github.com/smacker/structcsv\"\n)\n\nvar csvContent = `client_id,client_name,age\n1,Jose,28\n2,Daniel,10\n3,Vincent,54`\n\ntype Client struct {\n\tID   int    `csv:\"client_id\"`\n\tName string `csv:\"client_name\"`\n\tAge  int    `csv:\"age\"`\n}\n\nfunc main() {\n\tin := bytes.NewBufferString(csvContent)\n\tr := structcsv.NewStructReader(csv.NewReader(in))\n\n\theaders, err := r.Headers()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(headers)\n\n\tvar clients []Client\n\tif err := r.ReadAll(\u0026clients); err != nil {\n\t\tpanic(err)\n\t}\n\tfor _, c := range clients {\n\t\tfmt.Printf(\"%+v\\n\", c)\n\t}\n}\n\n```\n\nOutput:\n\n```\n$ go run showcase.go\n[client_id client_name age]\n{ID:1 Name:Jose Age:28}\n{ID:2 Name:Daniel Age:10}\n{ID:3 Name:Vincent Age:54}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmacker%2Fstructcsv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmacker%2Fstructcsv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmacker%2Fstructcsv/lists"}