People in the US
A hundred people in one table, with places that belong together and social security numbers nobody can have.
en-US 1 table 100 rows CSV
First names follow the gender column. The state and the ZIP code follow the city and come from the same postal register, so a city, its state and its ZIP code belong together. Every social security number is in area 666, which is never issued, so a test cannot touch a real person’s number.
Change count for more rows and seed for other people. Remove a column you do not need, or add one from the generators.
The recipe
# A hundred people in the United States, in one table.
#
# Each row has a name, a gender, a birth date, a social security number, a city,
# its state and a ZIP code. First names follow the gender, and the state and the
# ZIP code follow the city. Every social security number is in area 666, which
# is never issued.
#
# qadg generate people-us.yaml
#
# writes person.csv and run-note.json. The same seed gives the same rows on
# every machine.
version: "0.1"
seed: "people-us"
locale: en-US
entities:
person:
count: 100
primary_key: [ssn]
fields:
first_name: { generator: first_name }
last_name: { generator: last_name }
gender: { generator: gender }
birth_date: { generator: birth_date }
ssn: { generator: ssn, unique: true }
city: { generator: city }
state: { generator: region }
zip: { generator: postal_code }
consistency:
- first_name matches: [gender]
output:
format: csv
Run it
Save the recipe, then run this in the same folder. This is what the program printed for it.
$ qadg generate people-us.yaml person: 100 rows, 8 columns person: state follows city, though no rule says so person: zip follows city and state, though no rule says so 1 table, 100 rows written
What it writes
person.csv
The first 5 of its 100 rows.
| first_name | last_name | gender | birth_date | ssn | city | state | zip |
|---|---|---|---|---|---|---|---|
| Isabella | Hill | female | 1937-04-01 | 666-97-2936 | Haskins | OH | 43525 |
| David | Osborn | male | 1940-05-06 | 666-20-1309 | St. Francis | AR | 72464 |
| John | Hanson | male | 1965-04-09 | 666-01-5721 | Argonia | KS | 67004 |
| Javier | Santos | male | 1958-02-25 | 666-64-3250 | Elizabeth | NJ | 07206 |
| Kirk | Bean | male | 2000-04-05 | 666-31-2967 | Wolcott | NY | 14590 |
run-note.json
The seed, the locale and the versions behind the run, and every table it wrote with its rows and columns.