You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

protegrity-developer-python

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

protegrity-developer-python

Python module for integrating Protegrity's Data Discovery and Protection APIs into GenAI and traditional applications.

0.9.0rc6
pipPyPI
Maintainers
1

Protegrity Developer Edition – protegrity-developer-python

Welcome to the protegrity-developer-python repository, part of the Protegrity Developer Edition suite. This repository provides the Python module for integrating Protegrity's Data Discovery and Protection APIs into GenAI and traditional applications. Customize, compile, and use the module as per your requirement.

💡Note: This module should be built and used, only if you intend to change the source and default behavior.

💡Note: Ensure that the Protegrity Developer Edition is running before installing this module. For setup instructions, please refer to the documentation here.

📦 Repository Structure

.
├── LICENSE
├── README.md
├── pyproject.toml
├── pytest.ini
├── requirements.txt
├── src
│   ├── protegrity_developer_python
│   │   ├── __init__.py
│   │   └── securefind.py
└── tests
    ├── e2e
    │   ├── features
    │   ├── steps
    │   ├── data
    │   └── utils
    │   └── conftest.py
    │   └── README.md
    └── unit
        └── test_securefind.py

🧰 Features

  • Find and Redact provides the functionality for classifying PII in unstructured text.
  • Cross-platform support for the Linux, Windows, and MacOS operating systems.

Getting Started

Prerequisites

pip uninstall protegrity-developer-python

Build the protegrity-developer-python module

  • Clone the repository.
    git clone https://github.com/Protegrity-Developer-Edition/protegrity-developer-python.git
    
  • Navigate to the protegrity-developer-python directory in the cloned location.
  • Activate the Python virtual environment.
  • Install the dependencies.
    pip install -r requirements.txt
    
  • Build and install the module by running the following command from the root directory of the repository.
    pip install .
    
    The installation completes and the success message is displayed.

🧪 Sample Usage

import protegrity_developer_python

protegrity_developer_python.configure(
    endpoint_url="http://localhost:8580/pty/data-discovery/v1.0/classify",
    named_entity_map={"PERSON": "NAME", "SOCIAL_SECURITY_NUMBER": "SSN"},
    masking_char="#",
    classification_score_threshold=0.6,
    method="redact",
    enable_logging=True,
    log_level="info"
)

input_text = "John Doe's SSN is 123-45-6789."
output_text = protegrity_developer_python.find_and_redact(input_text)
print(output_text)

💡Note: Ensure that the Protegrity Developer Edition is running before executing this snippet. For setup instructions, please refer to the documentation here

📄 Configuration

You can configure the SDK using a config.json file or programmatically. Key parameters include:

  • endpoint_url: URL of the Data Discovery classification API.
  • named_entity_map: Mapping of entity types to label.
  • masking_char: Character used for masking PII.
  • classification_score_threshold: Minimum score to consider classification.
  • method: redact or mask.
  • enable_logging: Enable or disable logging.
  • log_level: Set the logging level.

📚 Documentation

🧪 Sample Use Case

Use this repo to build GenAI applications like chatbots that:

  • Detect PII in prompts using the classifier.
  • Redact or mask sensitive data before processing.

📜 License

See LICENSE for terms and conditions.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.