Skip to main content

Detection and redaction of PII using GLiNER

Project description

blankit: PII detection and removal in python

A lightweight package for detecting and removing Personally Identifiable Information (PII).

blankit currently uses GLiNER as a backend to remove different types of PII

PII types

Due to the versatility of GLiNER, blankit can essentially detect any PII type, though by default it supports the following:

  • Name
  • Location
  • Ethnicity
  • Gender
  • Business Name
  • Email address
  • Phone number

However, you can specify your own PII types for more bespoke applications if needed.

Getting started

Installation

Install the package either from this repo or via your favourite package manager, such as conda or uv

uv add blankit

Detecting PII

Detect and remove PII as follows:

from blankit.scanner import Scanner

text = "My name's gary and i live in fairfield with bruz and mugsy"

scanner = Scanner(pii_types=['Name', 'Location'])

# extract all the pii
entities = scanner.find_pii(text)

# remove pii from the text
text_redacted = scanner.redact(text)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blankit-0.2.1.tar.gz (55.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blankit-0.2.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file blankit-0.2.1.tar.gz.

File metadata

  • Download URL: blankit-0.2.1.tar.gz
  • Upload date:
  • Size: 55.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.7

File hashes

Hashes for blankit-0.2.1.tar.gz
Algorithm Hash digest
SHA256 26d5db1b0be39018f904d56062bc2bcba9382c7b8f95f21ecd98b7c582be87e8
MD5 6245d7ca9dae7a0a25018607abf76035
BLAKE2b-256 c4bac7f04014cd884d6254a0662ca4791fe35c7084a1cbc25dab1ee5229add9b

See more details on using hashes here.

File details

Details for the file blankit-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: blankit-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.7

File hashes

Hashes for blankit-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f8b8520f3996429d3d1a8920b825b8a9d31bfef42bed8f7715eb1175bf7a600c
MD5 05adf2c1323cd7b7fdf0b7101a010439
BLAKE2b-256 ecddb6ec66954396ba6694228af83be982cb71fdce4145882afc0df5d7d6928c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page