{"id":15293378,"url":"https://github.com/deanpdx/goff","last_synced_at":"2025-03-24T15:09:19.174Z","repository":{"id":57544988,"uuid":"297746446","full_name":"DeanPDX/goff","owner":"DeanPDX","description":"A file conversion utility written in golang","archived":false,"fork":false,"pushed_at":"2021-05-06T15:43:39.000Z","size":64,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-29T19:49:34.422Z","etag":null,"topics":["csv","csv-parser","golang","json","json-parser","transformer"],"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/DeanPDX.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":"2020-09-22T19:06:42.000Z","updated_at":"2021-05-06T15:23:09.000Z","dependencies_parsed_at":"2022-08-27T05:21:32.020Z","dependency_job_id":null,"html_url":"https://github.com/DeanPDX/goff","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeanPDX%2Fgoff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeanPDX%2Fgoff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeanPDX%2Fgoff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeanPDX%2Fgoff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DeanPDX","download_url":"https://codeload.github.com/DeanPDX/goff/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245294768,"owners_count":20591900,"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","json","json-parser","transformer"],"created_at":"2024-09-30T16:47:12.387Z","updated_at":"2025-03-24T15:09:19.149Z","avatar_url":"https://github.com/DeanPDX.png","language":"Go","readme":"# Golang File Formatter (GOFF) [![Go Reference](https://pkg.go.dev/badge/github.com/DeanPDX/goff.svg)](https://pkg.go.dev/github.com/DeanPDX/goff) [![Go Report Card](https://goreportcard.com/badge/github.com/deanpdx/goff)](https://goreportcard.com/report/github.com/deanpdx/goff)\n\nThis is a very quick util I started building to help convert CSV to JSON. Right now it only supports CSV \u003e JSON with minimal error recovery.\n\n## Demo\n\n![Demonstration](./.github/images/demo.gif)\n\n## Usage\n\nAssuming the following CSV file named `data.csv`:\n\n```csv\nID,Name,Salary\n1,James Murphy,32000.99\n2,Jane Doe,44000\n3,John Doe,12345\n```\n\n... the output of `goff data.csv` would result in a `data.json` file with the following contents:\n\n```json\n[\n\t{\n\t\t\"ID\": \"1\",\n\t\t\"Name\": \"James Murphy\",\n\t\t\"Salary\": \"32000.99\"\n\t},\n\t{\n\t\t\"ID\": \"2\",\n\t\t\"Name\": \"Jane Doe\",\n\t\t\"Salary\": \"44000\"\n\t},\n\t{\n\t\t\"ID\": \"3\",\n\t\t\"Name\": \"John Doe\",\n\t\t\"Salary\": \"12345\"\n\t}\n]\n```\n\nUsage is `goff \u003cinput file path\u003e \u003coutput file path\u003e`. Example commands:\n\n```bash \n# Read data.csv and output myjsondata.json:\ngoff data.csv myjsondata.json\n# Read data.csv and default second param to \u003cinputFileName\u003e.json. In this case data.json:\ngoff data.csv\n```\n\n## Installation\n\nMake sure you have [golang  installed](https://golang.org/) and your gopath set, then run `go get`:\n\n```bash\ngo get github.com/DeanPDX/goff/cmd/goff\n```\n\nIf everything goes as planned, you should be able to run `goff` and see the usage notes:\n\n```bash\nv0.1\nusage:\n\ngoff \u003cinput file path\u003e \u003coutput file path\u003e\n\nthe second argument (output file path) is optional\nand will default to the name of your input file with\nthe appropriate extension.\n```\n\n## Limitations\n\n- We only support CSV \u003e JSON. Consider adding other file types.\n- Data types are always strings. Consider being more clever about data types for formats that support more complex types (like JSON).\n- Malformed file error handling could be better. See [this question in StackOverflow](https://stackoverflow.com/questions/30633115/golang-file-reading-only-reading-last-line). We have a similar problem in the event that incorrect newlines are used. Consider using [transform.Transformer](https://godoc.org/golang.org/x/text/transform#Transformer) to clean up malformed files.\n\n## Future Updates\n\n- Convert read/write to buffered IO. This will allow easier unit testing.\n- Get some test coverage.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeanpdx%2Fgoff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeanpdx%2Fgoff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeanpdx%2Fgoff/lists"}