/data_anonymizer_app

Data Anonymizer App anonymizes CSV and Excel files with pseudonymization, redaction, and column removal via a Flask web app.

Primary LanguagePythonApache License 2.0Apache-2.0

Data Anonymizer App

License: Apache License 2.0 Forks Stars Issues GitHub contributors

Data Anonymizer App is a simple Flask-based web application that helps users anonymize sensitive data in CSV and Excel files. The app provides functionalities such as pseudonymization, redaction, and column removal to protect personal information.

Table of Contents

Features

  • Upload CSV and Excel files
  • Select different anonymization methods for each column:
    • Pseudonymization: Replace the original data with a unique, irreversible hash
    • Redaction: Replace the original data with a "REDACTED" string
    • Removal: Remove the entire column from the dataset
  • Download anonymized files in their original format (CSV or Excel)
  • Calculate reidentification risk score (placeholder implementation)

Installation

  1. Clone the repository:
git clone https://github.com/hipnologo/data_anonymizer_app.git
  1. Change to the project directory:
cd data_anonymizer_app
  1. Install the required dependencies using pip:
pip install -r requirements.txt
  1. Generate a secret key and create a .env file in the project directory by running the genkey.py script:
python genkey.py

This will create a .env file containing the SECRET_KEY variable with a randomly generated 32-byte hexadecimal value. Alternatively you can use:

echo "SECRET_KEY=your_secret_key_here" > .env
  1. Generate fake random data into a .csv file which will be placed under data folder for testing purposes.
python gendata.py

Bonus: create a .gitignore for the project.

curl -o .gitignore https://raw.githubusercontent.com/github/gitignore/main/Python.gitignore

Usage

  1. Start the Flask development server:
python app.py
  1. Open a web browser and navigate to http://127.0.0.1:5000.

  2. Upload a CSV or Excel file and choose the desired anonymization actions for each column.

  3. Download the anonymized file.

Contributing

Contributions are welcome! Please feel free to open issues or submit pull requests to help improve this project.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Buy Me A Coffee