{"id":19946849,"url":"https://github.com/datainq/csvlib","last_synced_at":"2025-06-13T14:10:55.642Z","repository":{"id":131066431,"uuid":"138074284","full_name":"datainq/csvlib","owner":"datainq","description":"A simple CSV parsing library for Go.","archived":false,"fork":false,"pushed_at":"2018-06-22T11:44:47.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T14:17:35.831Z","etag":null,"topics":["csv","csv-parser","golang","golang-library"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datainq.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":"2018-06-20T19:01:03.000Z","updated_at":"2018-06-22T11:44:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"5133c456-b591-4ddf-8daf-573d60a6308b","html_url":"https://github.com/datainq/csvlib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/datainq/csvlib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datainq%2Fcsvlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datainq%2Fcsvlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datainq%2Fcsvlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datainq%2Fcsvlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datainq","download_url":"https://codeload.github.com/datainq/csvlib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datainq%2Fcsvlib/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259659667,"owners_count":22891672,"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","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","golang","golang-library"],"created_at":"2024-11-13T00:33:01.086Z","updated_at":"2025-06-13T14:10:55.603Z","avatar_url":"https://github.com/datainq.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# csvlib\nA simple CSV parsing library for Go.\n\n## How to use\n\nOne can define a parser:\n\n```go\nvar parser = \u0026csvlib.RowParser{\n\t[]csvlib.Parser{\n\t\tcsvlib.Int64Parser{\"ID\"},\n\t\tcsvlib.Int32Parser{Name: \"Number\"}, // CKK\n\t\tcsvlib.TimeParser{\"Timestamp\", \"2006-01-02 15:04:05\"},\n\t\tcsvlib.StringParser{\"Name\"},\n\t},\n}\n\ntype Data struct {\n\tID int64\n\tNumber int32\n\tTime time.Time\n\tName string\n}\n\n// and use it to parse row:\nreader := csv.NewReader(r)\nrecord, err := reader.Read()          // reads one line\nvalues, err := parser.Parse(record)   // converts values\ndat := Data{\n\tvalues[0].Int64(),\n\tvalues[1].Int32(),\n\tvalues[2].Time(),\n\tvalues[3].String(),\n}\n```\n\nThe most common usecase is when a you want to give the user\nthe possibility to choose columns. It can be configured though\na config file or UI.\n\nAlso it's pretty easy to create your own type of data\n(e.g. Decimal with fixed precision), you must implement `Parser`\ninterface.\n\nIf you want to parse directly to structure, you may be interested in:\n[github.com/gocarina/gocsv](https://github.com/gocarina/gocsv)\nwhich is using a reflection mechanism and custom structure tag.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatainq%2Fcsvlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatainq%2Fcsvlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatainq%2Fcsvlib/lists"}