code: def export_dict(path):
      
      export_entities = [e.to_dict() for e in path.entities]
      export_object = {'entities': export_entities,
                       'vertices': path.vertices.tolist()}
      return export_object
docs: Export a path as a dict of kwargs for the Path constructor.