Python module for integrating Protegrity's Data Discovery and Protection APIs into GenAI and traditional applications.
Project description
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
- Git
- Python >= 3.9.23
- pip
- Python Virtual Environment
- If the
protegrity-developer-pythonmodule is already installed, uninstall it from the Python virtual environment.
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-pythondirectory 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
- The Protegrity Developer Edition documentation is available at http://developer.docs.protegrity.com/.
- For API reference and tutorials, visit the Developer Portal at https://www.protegrity.com/developers.
๐งช 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file protegrity_developer_python-0.9.0rc6.tar.gz.
File metadata
- Download URL: protegrity_developer_python-0.9.0rc6.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ecc118826c2e321209db13ddba8130a92e2a709e74770d9e7cc3341d9ded6940
|
|
| MD5 |
5600f834c51dda1e7e170b46c959a697
|
|
| BLAKE2b-256 |
75e7b58d0d8e2f41b22dc29cb3e9920a96c36b9562ff55779093136d10124a75
|
File details
Details for the file protegrity_developer_python-0.9.0rc6-py3-none-any.whl.
File metadata
- Download URL: protegrity_developer_python-0.9.0rc6-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30a63d5b53ad62908d2e0df1bbabdc3afc758dfe4de9adc9d7d4e7d10d64ea13
|
|
| MD5 |
7b5688dc315c1ced1f8157d291109980
|
|
| BLAKE2b-256 |
7f615adc947b2941930e60d217b931508c18304cc1bfbd075a321da9d6468f95
|