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.1.tar.gz (14.7 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.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rv_pytools-1.2.1.tar.gz
  • Upload date:
  • Size: 14.7 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.1.tar.gz
Algorithm Hash digest
SHA256 cc55e5239de85383be49a092d8e6a8d4d98c710438114eca83db882361e2a66a
MD5 20ecf78b29401d0f8bd26e441dbc2e4f
BLAKE2b-256 0f198b83c96b5817954c31f60f2abde269afff97a76b4d31a25997bea7b3bd68

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rv_pytools-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 10.3 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8a20a9e2ec848f2b7e5a60ed2b8c4f60e56ec35317b25f3eae8dfa697800a18e
MD5 3384abbe8442bc0e7bf3ad02fc1e5518
BLAKE2b-256 3f6fa54162c27ac37b51cb9138fe38b4cb587c862016a68af97d2105d56f4fe6

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