시작하기
CSV Join Audit

CSV Join Audit

Audit two CSV exports before you merge. Find duplicate, blank, and unmatched keys, preview the row count for each join type, and export an issues list with exact source line numbers. Check single-column or composite keys locally with Python.
#분석
평점
더 많은 평가가 필요합니다
판매
0
사용 방법
다운로드

Check your CSV join before you merge

A duplicate lookup key can turn six orders into eight rows. CSV Join Audit shows how your two files will match, how many rows each join would produce, and which records need a closer look.

What you get

  • Projected row counts for inner, left, right, and full joins.
  • Counts of blank, unmatched, duplicate, and many-to-many keys on the relevant sides of the join.
  • Optional one-to-one, one-to-many, or many-to-one checks. A many-to-one check verifies that every nonblank key on the right is unique.
  • An optional issues CSV with the input side, record number, physical line range, and issue codes. The issues CSV omits source cell values.

When to use it

  • Before joining orders to a product or customer lookup, check whether the lookup can multiply rows.
  • When reconciling two exports, find records with no counterpart on either side.
  • Before joining on a composite key, check all key columns together. This is useful when a SKU can repeat across stores or warehouses.

Requirements

Python 3.9 or newer and two UTF-8 CSV files with headers. UTF-8 BOM files are supported. Both inputs must use the same delimiter, either comma, semicolon, or tab. The script uses Python's standard library. The guided workflow also needs an agent client with local file and command access.

How to run

Install the downloaded skill in your agent client and give it the two file paths, the columns to match, and the join you plan to run. For example, ask it to audit a left join from orders.csv to products.csv on sku and check whether each order matches at most one product.

To run the bundled example directly, open a terminal in the skill folder and use a new output filename.

python3 scripts/audit_join.py examples/orders.csv examples/products.csv --key sku sku --expect many-to-one --issues-csv join-review.csv

The sample projects eight left-join rows from six orders. The duplicate product key adds two rows and causes the many-to-one check to return exit code 3. The JSON summary and issues CSV are still available. Use python in place of python3 if that is your Python command.

For your own files, repeat --key LEFT_COLUMN RIGHT_COLUMN for a composite key. Keys are compared as exact text by default, including leading zeros. Use --trim or --ignore-case only when your intended join uses those rules. Any blank key component makes that record nonmatching. The script produces a preview and leaves the merge to your existing tools.

Privacy and data handling

The bundled Python script reads the CSVs on your device. It makes no network requests and leaves the source files untouched. The optional issues CSV is saved to the path you choose. Running through an agent client may send prompts, file excerpts, or tool output to its configured model provider under that client's settings and terms. To keep the audit local, run the Python command directly.

For support, contact [email protected]. Include a synthetic or redacted example if you need to show a problem.