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:
co-authored by
Claude Opus 4.6
parent
fd3ff46804
commit
4d681a92ca
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user