Skip to main content

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).

Metadata

Release files for queryanonymizer 1.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for queryanonymizer 1.1.4
File Size Uploaded
queryanonymizer-1.1.4.tar.gz 23.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for queryanonymizer 1.1.4
File Interpreter ABI Platform
queryanonymizer-1.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 44.2 kB

Release files / queryanonymizer-1.1.4.tar.gz

Download URL queryanonymizer-1.1.4.tar.gz
Size 23.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b6411adf36f4f23da146512c28a5be95dcc05c6629d73bcf9bf8d0b80eab26f0
BLAKE2b-256 checksum
How to use checksums
70e6986707dbdaffb0e0e54afc19496935cd336857fdca3ab3c1b861dfa3f58c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.1

Release files / queryanonymizer-1.1.4-py3-none-any.whl

Download URL queryanonymizer-1.1.4-py3-none-any.whl
Size 21.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9060bb03c4aff0ba2c1109c55d3dac4d9900c3b4c655a80929d6c4a38d88a555
BLAKE2b-256 checksum
How to use checksums
e95166baab9c0feda931bdf8f52b9f94ec8d49404fb60c0bf0ff36a5635a8ccc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.1

Release history Release notifications | RSS feed

This release

1.1.4 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page