Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

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.

  • Score 79
  • 5.8k stars
  • Apache-2.0
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

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-spacy

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install bridging-presidio-and-spacy in Claude Code

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

A

No 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 →

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.

bridging-presidio-and-spacy Install

Add to stack

Loading.