Skip to main content
flexorch-audit is an open-source library that detects PII, masks sensitive text, and scores document quality — entirely on your own machine. It makes no API calls and requires no FlexOrch account, so your data never leaves your infrastructure.

Features

  • PII detection — 46 types across TR, EU, and US jurisdictions
  • Text masking — 4 strategies: redact, replace, token, and hash
  • Quality metrics — grade (A–D), numeric score, noise ratio, and language detection
  • Compliance summary — KVKK / GDPR risk categories via compliance_report()
  • LLM preparationredact_for_llm() one-liner that detects and masks in a single call
  • LangChain & LlamaIndex — drop-in loaders with built-in quality filtering
  • Zero dependencies — pure Python / pure JavaScript, no heavy ML models required

Quick example

from flexorch_audit import audit

result = audit("""
  Invoice from Acme Ltd.
  Contact: john.doe@acme.com
  IBAN: TR33 0006 1005 1978 6457 8413 26
  Amount: €12,500
""")

print(result["quality_grade"])        # "A"
print(result["pii_summary"]["count"]) # 2
print(result["detected_language"])    # "en"

Relationship to the FlexOrch platform

flexorch-audit is the core detection engine that powers the FlexOrch platform. When you use the platform, you get everything in this library plus:
  • Structured extraction for 9 document types
  • Managed async pipeline with job history
  • Dataset building and export
  • Cloud connectors (S3, GCS, Azure Blob)
  • Full GDPR Article 30 ROPA and NIS2 audit export
  • Team management and access controls
Use flexorch-audit when you want detection inside your own pipeline. Use the FlexOrch platform when you want the full managed workflow without building it yourself.

Packages

flexorch-audit on PyPI

Python 3.10+ · pip install flexorch-audit

@flexorch/audit on npm

Node 18+ · npm install @flexorch/audit

Explore the docs

Installation

Install the library and run your first audit in under two minutes.

Masking

Replace PII with redacted labels, tokens, synthetic values, or hashes.

Compliance Report

Generate a local KVKK / GDPR risk summary from detected findings.

LangChain Integration

Load quality-filtered, PII-masked documents into your LangChain chain.

LlamaIndex Integration

Feed privacy-safe documents into a LlamaIndex vector index.