bridging-presidio-and-spacy
Skill by maziyarpanahi
Connects OpenMed clinical PII detection to Microsoft Presidio, spaCy and LangChain through the openmed.interop adapter registry. Written for developers who already run one of those pipelines and want to add PHI redaction.
Install bridging-presidio-and-spacy
Built from the published package, never by AI.
git clone --depth 1 https://github.com/maziyarpanahi/openmed /tmp/openmed && mkdir -p ~/.claude/skills && cp -r /tmp/openmed/skills/bridging-presidio-and-spacy ~/.claude/skills/bridging-presidio-and-spacyRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install bridging-presidio-and-spacy in Claude Code
git clone --depth 1 https://github.com/maziyarpanahi/openmed /tmp/openmed && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/openmed/skills/bridging-presidio-and-spacy ~/.gemini/antigravity-cli/skills/bridging-presidio-and-spacyAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install bridging-presidio-and-spacy in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill explains how to combine OpenMed clinical NLP with Microsoft Presidio, spaCy, or LangChain using the openmed.interop adapter registry. The registry loads adapters lazily, so importing openmed does not pull in those libraries. Each bridge is an optional pip extra: presidio, spacy, or langchain. It covers merging Presidio and OpenMed spans, a spaCy openmed_deid pipeline factory, and a LangChain redaction runnable placed before an LLM step.
It is aimed at developers who want to add Presidio recognizers, run OpenMed PII detection inside a spaCy pipeline, or redact PHI before text reaches a language model. The source notes that all spans must index the same text and that LangChain redaction is a guardrail, not a guarantee. It is meant to sit alongside the OpenMed PII and de-identification skills.
Written from the project's SKILL.md and checked against it.
What it can do
- available_adapters, get_adapter, adapter_specDiscover adapters and load them lazily without importing their optional dependencies.
- to_canonicalConverts Presidio RecognizerResults into OpenMed PIIEntity objects.
- from_canonicalConverts OpenMed PIIEntity objects back into Presidio RecognizerResults for the anonymizer.
- merge_with_openmedCombines OpenMed and Presidio spans and resolves overlaps into one set of entities.
- openmed_deidA spaCy pipeline factory that writes OpenMed PII spans to doc.spans and optionally doc.ents.
- create_redaction_runnableA LangChain runnable that redacts strings, Documents, lists and mappings before an LLM step.
- create_redaction_transformA dependency-light redaction object that works without langchain-core installed.
What you need
- Python
- The openmed package, with the presidio, spacy or langchain extra for each bridge used
- A Presidio analyzer and anonymizer, if using the Presidio bridge
- spaCy, if using the spaCy component
- LangChain, if using the LangChain runnable
Try asking
- Merge my Presidio results with OpenMed PII spans for this note
- Add the openmed_deid component to my spaCy pipeline and list the PII spans
- Put OpenMed redaction in front of my LangChain chain so PHI is masked first
Good to know
- LangChain redaction is a guardrail, not a guarantee, and should be checked with leakage gates.
- All spans must index the same text, so offsets from different normalised versions cannot be mixed.
- The spaCy default alignment mode is expand; strict mode drops spans that do not align.
- Touching an adapter without its extra installed raises an ImportError.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/bridging-presidio-and-spacy/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to bridging-presidio-and-spacy
All alternatives →Searches arXiv for scientific papers and preprints, extracts their metadata and abstracts, and downloads PDF or HTML full text. Suited to users who need research papers, literature or specific arXiv IDs.
Downloads AlphaFold predicted structures and PAE matrices for a UniProt ID, then reports pLDDT confidence, domain boundaries and disorder. Built for users who already have a UniProt accession.
Queries the QuickGO and Evidence & Conclusion Ontology REST API to map genes to Gene Ontology terms. Built for researchers doing functional annotation and GO hierarchy exploration.
Connects an AI assistant to Peloton to browse fitness classes, check live and archived schedules, and manage workouts. Built for Peloton users who want to plan rides from their assistant.
Queries NCBI Gene through the E-utilities and Datasets API. It helps researchers search genes by symbol or ID, retrieve gene details, and run batch lookups for annotation and functional analysis.
Prepares and launches nf-core/pacsomatic runs for matched tumor-normal PacBio HiFi data starting from unaligned BAM files. It generates samplesheets and pinned launch artifacts, then runs locally or submits to a scheduler.
Compare with literature-search-arxiv, alphafold-database-fetch-and-analyze or quickgo-database
bridging-presidio-and-spacy: common questions
Does importing openmed also load Presidio, spaCy or LangChain?
No. The adapters sit behind explicit imports, and each one is an optional extra you install only when needed.
Can I check which adapters exist without installing them?
Yes. available_adapters() and adapter_spec() do not import the adapter module, so they are safe to call for discovery.
Why merge Presidio and OpenMed spans instead of taking a union?
merge_with_openmed runs both sets through the semantic-unit merger, so overlapping detections collapse into one span rather than causing double redactions.
How do I install bridging-presidio-and-spacy?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is bridging-presidio-and-spacy free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is bridging-presidio-and-spacy safe to use?
It scores 79 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to bridging-presidio-and-spacy?
Similar skills: literature-search-arxiv, alphafold-database-fetch-and-analyze, quickgo-database, peloton.
