People Data Generator

sample_data_utils.people.first_name(languages=None, genders=None)[source]

return a random first name :return:

>>> from mock import patch
>>> with patch('%s._get_firstnamess' % __name__, lambda *args: ['aaa']):
...     first_name()
'Aaa'
sample_data_utils.people.fullname()[source]
sample_data_utils.people.gender()[source]

randomly returns ‘m’ or ‘f’

sample_data_utils.people.last_name(languages=None)[source]

return a random last name

>>> from mock import patch
>>> with patch('%s._get_lastnames' % __name__, lambda *args: ['aaa']):
...     last_name()
'Aaa'
>>> with patch('%s.get_lastnames' % __name__, lambda lang: ['%s_lastname'% lang]):
...     last_name(['it'])
'It_Lastname'
sample_data_utils.people.name()[source]
sample_data_utils.people.person(languages=None, genders=None)[source]

returns a random tuple representing person information

>>> d.person()
(u'Derren', u'Powell', 'm')
>>> d.person(genders=['f'])
(u'Marge', u'Rodriguez', u'Mrs.', 'f')
>>> d.person(['es'],['m'])
(u'Jacinto', u'Delgado', u'El Sr.', 'm')
Parameters:
  • language
  • genders
sample_data_utils.people.title(languages=None, genders=None)[source]

returns a random title

>>> d.title()
u'Mrs.'
>>> d.title(['es'])
u'El Sr.'
>>> d.title(None, [GENDER_FEMALE])
u'Mrs.'
Parameters:
  • languages – list of allowed languages. [‘en’] if None
  • genders – list of allowed genders. (GENDER_FEMALE, GENDER_MALE) if None
Read the Docs v: latest
Versions
latest
Downloads
PDF
HTML
Epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.