Skip to Content
SDKsOverview

SDKs

Expunct provides official SDKs for Python and Node.js. Both SDKs offer a consistent, idiomatic interface to the Expunct API with full type safety and automatic retry logic.

Common Features

Both SDKs provide:

  • Sync and async clients — Python offers both PiiRedactor (sync) and AsyncPiiRedactor (async); Node.js offers PiiRedactor with async methods throughout
  • 6 resourcesredact, jobs, batch, policies, api_keys/apiKeys, audit
  • Convenience methodssanitize_text/sanitizeText, sanitize_file/sanitizeFile, sanitize_uri/sanitizeUri for common workflows
  • Automatic retry with exponential backoff on transient failures
  • Typed models — Pydantic v2 models for Python, TypeScript types for Node.js

Comparison

FeaturePython SDKNode.js SDK
Packagepii-redactor-sdk@pii-redactor/sdk
RuntimePython 3.10+Node.js 18+
HTTP ClienthttpxNative fetch
ModelsPydantic v2TypeScript types
Sync ClientPiiRedactor
Async ClientAsyncPiiRedactorPiiRedactor (all async)
Dependencieshttpx, pydanticZero runtime deps

Installation

Python

pip install pii-redactor-sdk

Node.js

npm install @pii-redactor/sdk

Quick Start

Python

from pii_redactor_sdk import PiiRedactor client = PiiRedactor(api_key="pk_live_...") result = client.redact.text( text="John Smith's email is john@example.com", ) print(result.redacted_text) # "[PERSON]'s email is [EMAIL_ADDRESS]"

Node.js

import { PiiRedactor } from '@pii-redactor/sdk'; const client = new PiiRedactor({ apiKey: 'pk_live_...' }); const result = await client.redact.text({ text: "John Smith's email is john@example.com", }); console.log(result.redactedText); // "[PERSON]'s email is [EMAIL_ADDRESS]"