Skip to content

Instantly share code, notes, and snippets.

@ag-chirag
Created September 24, 2024 03:14
Show Gist options
  • Save ag-chirag/982b5be20b23236c4954ed0cefccae6f to your computer and use it in GitHub Desktop.
Save ag-chirag/982b5be20b23236c4954ed0cefccae6f to your computer and use it in GitHub Desktop.
Util method to convert DataCommons response to markdown
@staticmethod
def pretty_print(q2resp: dict[str, dg.base.DataCommonsCall]):
markdown_output = "# Data Commons Response\n"
for k, v in q2resp.items():
markdown_output += f"**{k}**\n\n"
markdown_output += f"{v.answer()}\n\n"
return markdown_output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment