2024-08-11 23:13:33 -07:00
|
|
|
# dimocracy-voucher
|
|
|
|
|
|
|
|
Automation tools for running dimocracy
|
|
|
|
|
|
|
|
## Getting started
|
|
|
|
|
|
|
|
### Requirements
|
|
|
|
|
|
|
|
- [Python](https://python.org/) > 3.11
|
|
|
|
- [Poetry](https://python-poetry.org/)
|
|
|
|
|
|
|
|
### Installation
|
|
|
|
|
|
|
|
```sh
|
|
|
|
cd dimocracy-voucher
|
|
|
|
poetry install
|
|
|
|
poetry shell
|
|
|
|
python ./anonymize_entries.py path/to/folder
|
|
|
|
```
|
|
|
|
|
|
|
|
### Help contents
|
|
|
|
|
|
|
|
```
|
2024-08-12 17:01:30 -07:00
|
|
|
usage: anonymize_entries.py [-h] [-c CSV] [-f FILE_UPLOADS] [-o OUTPUT] [-d | --dry-run | --no-dry-run] [-D | --deanonymized | --no-deanonymized] [-e EMAILS]
|
2024-08-11 23:13:33 -07:00
|
|
|
[-r | --regenerate | --no-regenerate] [-s SEED]
|
2024-08-12 17:01:30 -07:00
|
|
|
data_dir
|
2024-08-11 23:13:33 -07:00
|
|
|
|
|
|
|
positional arguments:
|
2024-08-12 17:01:30 -07:00
|
|
|
data_dir working directory - used to find the form responses CSV, file responses directory, and for output
|
2024-08-11 23:13:33 -07:00
|
|
|
|
|
|
|
options:
|
|
|
|
-h, --help show this help message and exit
|
2024-08-12 17:01:30 -07:00
|
|
|
-c CSV, --csv CSV override CSV form responses path (defaults to first file matching {data_dir}/*.csv)
|
2024-08-11 23:13:33 -07:00
|
|
|
-f FILE_UPLOADS, --file-uploads FILE_UPLOADS
|
2024-08-12 17:01:30 -07:00
|
|
|
override file responses directory path (defaults to first subdirectory matching {data_dir}/*/*.zip)
|
|
|
|
-o OUTPUT, --output OUTPUT
|
|
|
|
override output path (defaults to {data_dir}/output)
|
2024-08-11 23:13:33 -07:00
|
|
|
-d, --dry-run, --no-dry-run
|
|
|
|
do not create or modify any files
|
|
|
|
-D, --deanonymized, --no-deanonymized
|
|
|
|
skip anonymization of files, simply package them as-is
|
|
|
|
-e EMAILS, --emails EMAILS
|
|
|
|
limit output to files from the specified emails (comma-separated)
|
|
|
|
-r, --regenerate, --no-regenerate
|
|
|
|
force-update generated CSV columns
|
|
|
|
-s SEED, --seed SEED specify random seed for alias generation (treat this like a password & change it for each round)
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
path/to/folder:
|
|
|
|
├ form_responses.csv
|
|
|
|
└ file_responses/
|
|
|
|
├ Upload A - User 1.zip
|
|
|
|
├ Upload B - User 2.zip
|
|
|
|
└ etc.
|
|
|
|
|
|
|
|
python ./anonymize_entries.py path/to/folder
|
|
|
|
|
|
|
|
OR
|
|
|
|
|
|
|
|
python ./anonymize_entries.py -c path/to/folder/form_responses.csv -f path/to/folder/file_responses
|
|
|
|
```
|