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 Expunct (sync) and AsyncExpunct (async); Node.js offers Expunct 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
Packageexpunct@expunct/sdk
RuntimePython 3.10+Node.js 18+
HTTP ClienthttpxNative fetch
ModelsPydantic v2TypeScript types
Sync ClientExpunct
Async ClientAsyncExpunctExpunct (all async)
Dependencieshttpx, pydanticZero runtime deps

Installation

Python

pip install expunct

Node.js

npm install @expunct/sdk

Quick Start

Python

from expunct import Expunct client = Expunct(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 { Expunct } from '@expunct/sdk'; const client = new Expunct({ 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]"