A Windows utility that converts Kusto Explorer clipboard data into clean Markdown — ready to paste into GitHub issues, wikis, or documentation.
- Reads the HTML clipboard data that Kusto Explorer places on the Windows clipboard when you copy query results.
- Extracts the KQL query, result table, cluster URL, and deep-links.
- Converts everything into a well-formatted Markdown document.
- Copies the Markdown back to your clipboard.
- Query section with the KQL in a fenced code block (
```kql) - Cluster URL and "Open in" deep-links to Kusto Explorer / Web Explorer
- Results table formatted as a Markdown table with auto-linkified URLs
- Windows (uses the Win32 clipboard API via
ctypes) - Python 3.10+
- pyperclip — auto-installed on first run if missing
-
In Kusto Explorer, run a query and copy the results (
Ctrl+C). -
Run the script:
python kusto2md.py
-
The Markdown is now in your clipboard — paste it wherever you need.
If no Kusto HTML data is found on the clipboard, the script falls back to treating the clipboard content as tab-separated values and converts that into a Markdown table.
### Query
> **Cluster:** https://mycluster.kusto.windows.net
> **Open in:** [Kusto Explorer](https://...) | [Web](https://...)
```kql
StormEvents
| summarize count() by State
| top 5 by count_
```
### Results
| State | count_ |
| -------------- | ------ |
| TEXAS | 4701 |
| KANSAS | 3166 |
| OKLAHOMA | 2690 |
| MISSOURI | 2016 |
| GEORGIA | 1983 |MIT