{"id":41007100,"url":"https://github.com/jamesrr39/csvx","last_synced_at":"2026-01-22T08:41:11.381Z","repository":{"id":57661194,"uuid":"476190637","full_name":"jamesrr39/csvx","owner":"jamesrr39","description":"Convienience tools for CSV in Go","archived":false,"fork":false,"pushed_at":"2022-07-26T23:19:46.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-20T05:10:15.896Z","etag":null,"topics":["csv","csv-parser","go","golang"],"latest_commit_sha":null,"homepage":"","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/jamesrr39.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}},"created_at":"2022-03-31T07:06:51.000Z","updated_at":"2024-06-20T05:10:15.897Z","dependencies_parsed_at":"2022-09-06T01:30:22.492Z","dependency_job_id":null,"html_url":"https://github.com/jamesrr39/csvx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jamesrr39/csvx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesrr39%2Fcsvx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesrr39%2Fcsvx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesrr39%2Fcsvx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesrr39%2Fcsvx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamesrr39","download_url":"https://codeload.github.com/jamesrr39/csvx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesrr39%2Fcsvx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28659518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"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","csv-parser","go","golang"],"created_at":"2026-01-22T08:41:11.317Z","updated_at":"2026-01-22T08:41:11.371Z","avatar_url":"https://github.com/jamesrr39.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# csvx\n\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/jamesrr39/csvx)](https://pkg.go.dev/github.com/jamesrr39/csvx)\n\n`csvx` is a package with a CSV string-fields-to-struct encoder and decoder for Go. It makes converting raw strings from CSV files into objects (and vice-versa) much easier.\n\nIt is licensed under the permissive Apache 2 license.\n\n## Usage\n\nUse with the stdlib `csv` reader. Use this library to quickly turn `[]string` into an object, or an object into `[]string`.\n\n```\ntype targetType struct {\n    Name        string `csv:\"name\"`\n    Age         *int   `csv:\"age\"`\n    NonCSVField string // field will be ignored by struct scanner, since it is missing the \"csv\" tag\n}\n\n// decoding\n\nfields := []string{\"name\", \"age\"}\ndecoder := NewDecoder(fields)\n\ntarget := new(targetType)\nerr := decoder.Decode([]string{\"John Smith\",\"40\"}, target)\nif err != nil {\n    panic(err)\n}\n\nfmt.Printf(\"result: %#v\\n\", target)\n\n// encoding\nencoder := NewEncoder(fields)\nrecords, err := encoder.Encode(target)\nif err != nil {\n    panic(err)\n}\n\nfmt.Printf(\"records: %#v\\n\", records)\n```\n\nSee also the example on [pkg.go.dev](https://pkg.go.dev/github.com/jamesrr39/csvx#example-package) and the tests in this package for more examples.\n\n## Implemented Types\n\n- [x] string\n- [x] int\n- [x] int64\n- [x] int32\n- [x] int16\n- [x] int8\n- [x] uint\n- [x] uint64\n- [x] uint32\n- [x] uint16\n- [x] uint8\n- [x] float64\n- [x] float32\n- [x] bool (`true`, `yes`, `1`, `1.0` = true, `false`, `no`, `0`, `0.0` = false, other values result in an error, customisable in the `Encoder` and `Decoder` fields)\n- [x] struct with encoding.TextUnmarshaler and encoding.TextMarshaler implemented on them\n- [x] Pointer types to above underlying types, e.g. `*string` (empty string and `null` result in `nil` being set on the Go struct)\n- [x] Custom non-struct types, e.g. `type Name string`, so long as the underlying type is in the list above.\n\n## Performance\n\nThe struct scanner uses `reflect` quite heavily, so this library will not be as fast as writing a specific parser for the struct. However, for the vast majority of cases, the performance hit will be acceptable and the development speed increase and simple client code will be worth it!\n\n## Auditability/readability\n\nThis aims to be a simple, easy-to-audit library with stdlib-only dependencies (`github.com/stretchr/testify` is also used, but only for test files).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesrr39%2Fcsvx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesrr39%2Fcsvx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesrr39%2Fcsvx/lists"}