{ "info": { "author": "Simon Willison", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "Intended Audience :: Science/Research", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# csv-diff\n\n[![PyPI](https://img.shields.io/pypi/v/csv-diff.svg)](https://pypi.org/project/csv-diff/)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/csv-diff/blob/master/LICENSE)\n\nTool for viewing the difference between two CSV files. See [Generating a commit log for San Francisco\u2019s official list of trees](https://simonwillison.net/2019/Mar/13/tree-history/) (and the [sf-tree-history repo commit log](https://github.com/simonw/sf-tree-history/commits)) for background information on this project.\n\nConsider two CSV files:\n\n`one.csv`\n\n id,name,age\n 1,Cleo,4\n 2,Pancakes,2\n\n`two.csv`\n\n id,name,age\n 1,Cleo,5\n 3,Bailey,1\n\n`csv-diff` can show a human-readable summary of differences between the files:\n\n $ csv-diff one.csv two.csv --key=id\n 1 row changed, 1 row added, 1 row removed\n\n 1 row changed\n\n Row 1\n age: \"4\" => \"5\"\n\n 1 row added\n\n id: 3\n name: Bailey\n age: 1\n\n 1 row removed\n\n id: 2\n name: Pancakes\n age: 2\n\nThe `--key=id` option means that the `id` column should be treated as the unique key, to identify which records have changed.\n\nYou can also run it using the `--json` option to get a machine-readable difference:\n\n $ csv-diff one.csv two.csv --key=id --json\n {\n \"added\": [\n {\n \"id\": \"3\",\n \"name\": \"Bailey\",\n \"age\": \"1\"\n }\n ],\n \"removed\": [\n {\n \"id\": \"2\",\n \"name\": \"Pancakes\",\n \"age\": \"2\"\n }\n ],\n \"changed\": [\n {\n \"key\": \"1\",\n \"changes\": {\n \"age\": [\n \"4\",\n \"5\"\n ]\n }\n }\n ],\n \"columns_added\": [],\n \"columns_removed\": []\n }\n\nYou can also import the Python library into your own code like so:\n\n from csv_diff import load_csv, compare\n diff = compare(\n load_csv(open(\"one.csv\"), key=\"id\"),\n load_csv(open(\"two.csv\"), key=\"id\")\n )\n\n`diff` will now contain the same data structure as the output in the `--json` example above.\n\nIf the columns in the CSV have changed, those added or removed olumns will be ignored when calculating changes made to specific rows.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/simonw/csv-diff", "keywords": "", "license": "Apache License, Version 2.0", "maintainer": "", "maintainer_email": "", "name": "csv-diff", "package_url": "https://pypi.org/project/csv-diff/", "platform": "", "project_url": "https://pypi.org/project/csv-diff/", "project_urls": { "Homepage": "https://github.com/simonw/csv-diff" }, "release_url": "https://pypi.org/project/csv-diff/0.5.1/", "requires_dist": [ "click", "dictdiffer", "pytest ; extra == 'test'" ], "requires_python": "", "summary": "Python CLI tool and library for diffing CSV files", "version": "0.5.1" }, "last_serial": 5197382, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "94b57db57821643e5995499b7f59bf77", "sha256": "9d0a2c9a4e67c5b9a5fa12224227136ec1e45335f705fc5a232843e8d1733d48" }, "downloads": -1, "filename": "csv_diff-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "94b57db57821643e5995499b7f59bf77", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9602, "upload_time": "2019-03-13T02:08:40", "url": "https://files.pythonhosted.org/packages/83/3a/96f8ca9a7b470bad6321c302262b1ebcb901297f3ec49378f94ccd6972de/csv_diff-0.1-py3-none-any.whl" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "bc3d456869269bbd25e2179cdfb1399f", "sha256": "03d7ea821a0f32413cb731c579aea6e109cb3ac0abf529adf15a3a0a7751bf34" }, "downloads": -1, "filename": "csv_diff-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "bc3d456869269bbd25e2179cdfb1399f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9640, "upload_time": "2019-03-13T05:07:10", "url": "https://files.pythonhosted.org/packages/1d/1b/af8fcfe538329d6d3b52a8677cc140485145d14438d8d31955fbff42df0c/csv_diff-0.2-py3-none-any.whl" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "71b2d2c86dfcddc86237d33c6cbe16f7", "sha256": "dec9beec48c763dd7cedee5d203a041bcd7bfdfec95739bab852dfc4389ada49" }, "downloads": -1, "filename": "csv_diff-0.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "71b2d2c86dfcddc86237d33c6cbe16f7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9827, "upload_time": "2019-04-07T19:45:39", "url": "https://files.pythonhosted.org/packages/04/80/9c3a9f87ae049a21d94fc11043444c916c9073674fd98fef1629f2766533/csv_diff-0.3.1-py3-none-any.whl" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "2f82a0924a11f965ef98e33b9376e1ef", "sha256": "0725ca6b6d5d9c6cad1547d1fb5880ab26ae6e5bc43a9307f39cdc228f2edadf" }, "downloads": -1, "filename": "csv_diff-0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "2f82a0924a11f965ef98e33b9376e1ef", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10183, "upload_time": "2019-04-12T02:41:34", "url": "https://files.pythonhosted.org/packages/76/ba/842673a62fe8cebed702c0356bcaabb42a319913fd09fab022ff294737b1/csv_diff-0.4-py3-none-any.whl" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "5f7fcffa45015042312147a4d16f3ac6", "sha256": "feeb0afcdc50857a7716224d550b60fc3d4815554efcacf83d588f0d0ff7f6d1" }, "downloads": -1, "filename": "csv_diff-0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "5f7fcffa45015042312147a4d16f3ac6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10748, "upload_time": "2019-04-27T18:19:20", "url": "https://files.pythonhosted.org/packages/b8/b9/19796004a690d9ea69770460ec3c10d0344337826b815242285b4f9dbb52/csv_diff-0.5-py3-none-any.whl" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "e332d52b61136d63241e1cda9ca4c68e", "sha256": "0afb6e42b0e671889ae0d50927a88577501765df03049df7bd6bd3a9fd10a0e8" }, "downloads": -1, "filename": "csv_diff-0.5.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e332d52b61136d63241e1cda9ca4c68e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10777, "upload_time": "2019-04-27T18:25:28", "url": "https://files.pythonhosted.org/packages/40/cc/6d48401b56c5d9ee49aedc090b2a7ca4ce5888837ad923b19feb9377913f/csv_diff-0.5.1-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e332d52b61136d63241e1cda9ca4c68e", "sha256": "0afb6e42b0e671889ae0d50927a88577501765df03049df7bd6bd3a9fd10a0e8" }, "downloads": -1, "filename": "csv_diff-0.5.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e332d52b61136d63241e1cda9ca4c68e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10777, "upload_time": "2019-04-27T18:25:28", "url": "https://files.pythonhosted.org/packages/40/cc/6d48401b56c5d9ee49aedc090b2a7ca4ce5888837ad923b19feb9377913f/csv_diff-0.5.1-py3-none-any.whl" } ] }