Dave Rolsky > Data-Random-Contact > Data::Random::Contact

Download:
Data-Random-Contact-0.05.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Module Version: 0.05   Source  

NAME ^

Data::Random::Contact - Generate random contact data

VERSION ^

version 0.05

SYNOPSIS ^

    use Data::Random::Contact;

    my $randomizer = Data::Random::Contact->new();

    my $person       = $rand->person();
    my $household    = $rand->household();
    my $organization = $rand->organization();

DESCRIPTION ^

This module is still alpha, and the API may change in future releases.

This module generates random data for contacts. This is useful if you're working an application that manages this sort of data.

It generates three types of contacts, people, households, and organizations.

LICENSING ^

The data that this module uses comes from several sources. Names are based on data from Fake Name Generator (http://www.fakenamegenerator.com). This data is dual-licensed under GPLv3 or CC BY-SA 3.0 (United Stated). See http://www.fakenamegenerator.com/license.php for licensing details.

The address data is all real addresses from the VegGuide.org website (http://vegguide.org). This data is licensed under the CC BY-NC-SA 3.0 (United Stated) license.

All other data is generated algorithmically.

Whether a license can apply to things like addresses and names is debatable, but I am not a lawyer.

METHODS ^

This module provides just a few public methods:

Data::Random::Contact->new()

This constructs a new object. It accepts two optional parameters:

$randomizer->person()

This returns a random set of data for a single person.

See "RETURNED DATA" for details.

$randomizer->household()

This returns a random set of data for a single household.

See "RETURNED DATA" for details.

$randomizer->organization()

This returns a random set of data for a single organization.

See "RETURNED DATA" for details.

RETURNED DATA ^

Each of the methods that return contact data returns a complicated hashref-based data structure.

Shared Data

Some of the data is shared across all contact types:

All contact types return email, phone, and address data. This data is available under the appropriate key ("email", "phone", or "address") in the top-level data structure.

Under that key the data is further broken down by type, which will be something like "home", "work", "office", etc. Every contact will have all the valid keys set. In other words, a person will always have both a home and work email address.

The email data will always be at one of these domains: pookmail.com, trashymail.com, dodgit.com, mailinator.com, or spambob.com.

The phone number will be a string containing all the phone number data.

Each address is further broken down as a hashref data structure.

See the appropriate language module for details on phone numbers and addresses.

Here's an example of the shared data for a person (using US data):

    {
        address => {
            home => {
                city        => "Reno",
                postal_code => 89503,
                region      => "Nevada",
                region_abbr => "NV",
                street_1    => "501 W. 1st St.",
                street_2    => undef
            },
            work => {
                city        => "Minneapolis",
                postal_code => 55406,
                region      => "Minnesota",
                region_abbr => "MN",
                street_1    => "2823 E. Franklin Avenue",
                street_2    => undef
            }
        },
        email => {
            home => "charlotte.t.dolan\@pookmail.com",
            work => "charlotte0\@dodgit.com"
        },
        phone => {
            home   => "508-383-7535",
            mobile => "775-371-7227",
            work   => "602-995-6077"
        },
    }

Person Data

Since much of this data is language-specific, you should see the appropriate language module for details. Some keys may be undefined, depending on the language.

The data for a person includes:

Household Data

The data for a person includes:

Organization Data

The data for a person includes:

Data Dumps

Here are complete data dumps for each contact type:

AUTHOR ^

Dave Rolsky <autarch@urth.org>

COPYRIGHT AND LICENSE ^

This software is Copyright (c) 2011 by Dave Rolsky.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)
syntax highlighting: