An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

csv-diff

This library performs diffs of CSV data, or any table-like source. Unlike a standard diff that compares line by line, and is sensitive to the ordering of records, CSV-Diff identifies common lines by key field(s), and then compares the contents of the fields in each line. Data may be supplied in the form of CSV files, or as an array of arrays. The diff process provides a fine level of control over what to diff, and can optionally ignore certain types of changes (e.g. changes in position). CSV-Diff is particularly well suited to data in parent-child format. Parent- child data does not lend itself well to standard text diffs, as small changes in the organisation of the tree at an upper level can lead to big movements in the position of descendant records. By instead matching records by key, CSV-Diff avoids this issue, while still being able to detect changes in sibling order. This gem implements the core diff algorithm, and handles the loading and diffing of CSV files (or Arrays of Arrays). It also supports converting data in XML format into tabular form, so that it can then be processed like any other CSV or table-like source. It returns a CSVDiff object containing the details of differences in object form. This is useful for projects that need diff capability, but want to handle the reporting or actioning of differences themselves. For a pre-built diff reporting capability, see the csv-diff-report gem, which provides a command-line tool for generating diff reports in HTML, Excel, or text formats.

Ecosystem
gem.coop
Latest Release
0.6.1
over 5 years ago
Versions
9
Downloads
3,525,961 total
Links
Registry gem.coop
Source Repository
Docs Documentation
JSON API View JSON
CodeMeta codemeta.json
Package Details
PURL pkg:gem/csv-diff?repository_url=https://gem.coop
spec
License MIT
First Release almost 12 years ago
Last Synced about 15 hours ago
Keywords
csv-diff diff ruby
Repository
Stars 46 on GitHub
Forks 18 on GitHub
Commits 82
Committers 4
Avg per Author 20.5
DDS 0.293
Rankings on gem.coop
Overall Top 0.6%
Downloads Top 1.8%