Skip to content

PyNon is a simple Python tool that uses Microsoft Presidio to anonymize text containing personally identifiable information (PII).

License

Notifications You must be signed in to change notification settings

samuelcotterall/pynon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyNon

PyNon is a simple Python tool that uses Microsoft Presidio to anonymize text containing personally identifiable information (PII).

Features

  • Detects and anonymizes PII in English text using Presidio Analyzer and Anonymizer
  • Command-line interface for quick anonymization

Requirements

  • Python 3.7+
  • presidio-analyzer
  • presidio-anonymizer
  • spaCy (with the en_core_web_lg model)

Installation

  1. Clone this repository:
    git clone https://github.com/samuelcotterall/pynon.git
    cd pynon
  2. (Recommended) Create and activate a virtual environment:
    python3 -m venv .venv
    source .venv/bin/activate
  3. Install dependencies:
    pip install -r requirements.txt
  4. Install the required spaCy model:
    python -m spacy download en_core_web_lg

Usage

As a script

python anon.py 'My name is John Doe and my phone number is 555-123-4567.'

As a CLI tool

You can use the provided CLI script:

./pynon 'My name is John Doe and my phone number is 555-123-4567.'

If you want to run pynon from anywhere, add it to your PATH or symlink it to a directory in your PATH.

Note: Always activate your virtual environment before running the tool to ensure all dependencies and models are available.

Troubleshooting

If you see an error about the spaCy model not being installed, run:

python -m spacy download en_core_web_lg

License

MIT

About

PyNon is a simple Python tool that uses Microsoft Presidio to anonymize text containing personally identifiable information (PII).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages