# Inconnu Inconnu is a GDPR-compliant data privacy tool designed for entity redaction and de-anonymization. It provides cutting-edge NLP-based tools for anonymizing and pseudonymizing text data while maintaining data utility, ensuring your business meets stringent privacy regulations. ## Project Overview Inconnu helps organizations handle sensitive text data by automatically detecting and redacting personal identifiers while preserving document structure and context. Built with spaCy for robust NLP processing, it supports both anonymization (permanent redaction) and pseudonymization (reversible redaction with entity mapping). ## Key Features - **Dual Processing Modes**: Anonymization (`[PERSON]`) and pseudonymization (`[PERSON_0]`) with complete de-anonymization capabilities - **Advanced Entity Detection**: Supports PERSON, GPE (locations), DATE, ORG, EMAIL, IBAN, PHONE_NUMBER, and custom entities - **Multilingual Support**: English, German, Italian, Spanish, and French with optimized spaCy models - **GDPR Compliance**: Built-in data retention policies, audit trails, and processing metadata - **High Performance**: Singleton pattern optimization, configurable text limits, sub-200ms processing times - **Flexible API**: Simple methods (`redact()`, `pseudonymize()`) and advanced processing with full metadata - **Async & Batch Processing**: Non-blocking operations and efficient batch processing capabilities ## Core Architecture The system uses spaCy as the core NLP engine with a modular component system: 1. **Inconnu Class**: Main factory providing the public API with configurable parameters 2. **EntityRedactor**: Core NLP processing engine using singleton pattern for model management 3. **Custom Components**: Extensible NER system for domain-specific entity detection 4. **Configuration System**: Runtime configuration for processing limits and behavior ## Use Cases - **Customer Support**: Anonymize support tickets, chat logs, and service emails - **Legal Documents**: Process contracts and case files for compliance and analysis - **Medical Records**: Remove patient identifiers while preserving clinical information - **Financial Analysis**: Redact personal data from transaction logs and banking communications - **Training Data**: Prepare ML datasets by removing personal identifiers while maintaining semantic meaning - **Survey Analysis**: Anonymize feedback and user-generated content for research ## Installation ```bash # Clone and install git clone https://github.com/0xjgv/inconnu.git cd inconnu make install make model-en # Download English spaCy model # Verify installation make test ``` ## Quick Start ```python from inconnu import Inconnu # Simple initialization inconnu = Inconnu() # Basic anonymization text = "John Doe from New York visited Paris last summer." redacted = inconnu.redact(text) # Output: "[PERSON] from [GPE] visited [GPE] [DATE]." # Pseudonymization with entity mapping redacted_text, entity_map = inconnu.pseudonymize(text) # Output: "[PERSON_0] from [GPE_0] visited [GPE_1] [DATE_0]." # Mapping: {'[PERSON_0]': 'John Doe', '[GPE_0]': 'New York', ...} # Async processing redacted = await inconnu.redact_async(text) # Batch processing results = inconnu.redact_batch([text1, text2, text3]) ``` ## Technical Details - **Language**: Python 3.10+ - **Core Dependencies**: spaCy (NLP), phonenumbers (phone validation) - **Package Management**: UV (modern Python package manager) - **Testing**: pytest with comprehensive coverage - **Code Quality**: ruff for linting and formatting - **Supported Models**: en_core_web_sm (default), en_core_web_lg, en_core_web_trf, and international models ## Development Commands ```bash make install # Install dependencies with UV make model-install # Download required spaCy models make test # Run full test suite make lint # Check code with ruff make format # Format code with ruff make clean # Format, lint, fix, and clean cache ``` The project emphasizes performance, compliance, and extensibility while maintaining a simple, intuitive API for developers working with sensitive text data.