A Python script that fetches a published Google Doc containing coordinate-based character data, parses the table, and renders it as a grid of characters in the terminal.
How It Works
- Fetch — Uses Playwright to launch a headless Chromium browser and navigate to the published Google Doc URL. This is necessary because published Google Docs use client-side JavaScript to render their content, so a simple HTTP request returns an empty page.
- Parse — Extracts the HTML table from the rendered page using BeautifulSoup. Each row contains three columns: an x-coordinate, a character, and a y-coordinate. The data is stored in a sparse 2D grid.
- Render — Prints the grid to the terminal, iterating from the highest y-coordinate down to zero (since y=0 represents the bottom of the grid), producing correctly oriented uppercase letters.