Generating Random vCards

Again I found myself wanting a pile of realistic vCards to test with, and decided to write a decent and extendable solution for once (instead of the hilarity of this). A while ago I discovered Barnum, which can generate pseudo-realistic data by containing large data sets of names, street addresses, zip codes and credit card numbers. I extended it a little, adding support for creating an email address from a given name (it looks weird when the contact's name is John Smith but the email is john.doe@bar.com) and generating birth dates, then wrote a tiny script to write valid vCards. Et voilà:

$ ./gen_vcard.py 
BEGIN:VCARD
VERSION:3.0
UID:barnum-1107705517
FN:Caleb Barone
N:Barone;Caleb;;;
BDAY:1955-05-06
EMAIL;TYPE=WORK:cbarone@blanditvelit.eu
X-JABBER;TYPE=HOME:cbarone@eratdolore.eu
ADR;TYPE=HOME:;;8270 Kahlden Lane;Thompson;CT;06277;USA
END:VCARD

If this is useful to anyone else, you'll want Barnum, my patched gen_data.py, and gen_vcard.py.

NP: More Than Music, Murphin

15:00 Wednesday, 06 Jun 2007 [#] [computers] (2 comments)

Posted by Erich at Wed Jun 13 00:54:08 2007:
So you think it's more realistic when the address is in the USA, while both his 'home' and 'work' email/jabber addresses are @something.eu? :-)
You might have heard that hte US aren't part of the EU? :-)
Posted by Ross at Wed Jun 13 07:33:41 2007:
Yeah, the domains still are a bit dodgy, but imagine that the person has moved.  When testing software that handles people's IM fields, having the name and the UID match is important.

Name:


E-mail:


URL:


Add 4 and 4 (required):


Comment: