Skip to content

Family class API

39xdgy edited this page Sep 25, 2020 · 4 revisions

Variable

  • id: str
  • _name: str
  • _gender: str
  • _birthDate: tuple
  • _deathDate: tuple
  • _familyList: list
  • _parentFamily: Family

Function

init(self, id: str, husband = None, wife = None, married: str = None, divorced: str = None, children_list: list = []):

This is the class for Family.
id is the only variable that is required. If other variable does not exist, it would return None
type of husband and wife would be in Individual
type of each element in children_list is Individual
If children does not exist, it would return an empty list

all date value are passed in as str, and saved as tuple with formate (year, month, day)

all get and set would not display here.

add_children(self, child) -> None

This function would add one kid into the children list

change_date_formate(self, str_input_date: str) -> tuple

this function Would take the string input and covert into a int tuple:(year, month, day)