You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-1
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,12 @@
5
5
6
6
Tool for viewing the difference between two CSV files. See [Generating a commit log for San Francisco’s 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.
7
7
8
+
## Installation
9
+
10
+
pip install csv-diff
11
+
12
+
## Usage
13
+
8
14
Consider two CSV files:
9
15
10
16
`one.csv`
@@ -43,7 +49,9 @@ Consider two CSV files:
43
49
44
50
The `--key=id` option means that the `id` column should be treated as the unique key, to identify which records have changed.
45
51
46
-
You can also run it using the `--json` option to get a machine-readable difference:
52
+
The tool will automatically detect if your files are comma- or tab-separated. You can over-ride this automatic detection and force the tool to use a specific format using `--format=tsv` or `--format=csv`.
53
+
54
+
You can use the `--json` option to get a machine-readable difference:
47
55
48
56
$ csv-diff one.csv two.csv --key=id --json
49
57
{
@@ -76,6 +84,8 @@ You can also run it using the `--json` option to get a machine-readable differen
76
84
"columns_removed": []
77
85
}
78
86
87
+
## As a Python library
88
+
79
89
You can also import the Python library into your own code like so:
0 commit comments