Skip to main content

A Python library for anonymizing queries like SQL, DAX etc. or other text.

Project description

QueryAnonymizer

Description

queryanonymizer is a Python library designed to anonymize SQL, DAX or others languages queries. It allows safe sharing of queries for debugging, documentation, or educational purposes without the risk of exposing sensitive data. The library provides functions for both anonymizing and deanonymizing queries, with support for various SQL dialects and allows using also custom keywords.

Installation

To install queryanonymizer, run the following command:

pip install queryanonymizer

Usage

Import queryanonymizer in your Python project and use the provided functions to anonymize or deanonymize your queries/prompts.

from queryanonymizer import anonymize, deanonymize, keywords_list

query = """
SELECT order_id
    , customer_id
    , order_date
    , employee_id
    , customer_name
    , order_value
FROM order
WHERE order_date >= '2023-01-01'
    AND order_value >= 1000
"""

anonymized_query, decoder_dictionary, _ = anonymize(query)

# Example of deanonymizing a query
deanonymize(anonymized_query, decoder_dictionary)

More Examples

Visit QueryAnonymizer Documentation for more comprehensive examples and use cases.

Features

  • Anonymization of SQL, DAX and other types of queries: Replace sensitive data in your queries with randomized, case sensitive equivalents.
  • Support for Multiple SQL Dialects: Customize the anonymization process based on different SQL dialects including T-SQL, MySQL, and others.
  • Customization Options: Offers various customization options for the anonymization process, such as handling of string literals, numbers, dates, and more.
  • Decoding Dictionary: Generate a decoding dictionary that allows you to revert your anonymized queries back to their original form.
  • Advanced Anonymization: Tailor the anonymization process with numerous parameters.
  • File Support: Anonymize queries directly from and to files.
  • Reversible Process: Capabilities to both anonymize and deanonymize queries.
  • Customizable: Fine-tune settings to fit your specific requirements.
  • AI Integration: Unique features for integrating with AI tools like ChatGPT.

License

queryanonymizer is licensed under the MIT License. See the LICENSE file for more details.

Authors

queryanonymizer was created by DataTeam.pl (Mariusz & Mateusz Cieciura).

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

queryanonymizer-1.1.4.tar.gz (23.0 kB view details)

Uploaded Source

Built Distribution

queryanonymizer-1.1.4-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

Details for the file queryanonymizer-1.1.4.tar.gz.

File metadata

  • Download URL: queryanonymizer-1.1.4.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.1

File hashes

Hashes for queryanonymizer-1.1.4.tar.gz
Algorithm Hash digest
SHA256 b6411adf36f4f23da146512c28a5be95dcc05c6629d73bcf9bf8d0b80eab26f0
MD5 fda3d75811304b097618bf8e0b485ef0
BLAKE2b-256 70e6986707dbdaffb0e0e54afc19496935cd336857fdca3ab3c1b861dfa3f58c

See more details on using hashes here.

File details

Details for the file queryanonymizer-1.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for queryanonymizer-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9060bb03c4aff0ba2c1109c55d3dac4d9900c3b4c655a80929d6c4a38d88a555
MD5 5d51cef688fd402e5dabb871d6283d06
BLAKE2b-256 e95166baab9c0feda931bdf8f52b9f94ec8d49404fb60c0bf0ff36a5635a8ccc

See more details on using hashes here.

Supported by

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