Skip to main content

A simple tool to mask sensitive columns in .csv and .dat files.

Project description

Maskify

maskify is a Python module designed to efficiently mask sensitive columns in large CSV / DAT files using character-level substitution. It leverages Polars for high-performance data manipulation and provides a memory-efficient way to process large files in chunks.

🚀 Features

  • Process large CSV / DAT files in chunks without consuming excessive memory.
  • Mask specified columns by substituting lowercase letters, uppercase letters, and digits with customizable cipher mappings.
  • Skip masking for NULL, "NA" (case-insensitive), or empty values.
  • Simple API for flexible integration into data pipelines.

✅ Installation

Install maskify from PyPI:

pip install maskify

🛠️ Usage

1️⃣ Generate Cipher Maps

Use create_cipher_maps_letters_digits() to generate random mappings for lowercase letters, uppercase letters, and digits.

from maskify import create_cipher_maps_letters_digits

cipher_maps = create_cipher_maps_letters_digits()
letters_lower_map, letters_upper_map, digits_map = cipher_maps

2️⃣ Process and Mask Data

Use process_maskify() to mask specified columns in a CSV / DAT file and save the masked output.

from maskify import process_maskify

output_file = process_maskify(
    input_file='data/input.csv',
    separator=',',
    columns_to_mask=['name', 'id'],
    enCipher=(letters_lower_map, letters_upper_map, digits_map),
    output_file='data/output_masked.csv'
)

print(f"Masked file saved at: {output_file}")

⚠️ License

Copyright 2025 Vikas Bhaskar Vooradi

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


💖 Support This Project!

Maskify is completely free for everyone! 🎉
If you find it useful and want to support its development, you can buy me a coffee ☕.
Your contributions help keep the project updated and maintained.

Click the link below to contribute:

Buy Me a Coffee

Thank you for supporting open-source! 🎉
Every coffee helps keep the project alive and growing!
Built with ❤️ using Python and Polars

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

maskify-0.1.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

maskify-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file maskify-0.1.0.tar.gz.

File metadata

  • Download URL: maskify-0.1.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for maskify-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7d2dff2059a0b6adeb6cc4c0d996784f3da0377aeaa2cca5a0ee8539d94f753a
MD5 263509da64dee6421bc2ed3b55d44775
BLAKE2b-256 9ac8e2c7a2c950e5c4feee37847d8e03e73f8cdd61f349fb35b25a1a97cceca8

See more details on using hashes here.

File details

Details for the file maskify-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: maskify-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for maskify-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e38f9eee7b55f746d0f333afec7c8f3c795e007057e19fe78811c3baab5f6403
MD5 3054a8c759c305767684774cf59aebd5
BLAKE2b-256 02a6cf556c184c5fad3e994f94f48d0d3d81435bc186302ac1c785fd4a1f52ee

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