Skip to content

Commit b9a25ca

Browse files
committed
Updated README to document --format and TSV, refs #4
1 parent 4645d93 commit b9a25ca

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Diff for: README.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55

66
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.
77

8+
## Installation
9+
10+
pip install csv-diff
11+
12+
## Usage
13+
814
Consider two CSV files:
915

1016
`one.csv`
@@ -43,7 +49,9 @@ Consider two CSV files:
4349

4450
The `--key=id` option means that the `id` column should be treated as the unique key, to identify which records have changed.
4551

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:
4755

4856
$ csv-diff one.csv two.csv --key=id --json
4957
{
@@ -76,6 +84,8 @@ You can also run it using the `--json` option to get a machine-readable differen
7684
"columns_removed": []
7785
}
7886

87+
## As a Python library
88+
7989
You can also import the Python library into your own code like so:
8090

8191
from csv_diff import load_csv, compare

0 commit comments

Comments
 (0)