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.0.tar.gz (54.5 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.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for blankit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 56190d787f5449c4ec04ca16f7b197bdc12da84403f91164d8afeccf7c2b7684
MD5 46b2239408fc81e70adeaf09c8d73fea
BLAKE2b-256 7ad485245a96827138bfd46ba0131149364252e4722fe5a86a9efd96b0aac203

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blankit-0.2.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 28f83846f25e333e005c081f64822ea63cf2362060ee737d1807d468a2597e13
MD5 b0df09c275316efc2d736dbb0afb0493
BLAKE2b-256 01dc011a528330537b70ece4c740e6e1629715f56c8663b7d26139c8db9c83ef

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