Skip to content

Packs / data-science-public

clean-and-dedupe

clean a CSV: trim whitespace, normalise case and phone/email formats, and drop duplicate records

L2 Checks passed 3 of 3 runsv1.0.0Tech-Realm/space-data-science-public

Install

logicpacks pack use data-science-public/clean-and-dedupe
get_pack data-science-public/clean-and-dedupe

The second line is the MCP tool call for the LogicPacks connector (Claude Code, Codex, Claude.ai and others). The first run of a pack someone else wrote asks for your yes.

Keys it needs (names only)

None.

Playbooks included

  • Spec: spec/SPEC.md (goal, steps, edge cases, don’ts)
  • Routes: python-stdlibpandas
  • Checks: 1 in outcome/checks.yaml
  • Code: clean.py
  • Tools: python3

Usage, last 8 weeks

New: no recorded use yet.

Purpose (from spec/SPEC.md)

Goal

Clean a CSV: trim whitespace, normalise case and phone/email formats, and drop duplicate records.

Steps

  1. Profile the file first (csv-profile).
  2. Pick the key columns that identify one real-world record.
  3. Run clean.py and spot-check dropped rows.

Edge cases

  • Fuzzy duplicates (typos) need a similarity pass; this does exact-after-normalising.
  • Title-casing breaks names like 'McDonald'.

Don'ts

  • Don't overwrite the source file; write a new one.

Routes (free first)

  1. python-stdlib: code/clean.py (no install).
  2. pandas (free): same job in pandas for large files (pip install pandas)