code: def intermediary_to_schema(tables, relationships, output):
      
      dot_file = _intermediary_to_dot(tables, relationships)
      graph = AGraph()
      graph = graph.from_string(dot_file)
      extension = output.split('.')[-1]
      graph.draw(path=output, prog='dot', format=extension)
docs: Transforms and save the intermediary representation to the file chosen.