Skip to main content

A package for general use in my programs

Project description

RV_PyTools

Some general use tools that are largely homebrewed with some Claude help.

SQLTools

A suite of tools that let you work with databases. You can setup connections, create databases, run ddls, or have stored queries that take parameters.

Functions

Anonymize / Deanonymize

Reversibly anonymize columns of a DataFrame and persist a reversal map to disk.

from rv_pytools import anonymize, deanonymize

columns = {"contact_email": "email", "billing_email": "email", "first_name": "name"}

anon = anonymize(df, columns, "map.json")          # tokenizes, saves reversal map
original = deanonymize(anon, columns, "map.json")  # restores from the map

columns maps each column name to a label. Values are grouped by label, so the same value appearing in differently named columns (e.g. an email used in two columns) is stored once and gets the same token. Neither function mutates the input DataFrame, and NaN/None cells are left untouched. The file_location argument defaults to anonymization_map.json.

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

rv_pytools-1.2.0.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

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

rv_pytools-1.2.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file rv_pytools-1.2.0.tar.gz.

File metadata

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

File hashes

Hashes for rv_pytools-1.2.0.tar.gz
Algorithm Hash digest
SHA256 e67d6289a86f99594c2f0c7020b4436c639ed37eb15f824fc695d84752b7f6e6
MD5 50f7caeec32e4bb6e1dfdfd47d573747
BLAKE2b-256 71addf3488beb7bc00230599fc88f690f68125006c8410c4fbbc8043723cc5ee

See more details on using hashes here.

File details

Details for the file rv_pytools-1.2.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for rv_pytools-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3d0b990c624ec37571bc114ce8a393d1392ac6fa8b59812ec7223faec3bdd29d
MD5 eb9b04f253cb01d39f8c6d4467c322ac
BLAKE2b-256 dd24e757bd4b2919125e68759e37f9657af401afa615aea2131e6b0029ed74ac

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