deidentify-a-dataset
What it does
This skill removes personal details from the free-text columns of a local data file, such as a CSV, and writes a separate redacted copy. It is for analysts who must share or analyze clinical data safely.
When to use it
- ✓When you need to prepare a clinical CSV, JSONL or Parquet dataset for analysis or sharing.
- ✓When only certain free-text columns in a dataset contain patient details.
- ✓When you need a summary of how much was redacted, without seeing the values.
Skill link
https://github.com/maziyarpanahi/openmed/blob/master/skills/deidentify-a-dataset/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Redact the note column in this patient CSV and save a new file, without changing the original.”
5 new skills a week. 1 minute to read.
How it works
The agent confirms the file type and the named text columns, writes the redacted data to a new file, and reports only aggregate counts and rates.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
De-identify a dataset
Keep the source local, name the free-text columns explicitly, and write to a different destination. Never infer columns or print source and redacted cell values.
Procedure
- Confirm that the input is CSV, JSONL/NDJSON, or Parquet.
- Confirm which columns contain free text. Do not scan or log values to guess.
- Choose a policy and language. Prefer
strict_no_leakwhen recall is the governing safety requirement. - Write to a new path; never overwrite the input.
- Inspect only
result.summary, which contains aggregate counts and rates. - Validate recall and residual leakage on representative synthetic or approved evaluation fixtures before releasing the output.
Runnable synthetic example
Install the model runtime first with python -m pip install "openmed[hf]".
import csv
from pathlib import Path
from openmed import redact_dataset
source = Path("synthetic-notes.csv")
destination = Path("synthetic-notes.redacted.csv")
with source.open("w", newline="", encoding="utf-8") as handle:
writer = csv.DictWriter(handle, fieldnames=["record_id", "note"])
writer.writeheader()
writer.writerows(
[
{
"record_id": "SYNTH-001",
"note": (
"Taylor Example called 212-555-0198 about a "
"metformin refill."
),
},
{
"record_id": "SYNTH-002",
"note": (
"Send the synthetic follow-up to "
"demo.patient@example.test."
),
},
]
)
result = redact_dataset(
source,
text_columns=["note"],
output_path=destination,
policy="strict_no_leak",
lang="en",
)
print(result.output_path)
print(result.summary.to_dict()) # Aggregate counts only; no cell contents.
Use the equivalent CLI for an existing dataset:
openmed redact-dataset notes.csv \
--text-columns note,comment \
--policy strict_no_leak \
--output notes.redacted.csv
Safety checks
- Keep model inference and files on infrastructure the user controls.
- Do not print input rows, detected entity surfaces, reversible mappings, or exception payloads that may contain source text.
- Keep source and output paths separate and access-controlled.
- Treat the aggregate summary as evidence, not as proof of compliance.
- Never commit real clinical data or restricted evaluation corpora.
Repository example
Read and run the offline dataset walkthrough when you need a bundled synthetic fixture and first-run download controls.
FAQ
Does it overwrite my original file?
No. It writes to a new path and never changes the input.
Does it guess which columns to scan?
No. You name the free-text columns, and the skill does not infer them from the values.
Which file types work?
CSV, JSONL or NDJSON, and Parquet files are supported.
Details
Original description by the author
De-identify selected free-text columns in a local CSV, JSONL, or Parquet dataset with OpenMed and produce a separate redacted dataset plus a PHI-free aggregate summary. Use when an agent must prepare a clinical dataset for analysis or sharing without overwriting the source or exposing cell values in logs.
repo: maziyarpanahi/openmed
Popularity
- GitHub stars
- 5.8k
- Ranking position
- #14688
- License
- Apache-2.0
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
annotating-variants
5.8kHelps your agent predict what a genetic variant does, convert HGVS names to genome positions and attach population frequencies, using free public annotators.
ask-openmed
5.8kHelps your agent pick the right OpenMed workflow for a clinical text request, starting with a privacy check whenever patient data may be present.
assembling-fhir-bundles
5.8kPackages several FHIR health records into one transaction Bundle ready to send to an EHR, with the internal references linked correctly.
auditing-deid-leakage
5.8kScans de-identified clinical text for leftover identifiers such as SSNs, card numbers, emails and dates, and blocks release if any remain.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.