Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

A utility to generate random Icelanders

Project description

Icelander generator

Icelander generator is a tool made to generate a bunch of icelanders.


Icelander generator uses a list of male and female names scraped from and the kennitala pypi package ( to generate random people with proper icelandic names and kennitala. It can be very useful for testing purposes where a bunch of icelanders are required. Can also just be used for fun, I guess.


Inside your virtualenv run

$ pip install icelander-generator



from icelander_generator import Icelander

icelander = Icelander()

# Generate a random person
# Returns {
#   'ssn': '{random ssn}',
#   'gender': '{randomly selected gender},
#   'firstname': '{randomly selected first name based on gender}',
#   'lastname': '{randomly selected last name based on gender}',
# }

# Generate a woman born in 1981
icelander.get_random_person(gender='female', year=1981)
# Returns {
#   'ssn': '{random ssn from year 1981}',
#   'gender': 'female',
#   'firstname': '{randomly selected first name based on gender}',
#   'lastname': '{randomly selected last name based on gender}',
# }

# Return a list of randomly generated people of random age and gender

# Return a list of randomly generated women born in 1981
icelander.get_random_people(10, gender='female', year=1981)

# Dump result from get_random_people to a json file
icelander.dump_random_people_to_file(filename='dump.json', num_people=10, gender='female', year='1981')


from icelander_generator.address import Address

ad = Address()

# Get random address

# Get random address in Reykjavík

# Get random address in 101 PO code

# Get random address, but only up to street number 23

Future ideas

  • More gender options?
  • Middle names
  • Company generator

I'm also open for suggestions and pull requests on

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for icelander-generator, version 0.3.2
Filename, size File type Python version Upload date Hashes
Filename, size icelander_generator-0.3.2-py3-none-any.whl (88.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size icelander_generator-0.3.2.tar.gz (88.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page