{"id":25433312,"url":"https://github.com/haotrr/json2csv","last_synced_at":"2025-10-31T22:30:32.021Z","repository":{"id":57518932,"uuid":"128891618","full_name":"haotrr/json2csv","owner":"haotrr","description":"JSON to CSV converter，a library \u0026 a command.","archived":false,"fork":false,"pushed_at":"2023-06-25T12:30:31.000Z","size":13,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-23T09:09:58.539Z","etag":null,"topics":["csv","json"],"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/haotrr.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}},"created_at":"2018-04-10T07:25:24.000Z","updated_at":"2023-06-25T12:24:08.000Z","dependencies_parsed_at":"2023-07-14T22:53:58.384Z","dependency_job_id":null,"html_url":"https://github.com/haotrr/json2csv","commit_stats":null,"previous_names":["sgtpp/json2csv","qinhao/json2csv"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haotrr%2Fjson2csv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haotrr%2Fjson2csv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haotrr%2Fjson2csv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haotrr%2Fjson2csv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haotrr","download_url":"https://codeload.github.com/haotrr/json2csv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239236637,"owners_count":19604920,"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","json"],"created_at":"2025-02-17T05:19:00.217Z","updated_at":"2025-02-17T05:19:00.946Z","avatar_url":"https://github.com/haotrr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"json2csv\n========\n\nConverts a stream of newline separated json data to csv format. Forks from [jehiah/json2csv](https://github.com/jehiah/json2csv) and make some incompatible changes.\n\n\nInstallation\n============\n\npre-built binaries are available under [releases](https://github.com/haotrr/json2csv/releases).\n\nIf you have a working golang install, you can use `go get`.\n\n```bash\ngo get github.com/haotrr/json2csv/cmd\nmv $GOPATH/bin/cmd $GOPATH/bin/json2csv\n```\n\nUsage\n=====\n\n```\nusage: json2csv\n    -k fields,and,nested.fields,to,output\n    -i /path/to/input.json (optional; default is stdin)\n    -o /path/to/output.csv (optional; default is stdout)\n    --version\n    -H print csv header row\n    -h This help\n```\n\nTo convert:\n\n```json\n{\"user\": {\"name\":\"jehiah\", \"password\": \"root\"}, \"remote_ip\": \"127.0.0.1\", \"dt\" : \"[20/Aug/2010:01:12:44 -0400]\"}\n{\"user\": {\"name\":\"jeroenjanssens\", \"password\": \"123\"}, \"remote_ip\": \"192.168.0.1\", \"dt\" : \"[20/Aug/2010:01:12:44 -0400]\"}\n{\"user\": {\"name\":\"unknown\", \"password\": \"\"}, \"remote_ip\": \"76.216.210.0\", \"dt\" : \"[20/Aug/2010:01:12:45 -0400]\"}\n```\n\nto:\n\n```\n\"jehiah\",\"127.0.0.1\"\n\"jeroenjanssens\",\"192.168.0.1\"\n\"unknown\",\"76.216.210.0\"\n```\n    \nyou would either\n\n```bash\njson2csv -k user.name,remote_ip -i input.json -o output.csv\n```\n\nor\n\n```bash\ncat input.json | json2csv -k user.name,remote_ip \u003e output.csv\n```\n\nPackage\n=======\n```go\nfunc Do(inputFile, outputFile, outputDelim string, allKeys boo, keys []string, printHeader bool) (int, error)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaotrr%2Fjson2csv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaotrr%2Fjson2csv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaotrr%2Fjson2csv/lists"}