Takes in text from provided text file, uses a markov chain to generate text. Selects a random image from images/ and produces a PDF file.
Will spit out XML which can be imported into EPrints to fill a test repository with dummy data.
This is intended as a much faster replacement for Victor.xml, with support for EPrints 3.5. I had the various parts lying around and this puts them all together.
Needs python with fpdf2 installed. This is best managed in a virtual environment:
python -m venv venv
source ./venv/bin/activate
pip install -r requirements.txt
python random_eprints.py -f out.xml
/opt/eprints3/bin/import [ARCHIVEID] --user=[ADMINUSERNAME] archive XML out.xml
By default it assumes it's running on the same box as an EPrints install. If it isn't you'll need to provide a subjects file with -s /path/to/subjects.
-n --recordsHow many EPrints to generate-c --creatorcountHow many unique authors to generate for the run of EPrints.-i --imagecountHow many images per PDF-p --pdfcountHow many PDFs per EPrint-f --tofileIf provided, output XML to a file rather than stdout-v --eprintsversion(default 3.5) which version of EPrints to generate XML for. 3.4 or 3.5. Uses for 3.4 and for 3.5
Generate and import 100 EPrints:
python random_eprints.py -n 100 -c 50 -f out.xml -v 3.4
/opt/eprints3/bin/import ARCHIVE_ID --user=admin archive XML out.xml
- themodernclock.txt - The Modern Clock by Ward L. Goodrich: https://www.gutenberg.org/ebooks/61494
- 20thousandleagues.txt - Twenty Thousand Leagues under the Sea by Jules Verne: https://www.gutenberg.org/ebooks/164
- howitworks.txt - How it Works by Archibald Williams https://www.gutenberg.org/ebooks/28553