Compare commits

...

16 commits

Author SHA1 Message Date
Simon Willison
8fa2df978b Release 3.15.1
Refs #311, #312, #313, #315
2021-08-10 16:51:59 -07:00
Simon Willison
43bc064817 Finished adding docstrings and type hints to db 2021-08-10 16:05:35 -07:00
Simon Willison
f51b712479 Fixed rogue backtick, renamed to API Reference 2021-08-10 14:52:40 -07:00
Simon Willison
5d758a2761 docstrings for most of the Table class 2021-08-10 12:41:41 -07:00
Simon Willison
b39131f375 Completed docstrings for Database and Queryable 2021-08-10 11:35:21 -07:00
Simon Willison
99cf7c1c53 Finished adding docstrings to everything in Database 2021-08-10 11:14:32 -07:00
Simon Willison
6ad3ce414c Leave this as it was 2021-08-10 10:43:32 -07:00
Simon Willison
eeb5550ed7 RTD doesnt have 3.9 yet 2021-08-10 10:41:09 -07:00
Simon Willison
50dcfc01dc Custom Read The Docs config, to get autodoc working 2021-08-10 10:40:14 -07:00
Simon Willison
b58352f730 Try ../../ 2021-08-10 10:34:26 -07:00
Simon Willison
e20f62613a Help Read The Docs find modules to autodoc 2021-08-10 10:29:55 -07:00
Simon Willison
be6dd5bda8 More annotations plus a fix for #313 2021-08-10 10:25:23 -07:00
Simon Willison
c11ff89894 flake8/black fix 2021-08-10 10:12:30 -07:00
Simon Willison
cf92a29c2e Fixed bug I introduced with register_function() 2021-08-10 10:08:23 -07:00
Simon Willison
2da7af10a4 Fix for Python 3.6 2021-08-10 10:01:38 -07:00
Simon Willison
b95b6b63f6 More docstrings plus configured autodoc, refs #311 2021-08-10 09:58:37 -07:00
9 changed files with 724 additions and 181 deletions

12
.readthedocs.yaml Normal file
View file

@ -0,0 +1,12 @@
version: 2
sphinx:
configuration: docs/conf.py
python:
version: "3.8"
install:
- method: pip
path: .
extra_requirements:
- docs

View file

@ -20,4 +20,4 @@ help:
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
livehtml: livehtml:
sphinx-autobuild -b html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(0) sphinx-autobuild -a -b html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(0) --watch ../sqlite_utils

View file

@ -2,6 +2,16 @@
Changelog Changelog
=========== ===========
.. _v3_15.1:
3.15.1 (2021-08-10)
-------------------
- Python library now includes type annotations on almost all of the methods, plus detailed docstrings describing each one. (:issue:`311`)
- New :ref:`reference` documentation page, powered by those docstrings.
- Fixed bug where ``.add_foreign_keys()`` failed to raise an error if called against a ``View``. (:issue:`313`)
- Fixed bug where ``.delete_where()`` returned a ``[]`` instead of returning ``self`` if called against a non-existant table. (:issue:`315`)
.. _v3_15: .. _v3_15:
3.15 (2021-08-09) 3.15 (2021-08-09)

View file

@ -30,7 +30,8 @@ from subprocess import Popen, PIPE
# Add any Sphinx extension module names here, as strings. They can be # Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones. # ones.
extensions = ["sphinx.ext.extlinks"] extensions = ["sphinx.ext.extlinks", "sphinx.ext.autodoc"]
autodoc_member_order = "bysource"
extlinks = { extlinks = {
"issue": ("https://github.com/simonw/sqlite-utils/issues/%s", "#"), "issue": ("https://github.com/simonw/sqlite-utils/issues/%s", "#"),

View file

@ -32,6 +32,7 @@ Contents
installation installation
cli cli
python-api python-api
reference
contributing contributing
changelog changelog

View file

@ -962,7 +962,7 @@ The ``table.analyze_column(column, common_limit=10, value_truncate=None)`` metho
The name of the column The name of the column
``total_rows`` ``total_rows``
The total number of rows in the table` The total number of rows in the table
``num_null`` ``num_null``
The number of rows for which this column is null The number of rows for which this column is null

71
docs/reference.rst Normal file
View file

@ -0,0 +1,71 @@
.. _reference:
===============
API Reference
===============
.. contents:: :local:
.. _reference_db_database:
sqlite_utils.db.Database
========================
.. autoclass:: sqlite_utils.db.Database
:members:
:undoc-members:
:show-inheritance:
:special-members: __getitem__
:exclude-members: use_counts_table, execute_returning_dicts, resolve_foreign_keys
.. _reference_db_queryable:
sqlite_utils.db.Queryable
=========================
:ref:`Table <reference_db_table>` and :ref:`View <reference_db_view>` are both subclasses of ``Queryable``, providing access to the following methods:
.. autoclass:: sqlite_utils.db.Queryable
:members:
:undoc-members:
:exclude-members: execute_count
.. _reference_db_table:
sqlite_utils.db.Table
=====================
.. autoclass:: sqlite_utils.db.Table
:members:
:undoc-members:
:show-inheritance:
:exclude-members: guess_foreign_column, value_or_default, build_insert_queries_and_params, insert_chunk, add_missing_columns
.. _reference_db_view:
sqlite_utils.db.View
====================
.. autoclass:: sqlite_utils.db.View
:members:
:undoc-members:
:show-inheritance:
.. _reference_db_other:
Other
=====
.. _reference_db_other_column:
sqlite_utils.db.Column
----------------------
.. autoclass:: sqlite_utils.db.Column
.. _reference_db_other_column_details:
sqlite_utils.db.ColumnDetails
-----------------------------
.. autoclass:: sqlite_utils.db.ColumnDetails

View file

@ -2,7 +2,7 @@ from setuptools import setup, find_packages
import io import io
import os import os
VERSION = "3.15" VERSION = "3.15.1"
def get_long_description(): def get_long_description():

File diff suppressed because it is too large Load diff