PII Scanner
A Python library designed for text processing using SpaCy and custom regex pattern matching. This library is capable of processing a variety of text data formats, such as lists, plain text, PDFs, JSON, CSV, and XLSX files
Installation
pip install pii_scanner
Usage
import asyncio
from pii_scanner.scanner import PIIScanner
from pii_scanner.constants.patterns_countries import Regions
async def run_scan():
# Start the timer
start_time = time.time()
pii_scanner = PIIScanner()
# file_path = 'dummy-pii/test.json'
file_path = 'dummy-pii/test.xlsx'
data = ['Ankit Gupta', '+919140562125', 'Indian']
results_list_data = await pii_scanner.scan(data=, sample_size=0.005, region=Regions.IN)
# results_file_data = await pii_scanner.scan(file_path=file_path, sample_size=0.005, region=Regions.IN)
print("Results:", results_list_data, results_list_data)
# Run the asynchronous scan
asyncio.run(run_scan())
Output
[
{
"text": "Ankit Gupta",
"entity_detected": [
{"type": "PERSON", "start": 0, "end": 11, "score": 0.85}
]
},
{
"text": "+919140562195",
"entity_detected": [
{"type": "PHONE_NUMBER", "start": 0, "end": 13, "score": 0.85}
]
},
{
"text": "Indian",
"entity_detected": [
{"type": "NATIONALITY", "start": 0, "end": 6, "score": 0.9}
]
}
]
Metadata
Release files for pii-Scanner 0.1.22
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pii_scanner-0.1.22.tar.gz | 162.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pii_Scanner-0.1.22-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 335.5 kB
Release files / pii_scanner-0.1.22.tar.gz
| Download URL | pii_scanner-0.1.22.tar.gz |
|---|---|
| Size | 162.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
113e569b023b4f2e3131aa17978433b180a533eba853e9fdddafa10d91f05800
|
|
BLAKE2b-256 checksum How to use checksums |
3acd0ed1bcd54483940057e28e0c696aa2e6f8012225902a0ceded45077ab4d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.10.16
|
Release files / pii_Scanner-0.1.22-py3-none-any.whl
| Download URL | pii_Scanner-0.1.22-py3-none-any.whl |
|---|---|
| Size | 173.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7d2f441e9b4c1c0eb0d083cf04e539db5bd7d09255eb2d68e5ea0c83dc1258b9
|
|
BLAKE2b-256 checksum How to use checksums |
e303b0bf4dc3f66b9f59f1d63a86940fdbefa89671f80b9f5c328cab764e7d60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.10.16
|