docs: add Google-style docstrings and Sphinx autodoc setup

Add concise docstrings to all Python modules, classes, and public
functions. Configure Sphinx with napoleon extension for Google-style
docstring parsing and autodoc pages for each module.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Mathew Sir Guest the best
2026-05-06 23:06:37 -06:00
co-authored by Claude Opus 4.6
parent fd3ff46804
commit 4d681a92ca
16 changed files with 479 additions and 0 deletions
+9
View File
@@ -1,3 +1,5 @@
"""SQLAlchemy engine and session factory setup."""
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
@@ -7,12 +9,19 @@ DB_PATH = "sqlite:///wordsearch.db"
def get_engine(db_url=None):
"""Create a SQLAlchemy engine.
Args:
db_url: Database URL. Defaults to ``sqlite:///wordsearch.db``.
"""
return create_engine(db_url or DB_PATH)
def get_session_factory(engine):
"""Return a sessionmaker bound to the given engine."""
return sessionmaker(bind=engine)
def init_db(engine):
"""Create all tables defined in the ORM models."""
Base.metadata.create_all(engine)