0

I have used prettytable to print my data that looks like this:data retrieved from GEDCOM file

I have stored it in the form of dictionary where each key is husbandID and values are children ID's and same with wifeID.

I want to draw out a family tree like structure. I do not know how to do it. If anyone can help me how to do it taking a small family as example it will really be useful. Also, I was wondering if dictionary is the right data structure to be used. Thanks!

ms1941
  • 35
  • 6
  • Depends, I tend to like my family tree as `print(json.dumps(family_tree, indent=4, sort_keys=True))`. Assuming each level is a sub-hirarchy of the parents etc. If you're looking to do it as in the picture, it's a matter of iterating over the keys and printing them accordingly. Doubt there's a lib for this. – Torxed Nov 17 '18 at 21:34
  • 2
    Can you give an example of some of your code? What have you tried? – Green Cloak Guy Nov 17 '18 at 21:34
  • Depends how you want to draw them. You can for example use the `Phylo.draw_ascii(tree)` as explained here https://biopython-cn.readthedocs.io/zh_CN/latest/en/chr13.html . This function/package is used by bioinformaticians normally in order to visualize the phylogeny between individuals / species. – quant Nov 17 '18 at 21:36
  • You can check out graphviz. Using it in python [is described here](https://stackoverflow.com/questions/7020741/drawing-rendering-multiway-tree-in-python). Not ASCII, but not sure if that's a requirement for you – augray Nov 17 '18 at 21:47

0 Answers0