- Python 3.11 or newer
uv
uv sync
uv run pre-commit installTo sync development dependencies run following command:
uv sync --group devOpen a Python shell with the project's dependencies available:
uv run pythonimport seriousdb
seriousdb.set("name", "Alice")
seriousdb.get("name")uv run ruff format .uv run ruff format --check .uv run ruff check .uv run ty check .uv run ruff check --fix .Python docstrings follow the NumPy style.
Docstrings are required for public functions, classes and modules only; for private ones (prefixed
with _) they are optional. This is enforced by ruff (see Linting).
A docstring starts with a one-line summary, followed by the sections that apply, such as
Parameters, Returns and Raises:
def select(self, key: str) -> str:
"""Return the value stored under `key`.
Parameters
----------
key : str
Key to look up.
Returns
-------
str
The value stored under `key`.
Raises
------
ResourceNotFoundError
If `key` does not exist.
ServiceUnavailableError
If no database has been loaded.
"""See cache.py and api.py for more
examples.
The docstrings above are the source for a generated, docstring-level API reference committed at
docs/reference/.
built with Sphinx and
sphinx-markdown-builder so it renders as plain
Markdown on GitHub — no hosted docs site required.
docs/reference/ is committed, not gitignored, so it's readable straight from the repo. Don't edit
files under it by hand: edit the docstring instead and regenerate.
uv sync --group docs
uv run --group docs python scripts/docs-reference.pyCommit any resulting changes under docs/reference/ along with your docstring change. CI (see
.github/workflows/docs.yml) rebuilds it and fails the check if
the committed output doesn't match, so a stale reference is caught before merge.
docs/_sphinx/index.rst lists the modules that get a generated page, currently seriousdb.api and
seriousdb.exceptions — the two modules architecture.md calls out as public. To
add another, add its dotted path to the autosummary list in that file and regenerate; the page
layout itself comes from the template at
docs/_sphinx/_templates/autosummary/module.rst.