User Tools

Site Tools


advocacy:demonstration_data

demo patrons

http://open-ils.org/~phasefx/gen_fake_users.tar

This is a very simple (brain-dead, improvements welcome!) script for generating SQL statements to use with an Evergreen database for creating fake patrons, addresses, and library cards.

You have to modify the gen_fake_users.pl file and change the following variables to suit your installation:

###############################################
# examples
my @profiles = ( 2, 12, 13, 14 );
my @ident_types = ( 1, 3 );
my @home_ou = ( 4, 5, 6, 7, 8, 9 );

Use the query

select * from permission.grp_tree;

to see possible id values for @profiles.

Use the query

select * from config.identification_type;

to see possible id values for @ident_types.

Use the query

select aou.id, aou.shortname from actor.org_unit as aou, actor.org_unit_type as aout where aou.ou_type = aout.id and aout.can_have_users = 't';

to see possible id values for @home_ou.

This is how you use the script the with included data files:

./gen_fake_users.pl last_names.txt male_names.txt female_names.txt abbr_suffix.txt wordlist.txt zip5.csv

It is my belief that the data files I'm including are either not copyrightable (being a list of facts) or are in the public domain, at least in the United States. But I am not a lawyer. :)

The script itself I'm releasing under the GNU GPL, Version 2.

Demo Volume and Copy Data

Note: Inserting volume and copy data requires bibliographic records. If you have no bib records in your database, you can import records from a set of test records packaged with Evergreen. In your Evergreen source directory, the MARC files are found in the Open-ILS/tests/datasets/ directory. Log in to the staff client, navigate to Cataloging -> MARC Batch Import/Export. From here, you can upload the test records. Make sure you choose "Auto-Import Non-Colliding Records" when you upload so that it will import the records into the live data set. Upload as many as you like. You are now ready to create demo copies and call numbers.

This, too, is a very simple script for generating SQL statements. It's purpose is to create volume (asset.call_number) and copy (asset.copy) data for test purpose. The script is documented inline. Four settings are required.

'''
ID of the user who is creating the data
everdemo=# select id from actor.usr where usrname='admin';
'''
creator_user = 1

''' How many volumes do we want to create?  '''
num_volumes = 5000

''' How many copies do we want to create?  '''
num_copies = 5000

'''
List of orgs to use as volume owning_lib's and copy circ_lib's
evergreen=# select aou.id, aou.shortname from actor.org_unit as aou,
    actor.org_unit_type as aout where aou.ou_type = aout.id and aout.can_have_vols;
'''
org_ids = (4, 5, 6, 7, 8, 9)

Here it is: http://open-ils.org/~erickson/create_holdings.py

advocacy/demonstration_data.txt · Last modified: 2009/09/09 12:12 by erickson

© 2008-2017 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a member of Software Freedom Conservancy.