Skip to content
 
 

Repository files navigation

Random EPrint Generator

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.

Usage

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.

Commonly used Options

  • -n --records How many EPrints to generate
  • -c --creatorcount How many unique authors to generate for the run of EPrints.
  • -i --imagecount How many images per PDF
  • -p --pdfcount How many PDFs per EPrint
  • -f --tofile If 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

Source Material

About

Generate random EPrints. Replacement for Victor, but entirely standalone and much much faster.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages