feat: rewrite pseudonyme generator in rust

This commit is contained in:
2025-04-05 11:49:54 +02:00
parent 722e1da854
commit ba04745609
11 changed files with 64960 additions and 54 deletions

View File

@@ -2,21 +2,27 @@
Generate funny random pseudonyms composed of an adjective, a noun and a number between 1 and 999.
## Usage
## Download data
You can either use python to directly run the script like this :
To download the data files, you can either use python to directly run the script like this :
```bash
python pyrpg.py $NUMBER_OF_PSEUDONYMS
python download_data.py
```
Or you can use the provided Dockerfile to build a docker image and run it like this :
```bash
docker build -t pyrpg .
docker run --volume $(pwd)/out:/app/out --env NUMBER_OF_PSEUDONYMS=$NUMBER_OF_PSEUDONYMS pyrpg
docker build -t download_data .
docker run --volume $(pwd)/data:/app/data download_data
```
# Generate pseudonyms
To generate pseudonyms, just run the rust program with cargo :
```bash
cargo run $NUMBER_OF_PSEUDONYMS
```
If you don't provide a number of pseudonyms, the script will generate 100 by default.
Pseudonyms are written to a file named `pseudonyms.txt` in the '/app/out' volume so you can retrieve them easily.