{"id":23835171,"url":"https://github.com/hoddy3190/csvdiff","last_synced_at":"2026-04-17T09:31:15.728Z","repository":{"id":65029360,"uuid":"103119602","full_name":"hoddy3190/CsvDiff","owner":"hoddy3190","description":"output csv diff smartly","archived":false,"fork":false,"pushed_at":"2017-09-24T11:11:06.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-22T03:29:38.280Z","etag":null,"topics":["csv","csv-diff","diff","golang"],"latest_commit_sha":null,"homepage":null,"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/hoddy3190.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":"2017-09-11T09:58:09.000Z","updated_at":"2020-03-19T19:53:47.000Z","dependencies_parsed_at":"2023-01-01T04:17:44.482Z","dependency_job_id":null,"html_url":"https://github.com/hoddy3190/CsvDiff","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoddy3190%2FCsvDiff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoddy3190%2FCsvDiff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoddy3190%2FCsvDiff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoddy3190%2FCsvDiff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hoddy3190","download_url":"https://codeload.github.com/hoddy3190/CsvDiff/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240122465,"owners_count":19751139,"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-diff","diff","golang"],"created_at":"2025-01-02T15:27:19.645Z","updated_at":"2026-04-17T09:31:15.671Z","avatar_url":"https://github.com/hoddy3190.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CsvDiff\n[![CircleCI](https://circleci.com/gh/altitude3190/CsvDiff/tree/master.svg?style=svg)](https://circleci.com/gh/altitude3190/CsvDiff/tree/master)\n\noutput csv diff smartly\n\n## Usage\n\n```\n./CsvDiff base.csv comparison.csv --pk pk1 [--pk pk2 ...] [--output filePath]\n```\n\nCsv format has to meet the followings\n+ column names are written in the first line\n+ values are written in the second and subsequent lines\n\nYou can see detail in executing the following command\n```\n./CsvDiff --help\n```\n\n## Output Examples\n\n#### example1\n\n```\n$ cat base1.csv\ncompany_id,employee_id,name,created_at\n1,1,\"Bob\",\"2017/09/24\"\n1,2,\"Tom\",\"2017/08/18\"\n2,1,\"Lisa\",\"2017/04/10\"\n2,2,\"Kate\",\"2016/02/14\"\n\n$ cat comparison1.csv\ncompany_id,employee_id,name,created_at\n1,1,\"Bob\",\"2017/09/24\"\n1,2,\"Ben\",\"2017/06/18\"\n1,3,\"Thomas\",\"2017/03/29\"\n2,2,\"Kate\",\"2016/03/14\"\n\n$ ./CsvDiff base1.csv comparison1.csv --pk company_id --pk employee_id | python -m \"json.tool\"\n{\n    \"added\": [\n        {\n            \"company_id\": \"1\",\n            \"created_at\": \"2017/03/29\",\n            \"employee_id\": \"3\",\n            \"name\": \"Thomas\"\n        }\n    ],\n    \"addedColumns\": [],\n    \"deleted\": [\n        {\n            \"company_id\": \"2\",\n            \"created_at\": \"2017/04/10\",\n            \"employee_id\": \"1\",\n            \"name\": \"Lisa\"\n        }\n    ],\n    \"deletedColumns\": [],\n    \"modified\": [\n        {\n            \"fromTo\": {\n                \"created_at\": {\n                    \"from\": \"2017/08/18\",\n                    \"to\": \"2017/06/18\"\n                },\n                \"name\": {\n                    \"from\": \"Tom\",\n                    \"to\": \"Ben\"\n                }\n            },\n            \"pks\": {\n                \"company_id\": \"1\",\n                \"employee_id\": \"2\"\n            }\n        },\n        {\n            \"fromTo\": {\n                \"created_at\": {\n                    \"from\": \"2016/02/14\",\n                    \"to\": \"2016/03/14\"\n                }\n            },\n            \"pks\": {\n                \"company_id\": \"2\",\n                \"employee_id\": \"2\"\n            }\n        }\n    ]\n}\n```\n\n#### example2\n\nIt supports add/delete columns diff, too\n\n```\n$ cat base2.csv\nid,name,updated_at\n1,\"Bob\",\"2017/09/24\"\n2,\"Tom\",\"2017/08/18\"\n3,\"Lisa\",\"2016/07/10\"\n\n$ cat comparison2.csv\nid,name,created_at\n1,\"Bob\",\"2017/09/24\"\n2,\"Tom\",\"2017/08/18\"\n3,\"Ben\",\"2016/07/10\"\n\n$ ./CsvDiff base2.csv comparison2.csv --pk id --output res.json \u0026\u0026 cat res.json | python -m 'json.tool'\n{\n    \"added\": [],\n    \"addedColumns\": [\n        \"created_at\"\n    ],\n    \"deleted\": [],\n    \"deletedColumns\": [\n        \"updated_at\"\n    ],\n    \"modified\": [\n        {\n            \"fromTo\": {\n                \"name\": {\n                    \"from\": \"Lisa\",\n                    \"to\": \"Ben\"\n                }\n            },\n            \"pks\": {\n                \"id\": \"3\"\n            }\n        }\n    ]\n}\n```\n\n## Author\n\n[Hodaka Suzuki](https://github.com/altitude3190)\n\n\n## Lisense\n\n[MIT](https://github.com/altitude3190/CsvDiff/blob/master/LICENSE)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoddy3190%2Fcsvdiff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoddy3190%2Fcsvdiff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoddy3190%2Fcsvdiff/lists"}