apache / arrow-adbc

Database connectivity API standard and libraries for Apache Arrow
https://arrow.apache.org/adbc/
Apache License 2.0
378 stars 94 forks source link

docs: improve cookbook Sphinx tag #2082

Open lidavidm opened 2 months ago

lidavidm commented 2 months ago

Strawman:

# --- RECIPE ---
# title: "Use ADBC PostgreSQL with SQLAlchemy"
# tags: [postgresql, sqlalchemy]
# description: Build queries with SQLAlchemy, then submit them via ADBC.
# --- RECIPE ---

import ...

the syntax isn't too big a deal, so long as we pick something that's recognizable but still valid Python

lidavidm commented 2 months ago

I am leaning towards "YAML frontmatter" though just because it is easily parseable. Though perhaps even better would be a docstring

"""
Build queries with SQLAlchemy, then submit them via ADBC.

Categories
----------
postgresql, sqlalchemy
"""

A separate title seems redundant as well here

It seems possible we could abuse the numpydoc parser: https://github.com/numpy/numpydoc/blob/main/numpydoc/docscrape.py

lidavidm commented 2 months ago

Another thing we could do:

This wouldn't quite integrate as well with the (rudimentary) incremental-build support in Sphinx though. So maybe a domain with custom indices is the right way to go.