Convert Figma logo to code with AI

microsoft logopresidio

Context aware, pluggable and customizable data protection and de-identification SDK for text and images

3,722
566
3,722
81

Top Related Projects

:closed_lock_with_key: multi factor authentication system (2FA, MFA, OTP Server)

Quick Overview

Presidio is an open-source data protection and anonymization framework developed by Microsoft. It provides tools for identifying and anonymizing sensitive information in text and images, helping organizations comply with data privacy regulations and protect personal data.

Pros

  • Supports multiple languages and can be easily extended to new ones
  • Offers both text and image anonymization capabilities
  • Provides flexible deployment options (as a Python package or via REST API)
  • Integrates well with other data processing pipelines and tools

Cons

  • Limited documentation for advanced use cases and customization
  • Requires some setup and configuration for optimal performance
  • May produce false positives or miss some sensitive data in complex scenarios
  • Performance can be slower for large datasets or complex anonymization tasks

Code Examples

  1. Analyzing text for sensitive information:
from presidio_analyzer import AnalyzerEngine

analyzer = AnalyzerEngine()
text = "My phone number is 212-555-5555"
results = analyzer.analyze(text=text, language="en")
print(results)
  1. Anonymizing text using the Presidio Anonymizer:
from presidio_anonymizer import AnonymizerEngine
from presidio_anonymizer.entities import OperatorConfig

anonymizer = AnonymizerEngine()
text = "My name is John Doe and my phone number is 212-555-5555"
analyzer_results = analyzer.analyze(text=text, language="en")

anonymized_text = anonymizer.anonymize(
    text=text,
    analyzer_results=analyzer_results,
    operators={"PHONE_NUMBER": OperatorConfig("mask", {"chars_to_mask": 4, "masking_char": "*"})}
)
print(anonymized_text.text)
  1. Using Presidio Image Redactor:
from presidio_image_redactor import ImageRedactorEngine

image_redactor = ImageRedactorEngine()
image_path = "path/to/image.jpg"
result = image_redactor.redact(image_path)
result.save("path/to/redacted_image.jpg")

Getting Started

To get started with Presidio, install it using pip:

pip install presidio-analyzer presidio-anonymizer presidio-image-redactor

Then, you can use the Analyzer and Anonymizer as shown in the code examples above. For more advanced usage and configuration options, refer to the official documentation on the GitHub repository.

Competitor Comparisons

:closed_lock_with_key: multi factor authentication system (2FA, MFA, OTP Server)

Pros of PrivacyIDEA

  • Comprehensive identity and access management system with multi-factor authentication
  • Open-source and self-hosted, providing greater control over data and infrastructure
  • Extensive documentation and active community support

Cons of PrivacyIDEA

  • Requires more setup and maintenance compared to cloud-based solutions
  • May have a steeper learning curve for implementation and customization
  • Limited built-in data anonymization or PII detection features

Code Comparison

PrivacyIDEA (Python):

from privacyidea.lib.token import init_token
from privacyidea.lib.user import User

user = User("username", "realm")
token = init_token({"type": "totp", "otpkey": "secret123"}, user=user)

Presidio (Python):

from presidio_analyzer import AnalyzerEngine
from presidio_anonymizer import AnonymizerEngine

analyzer = AnalyzerEngine()
anonymizer = AnonymizerEngine()

text = "John Smith's credit card: 4111-1111-1111-1111"
results = analyzer.analyze(text=text, language="en")
anonymized_text = anonymizer.anonymize(text=text, analyzer_results=results)

While both projects focus on data protection, PrivacyIDEA is primarily an identity and access management system, whereas Presidio specializes in PII detection and anonymization. PrivacyIDEA offers more comprehensive authentication features, while Presidio excels in identifying and protecting sensitive information within text data.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Presidio - Data Protection and De-identification SDK

Context aware, pluggable and customizable PII de-identification service for text and images.


Build Status MIT license Release CII Best Practices PyPI pyversions

  • Presidio Analyzer Pypi Downloads
  • Presidio Anonymizer Pypi Downloads
  • Presidio Image-Redactor Pypi Downloads
  • Presidio Structured Pypi Downloads

What is Presidio

Presidio (Origin from Latin praesidium ‘protection, garrison’) helps to ensure sensitive data is properly managed and governed. It provides fast identification and anonymization modules for private entities in text such as credit card numbers, names, locations, social security numbers, bitcoin wallets, US phone numbers, financial data and more.

Presidio demo gif


:blue_book: Full documentation

:question: Frequently Asked Questions

:thought_balloon: Demo

:flight_departure: Examples


Are you using Presidio? We'd love to know how

Please help us improve by taking this short anonymous survey.


Goals

  • Allow organizations to preserve privacy in a simpler way by democratizing de-identification technologies and introducing transparency in decisions.
  • Embrace extensibility and customizability to a specific business need.
  • Facilitate both fully automated and semi-automated PII de-identification flows on multiple platforms.

Main features

  1. Predefined or custom PII recognizers leveraging Named Entity Recognition, regular expressions, rule based logic and checksum with relevant context in multiple languages.
  2. Options for connecting to external PII detection models.
  3. Multiple usage options, from Python or PySpark workloads through Docker to Kubernetes.
  4. Customizability in PII identification and de-identification.
  5. Module for redacting PII text in images (standard image types and DICOM medical images).

:warning: Presidio can help identify sensitive/PII data in un/structured text. However, because it is using automated detection mechanisms, there is no guarantee that Presidio will find all sensitive information. Consequently, additional systems and protections should be employed.

Installing Presidio

  1. Using pip
  2. Using Docker
  3. From source
  4. Migrating from V1 to V2

Running Presidio

  1. Getting started
  2. Setting up a development environment
  3. PII de-identification in text
  4. PII de-identification in images
  5. Usage samples and example deployments

Support

Contributing

For details on contributing to this repository, see the contributing guide.

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Contributors