Metadata-Version: 2.1
Name: piigpt
Version: 0.11
Summary: Provides a mechanism to anonymize PII and PHI before sending to a LLM API
Home-page: https://github.com/your_username/your_package
Author: Dustin Morris
Author-email: your_email@example.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: azure-ai-textanalytics ==5.3.0
Requires-Dist: azure-common ==1.1.28
Requires-Dist: azure-core ==1.30.0
Requires-Dist: certifi ==2024.2.2
Requires-Dist: charset-normalizer ==3.3.2
Requires-Dist: exrex ==0.11.0
Requires-Dist: idna ==3.6
Requires-Dist: isodate ==0.6.1
Requires-Dist: python-dotenv ==1.0.1
Requires-Dist: requests ==2.31.0
Requires-Dist: six ==1.16.0
Requires-Dist: toml ==0.10.2
Requires-Dist: typing-extensions ==4.9.0
Requires-Dist: urllib3 ==2.2.1

# piigpt

Provides a mechanism to anonymize PII and PHI before sending to a LLM API

## Basic Setup:

```
from Analyzers.AnalyzerType import AnalyzerType
from PIIScrubber import PIIScrubber

def main():
    from dotenv import load_dotenv
    load_dotenv("sample.env")
    pii = PIIScrubber(AnalyzerType.AZURE)
    text = "My phone number is 555-555-5555"
    print(pii.scrub([text]))
    print(pii.get_entities([text]))
    print(pii.anonymize(pii.get_entities([text]), text))
    print(pii.deanonymize(pii.anonymize(pii.get_entities([text]), text)))

if __name__ == "__main__":
    main()
```

**Output:**
['My phone number is ************']
[Text: 555-555-5555, Category: PhoneNumber, Subcategory: None, Offset: 19, Length: 12]
My phone number is :yudDNDuGJG:
My phone number is 555-555-5555

## Extensible
#### Analyzers:
Currently AzureAIAnalyzer is supported.  Contribute by adding additional analyzers following the BaseAnalyzer interface.
Configure your parameters for your analyzer in the analyzer_config.toml file

#### Anonymizers:
Plug in your own anonymizer or use the built in Anonymizer.
Change how the built in anonymizer anonymizes entities by changing the anonymizer_config.toml file or use the defaults.

### CacheProviders:
Use the built in dictionary cache provider or insert your own CacheProvider following the BaseCache interface.
Cache ensures all PII is deleted in a timely manner



