NAME
Mock::Populate - Handy mock data creation
VERSION
version 0.01_01
SYNOPSIS
> perl Date-Ranger 1900-01-01 2020-12-31 1000 > dates.dat
> perl Time-Ranger '01:02:03' '23:59:59' 1000 > times.dat
> perl Number-Ranger 1000 5000 2 1000 > nums.dat
> perl Personify b 2 1000 > people.dat
> perl Stats-Distrib n 3 1000 > stats.dat
> perl Collate dates.dat times.dat nums.dat people.dat stats.dat > mock.dat
DESCRIPTION
This is a set of modules and scripts handy for mock data creation.
See the documentation (and source) of each script for arguments and usage.
NAME
Mock::Populate - Handy mock data creation
FUNCTIONS
date_ranger()
@results = date_ranger($start, $end, $n);
Return a list of $n random dates within a range. The start and end dates and desired number of data-points arguments are all optional. The defaults are:
start: 2000-01-01
end: today (computed if not given)
n: 10
The dates must be given as YYYY-MM-DD strings.
time_ranger()
@results = time_ranger($stamp, $start, $end, $n);
Return a list of $n random times within a range. The start and end times and desired number of data-points arguments are all optional. The defaults are:
stamp: 1 (boolean)
start: 00-00-00
end: now (computed if not given)
n: 10
The times must be given as HH-MM-SS strings.
number_ranger()
@results = number_ranger($start, $end, $prec, $random, $n)
Return a list of $n random numbers within a range. The start, end, precision, whether we want random or sequential numbers and desired number of data-points arguments are all optional. The defaults are:
start: 0
end: 9
precision: 2
random: 0
n: 10
personify()
@results = personify($gender, $names, $country, $n)
Return a list of $n random names. The gender, number of names and desired number of data-points arguments are all optional. The defaults are:
gender: both
names: 2
country: us
n: 10
stats_distrib()
@results = stats_distrib($type, $prec, $dof, $n)
Return a list of $n distribution values. The type, precision, degrees-of-freedom and desired number of data-points arguments are optional. The defaults are:
type: u (normal)
precision: 2
degrees-of-freedom: 2
n: 10
TYPES
This function uses single letter identifiers:
u: Normal distribution (default)
c: Chi-squared distribution
s: Student's T distribution
f: F distribution
DEGREES OF FREEDOM
Given the type, this function accepts the following:
c: A single integer
s: A single integer
f: A fraction string of the form 'N/D' (default 2/1)
collate()
This function is not yet implemented.
SEE ALSO
AUTHOR
Gene Boggs <gene@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Gene Boggs.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.