Python library converts Markdown to Google Docs, exposing index-based API pitfalls
A developer built a Python library called google-docs to turn Markdown reports into formatted Google Docs with headings, lists, tables, and links. Google's Docs API has no high-level Python client, so the library works with batchUpdate requests that address content by character index. The author found several traps, including index shifts after inserts, computing table cell positions, and counting UTF-16 code units for emoji. A fake in-memory Docs server was used for offline testing, but it diverged from the real API until a one-unit table length error was fixed. The author concludes that a fake is only as reliable as the evidence used to verify it.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in