My Family Tree Project

On the 12th March my first grandchild was born. He doesn’t have my family name but I was delighted to hear his middle name is Mylles – a popular name on my father’s side of the family. It is my father’s first name, my grandfather’s first name and my middle name.

I decided that now was a good time to gather all the information about my family history so my grandson, and my daughters can know as much as possible about their ancestors, and in particular the names used in my family.

I am sure you are familiar with diagrams like the one above showing grandparents, uncles, aunts, cousins and so on. It is easy to draw a chart for your immediate family but it gets complicated as more generations are added, and families joined through marriage.

I have a professional background in software development, database design, and coding. I’m also very interested in visualising information. I did a quick Google search on “Family tree software” but decided to make my own system. There were several reasons for this decision. First of all I don’t want to spend time learning a new program, especially if it doesn’t have all the functionality I want. What happens to all the data I enter? Can it be exported to another program? Making my own system allows me to think about the challenges of storing and viewing genealogical data.

Where did I get my information? I started with the knowledge I already have, then added information from family trees I drew years ago after questioning my mother and a few other family members. My father drew a chart of part of his family back in the 1960s, and there are charts published in another family history book. I hope my system can find all the missing links.

My System Design

Family tree diagrams can look complicated and making a good diagram is very challenging. I took the approach of first thinking about the data and the relationships, then worry about visualising the relationships later.

There are only two tables required:

  1. People. Each person has a unique number (ID). I gave myself the number 1! These are the fields (the information) about each person : Family Name, First Name, Middle Name, Nick Name (“also known as”), Sex (M/F), Year Born, Date of Birth (I don’t always have this information, but year of birth is usually known, Mother ID ,Father ID, Country of Birth, Place of Birth, Year Died.
  2. Marriages. Each entry in this table has the ID of the man and woman, year married, notes and year divorced. A person may be married more than once so this table supports this.

It is not necessary to store the links to parents, children or siblings as these can be found by making queries on the People table. For example, to find my children is just a matter of searching the People table where the FatherID is equal to my ID (two records found!).

I decided not to use a database such as MySQL, but use plain text files with comma separated fields (CSV files). This allowed me to focus on the program functionality and getting it operational quickly.

The program

Software development is an iterative approach of designing something simple – the minimum requirements, coding, testing then adding to the design. I wrote a command driven program (Just like the DOS prompt or Unix shell) to search, find and update information. Commands are usually a single letter, or a pair of letters. Here is the current functionality:

Command > H
F <string> - search people in first, middle and family names 
I <num> - make current person 
P - print name of current person 
N - create a new record and paste into clipboard 
P P - print parents 
P C - print children 
P D - print descendants
P A - print ancestors
P M - print spouse/partner 
P R - print the full record - (used for software testing)
P S - print siblings 
R - reload databases
U - update current person
Q - quit

The program operates on a selected person.

First you find a person (F command) then make them the current person to explore or update (the I command).

Relationships between people are shown with the set of P commands.

Adding new people (N command) or updating the current person (U command) writes a new line into the clipboard which I paste into the file with the Notepad++ program.

My system is really a combination of the text editor and my Family Tree “shell”

Here is an example of the program adding a new record. I created two families to make test data to use in this article.

Command > N
ID> 512     <-- I already knew that 511 was the highest number in use so far
FamilyName> Richards
FirstName> Fred
MiddleName> 
NickName> 
Sex> M
YearBorn> 2021
DOB> 
MotherID> 510
FatherID> 505
CountryBirth> 
PlaceBirth> 
YearDied> 
New record has been copied to clipboard

Here is an extract of a command session. I added comments with the <— symbol.

Command > F andrew         <--- search for Andrew
[505] Andrew Richards (M)  1987

Command > I 505          <--- make him the active record
Andrew Richards (M)  1987  [505]    <--- ids are shown in square brackets

Command > P P     <--- print parents
Mother Alice Jean Davey (F)  1962  [503]
Father John George Richards (M)  1960 (14/2/1960)  [502]

Command > P M    <--- print marriage details (spouse)
Susan Brown (F)  1989  [510] Married: 2018

Command > P S    <--- print siblings
Jane Richards (F)  1985  [504]
Stephen Richards (M)  1990  [506]

Command > P C   <-- print children
Fred Richards (M)  2021  [512]

Command > P    <--- print current record 
Andrew Richards (M)  1987  [505]

Part of the People table (text file):

...... previous lines not shown........
500,Richards,,George,,,M,1936,,,,,,,
501,Jones,,Elizabeth,Susan,,F,1937,,,,,,,
502,Richards,,John,George,,M,1960,14/2/1960,501,500,,,,
503,Davey,,Alice,Jean,,F,1962,,,,,,,
504,Richards,,Jane,,,F,1985,,503,502,,,,
505,Richards,,Andrew,,,M,1987,,503,502,,,,
506,Richards,,Stephen,,,M,1990,,503,502,,,,
507,Brown,,Simon,,,M,,,,,,,,
508,Grant,,Hannah,,,F,,,,,,,,
509,Brown,,Brian,,,M,1986,,508,507,,,,
510,Brown,,Susan,,,F,1989,,508,507,,,,
511,Brown,,Alison,,,F,1994,,508,507,,,,
512,Richards,,Fred,,,M,2021,,510,505,,,,

Part of the Marriage table (text file):

500,501,1958,George and Elizabeth
502,503,1982,John and Alice
507,508,1963,Simon and Hannah
505,510,2018,Andrew and Susan

Visualising the Family Relationships

My next challenge is to develop ways to visualise the family tree. Now that I have the data, I wrote code to print all the descendants of a person. The logic of this code is to do the following:

  • Print the name of the person
  • Print the name of the spouse
  • Find all the children
  • Print the descendants for each of the children indented from the parents’ names. This is a computing technique called ‘recursion’ where the function (program logic) calls itself.

Each generation is indented with a tab character so the output can be opened in Excel for pretty formatting and adding coloured lines to show siblings.

Here is a demonstration using some test data. I have one family of three generations, and another family with two generations

The spouse information is indented then the children are indented another level. This output can be made more appealing by opening with Excel and adding lines and colours.

Visualising the Ancestors

This is the opposite process of printing descendants. The program logic is to print the name of the father and mother of the person, then run the same ancestor code for the parents. This process continues until no more parents are found.

Here is the ancestry of Fred Richards, born to Andrew and Susan.

The next stage of my project is to draw visually appealing charts like the ancestry chart below. But my first priority is to gather the information and check with other family members.

How much do you know about your family history?

More information on the Wikipedia page for Family Tree

2 responses to “My Family Tree Project”

  1. Congratulations Charles! What a wonderful development for 2023! What is his first name?

  2. Looks great. Always a good idea to get this data passed down the line to family members. They may not appreciate it now, but they will when they reach our age(s).

Leave a comment