Untitled
Anonymous
plain_text
04/09/2026 5:47 PM
4.0 KB
10
Indexable
from graphviz import Digraph
# Create a new directed graph
g = Digraph('Greek_Gods_Family_Tree', format='png')
g.attr(rankdir='TB', size='10')
# ----------------------------
# Primordial Deities
# ----------------------------
g.node('Chaos', 'Chaos (Void)')
g.node('Gaia', 'Gaia (Earth)')
g.node('Uranus', 'Uranus (Sky)')
g.node('Nyx', 'Nyx (Night)')
g.node('Erebus', 'Erebus (Darkness)')
g.node('Tartarus', 'Tartarus (Abyss)')
g.node('Aether', 'Aether (Light)')
g.node('Hemera', 'Hemera (Day)')
g.node('Pontus', 'Pontus (Sea)')
# Chaos offspring
g.edge('Chaos', 'Nyx')
g.edge('Chaos', 'Erebus')
g.edge('Chaos', 'Aether')
g.edge('Chaos', 'Hemera')
# Gaia + Uranus
g.edge('Gaia', 'Uranus', label='mated')
g.node('Titans', 'Titans')
g.edge('Gaia', 'Titans')
g.edge('Uranus', 'Titans')
# ----------------------------
# Titans and major children
# ----------------------------
titans = {
'Cronus': 'Cronus (Time)',
'Rhea': 'Rhea (Motherhood)',
'Oceanus': 'Oceanus (World Ocean)',
'Tethys': 'Tethys (Rivers)',
'Hyperion': 'Hyperion (Light)',
'Theia': 'Theia (Sight)',
'Coeus': 'Coeus (Intellect)',
'Phoebe': 'Phoebe (Prophecy)',
'Iapetus': 'Iapetus (Mortality)',
'Themis': 'Themis (Justice)',
'Mnemosyne': 'Mnemosyne (Memory)',
}
for t in titans:
g.node(t, titans[t])
g.edge('Titans', t)
# Cronus + Rhea -> Olympians
olympians = {
'Zeus': 'Zeus (Sky King)',
'Hera': 'Hera (Marriage)',
'Poseidon': 'Poseidon (Sea)',
'Hestia': 'Hestia (Hearth)',
'Demeter': 'Demeter (Agriculture)',
'Hades': 'Hades (Underworld)',
}
for o in olympians:
g.node(o, olympians[o])
g.edge('Cronus', o)
g.edge('Rhea', o)
# ----------------------------
# Zeus children (with various mothers)
# ----------------------------
g.node('Athena', 'Athena (Wisdom, war)')
g.edge('Zeus', 'Athena', label='born from head')
g.node('Apollo', 'Apollo (Sun, prophecy)')
g.node('Artemis', 'Artemis (Hunt, Moon)')
g.edge('Zeus', 'Apollo')
g.edge('Zeus', 'Artemis')
g.node('Hermes', 'Hermes (Messenger)')
g.edge('Zeus', 'Hermes')
g.node('Dionysus', 'Dionysus (Wine)')
g.edge('Zeus', 'Dionysus')
g.node('Ares', 'Ares (War)')
g.edge('Hera', 'Ares')
# ----------------------------
# Underworld/Chthonic from Nyx
# ----------------------------
nyx_children = {
'Morpheus': 'Morpheus (Dreams)',
'Thanatos': 'Thanatos (Death)',
'Hypnos': 'Hypnos (Sleep)',
'Nemesis': 'Nemesis (Retribution)',
'Eris': 'Eris (Strife)',
'Clotho': 'Clotho (Fate, Spinner)',
'Lachesis': 'Lachesis (Fate, Measurer)',
'Atropos': 'Atropos (Fate, Cutter)'
}
for child, label in nyx_children.items():
g.node(child, label)
g.edge('Nyx', child)
# ----------------------------
# Primordial rivers under Tartarus
# ----------------------------
rivers = ['Styx', 'Acheron', 'Lethe', 'Phlegethon', 'Cocytus']
for r in rivers:
g.node(r, f'{r} (Underworld River)')
g.edge('Tartarus', r)
# ----------------------------
# Generate the image
# ----------------------------
g.render('greek_gods_family_tree', view=True)
Editor is loading...
Leave a Comment