From 33f895f0488d494b71e65cead5917aa3bfa640fa Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 22 Jul 2021 09:00:39 +0000 Subject: [PATCH] #238: Update README with info about generator script --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5c77a581..96bc76d6 100644 --- a/README.md +++ b/README.md @@ -764,11 +764,13 @@ Within the repository, there are some useful files which can help with using the ## Database Generator There is a tool to generate mock data into ICAT's database. It is located in `util/icat_db_generator.py`. By default it will generate 20 years worth of data (approx -70,000 entities). The script makes use of `random` and `Faker` and is seeded with a seed -of 1. The seed and number of years of data generated can be changed by using the arg -flags `-s` or `--seed` for the seed, and `-y` or `--years` for the number of years. For -example: `python -m util.icat_db_generator -s 4 -y 10` Would set the seed to 4 and -generate 10 years of data. +70,000 entities). The default arguments will match the data on SciGateway Preprod and +therefore this is usually a good starting point. The script makes use of `random` and +`Faker` and is seeded with a seed of 1. The seed and number of years of data generated +can be changed by using the arg flags `-s` or `--seed` for the seed, and `-y` or +`--years` for the number of years. For example: +`python -m util.icat_db_generator -s 4 -y 10` Would set the seed to 4 and generate 10 +years of data. This uses code from the API's Database Backend, so a suitable `db_url` should be configured in `config.json`.