Skip to main content

CLI tool to responsibly share datasets by gzipping, canarying, and tracking provenance.

Project description

Easy Dataset Share

A Python package and CLI tool to help you responsibly share datasets by gzipping files (such as .jsonl, .csv, etc.) in your repository and restoring them as needed.

Installation

Install directly from GitHub:

pip install git+https://github.com/Responsible-Dataset-Sharing/easy-dataset-share.git

Or, if you have cloned the repo locally:

pip install -e .

The dependency management is handled through poetry (https://python-poetry.org/).

Quick start

To protect your dataset from nosy LLMs!: easy-dataset-share magic-protect-dir <path to data directory> -p <password for encryption> To remove the protections from the dataset: easy-dataset-share magic-unprotect-dir <path to data directory> -p <password for encryption>

Usage

You can call the CLI directly with python easy_dataset_share/cli.py or, if you already ran pip install -e ., it should put this command on your path and you can call easy-dataset-share.

easy-dataset-share is a CLI tool which has several subcommands, which you can explore using:

easy-dataset-share --help

Example output:

Commands:
  add-canary           Add canary files to a dataset for LLM training...
  add-robots           Generate and save a robots.txt file to prevent LLM...
  get-canary-string    Get the canary string for a directory.
  magic-protect-dir    Zip a directory and password protect it in one step.
  magic-unprotect-dir  Decrypt and extract a protected directory in one...
  remove-canary        Remove canary files from a dataset.

The workflow of the general tools is simple: 0. Add a robots.txt so that good actors don't train on this data!

  1. add canaries to the data so that if people were training on it, we could tell! We add canaries in 2 ways; 1- adding canary files, and 2- adding canaries to the data itself
  2. zip the data, so that the text (or whatever the data is) is not in plaintext! (This also makes hosting the data easier as it is now smaller)
  3. password protect the zips, so that agents can't trivially unzip the data

The main command is magic-protect-dir and magic-unprotect-dir, which runs all 3 of these commands either forwards, or in reverse.

Todos:

  1. better documentation
  2. Failure mode - one failure mode is that the canary string is not the same as the one that was used to protect the directory in this case, the canary files will not be removed - some checking here needs to be done.
  3. tests to make sure you don't add canaries to a file twice, or not-remove data from the file.
  4. the same try/excepts that exist for .json files should exist for .jsonl files. Add a dummy jsonl dataset that has a malformed line to make sure those edge cases are covered.

Contributing

To set up git hooks properly, please run git config core.hooksPath .githooks (once). This will enable hooks such as running yapf on all python files

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

easy_dataset_share-0.1.0.tar.gz (432.5 kB view details)

Uploaded Source

Built Distribution

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

easy_dataset_share-0.1.0-py3-none-any.whl (451.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: easy_dataset_share-0.1.0.tar.gz
  • Upload date:
  • Size: 432.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for easy_dataset_share-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0af13c812bcead60bd556c56266ddbb4086c42e2b71686a1d797489f0bc382ed
MD5 d1f21d41711526e37fdbc7c81025bbb6
BLAKE2b-256 0712d51b6ce21141f6f6effe17ee6c867c79164d3ef87ab8af2a7f3606223c14

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for easy_dataset_share-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0e2c7c6c7ad66bcc4d36aa1bfb42b7444b22a514690de86ba506da31e5ba2c1
MD5 ec09210e9d100b6a3d20598cefffea13
BLAKE2b-256 d18074419a070ba18aa3553faaccd2b5de979f33d0efdc09694c6c0b69663d43

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