-
-
Notifications
You must be signed in to change notification settings - Fork 59
Add documentation #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add documentation #111
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9b2bba0
deps: add furo
anand2312 0375111
docs: document public classes
anand2312 5cfc0cd
docs: setup sphinx + furo
anand2312 ac8dd04
docs: fix bullet point
anand2312 300a089
fix: remove test file
anand2312 294ad30
tests: check if params purged after execute
anand2312 2518f42
fix: remove the `asyncio` mark from sync tests
anand2312 99e40fc
docs: add project version
anand2312 6607674
docs: add rtd config
anand2312 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,3 +136,6 @@ dmypy.json | |
|
||
# Poetry local config | ||
poetry.toml | ||
|
||
# dummy test file | ||
x.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = . | ||
BUILDDIR = _build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Client | ||
====== | ||
|
||
To run any queries, the first step is to construct a client. | ||
|
||
The library offers both synchronous and asynchronous clients. | ||
|
||
.. autoclass:: postgrest_py.AsyncPostgrestClient | ||
:members: | ||
:inherited-members: | ||
|
||
.. autoclass:: postgrest_py.SyncPostgrestClient | ||
:members: | ||
:inherited-members: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Exceptions | ||
========== | ||
|
||
.. autoexception:: postgrest_py.APIError | ||
:members: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Filter Builder | ||
============== | ||
|
||
This is a kind of `request builder <Request Builders>`_. It contains all the methods used to | ||
filter data during queries. | ||
|
||
.. note:: | ||
In the source code, there are separate AsyncFilterRequestBuilders and SyncFilterRequestBuilders. | ||
These classes are otherwise exactly the same, and provide the same interface. | ||
|
||
.. warning:: | ||
These classes are not meant to be constructed by the user. | ||
|
||
.. tip:: | ||
The full list of supported filter operators are on the `PostgREST documentation <https://postgrest.org/en/stable/api.html#operators>`_ | ||
|
||
.. tip:: | ||
All the filter methods return a modified instance of the filter builder, allowing fluent chaining of filters. | ||
|
||
|
||
.. autoclass:: postgrest_py.AsyncFilterRequestBuilder | ||
:members: | ||
:inherited-members: | ||
|
||
.. autoclass:: postgrest_py.SyncFilterRequestBuilder | ||
:members: | ||
:inherited-members: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
API Reference | ||
============= | ||
|
||
The library offers both synchronous and asynchronous clients. | ||
Note that the synchronous and asynchronous classes all provide the exact same interface. | ||
|
||
.. toctree:: | ||
:maxdepth: 3 | ||
:caption: Contents: | ||
|
||
Client <client> | ||
Request Builders <request_builders> | ||
Filters <filters> | ||
Responses <responses> | ||
Types <types> | ||
Exceptions <exceptions> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
Request Builders | ||
================ | ||
|
||
.. note:: | ||
In the source code, there are separate synchronous and asynchronous request builder classes. | ||
These classes are otherwise exactly the same, and provide the same interfaces. | ||
|
||
.. warning:: | ||
These classes are not meant to be constructed by the user. | ||
|
||
.. autoclass:: postgrest_py.AsyncRequestBuilder | ||
:members: | ||
:inherited-members: | ||
|
||
.. autoclass:: postgrest_py.AsyncSelectRequestBuilder | ||
:members: | ||
:inherited-members: | ||
|
||
.. autoclass:: postgrest_py.AsyncQueryRequestBuilder | ||
:members: | ||
:inherited-members: | ||
|
||
.. autoclass:: postgrest_py.SyncRequestBuilder | ||
:members: | ||
:inherited-members: | ||
|
||
.. autoclass:: postgrest_py.SyncSelectRequestBuilder | ||
:members: | ||
:inherited-members: | ||
|
||
.. autoclass:: postgrest_py.SyncQueryRequestBuilder | ||
:members: | ||
:inherited-members: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Responses | ||
========= | ||
|
||
Once a query is run, the postgrest_py parses the server's response into an APIResponse object. | ||
|
||
.. autoclass:: postgrest_py.APIResponse | ||
:members: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Types | ||
===== | ||
|
||
Some type aliases and enums used in the library. | ||
|
||
.. autoclass:: postgrest_py.types.CountMethod | ||
:members: | ||
|
||
.. autoclass:: postgrest_py.types.Filters | ||
:members: | ||
|
||
.. autoclass:: postgrest_py.types.RequestMethod | ||
:members: | ||
|
||
.. autoclass:: postgrest_py.types.ReturnMethod | ||
:members: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
# | ||
# This file only contains a selection of the most common options. For a full | ||
# list see the documentation: | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
||
# -- Path setup -------------------------------------------------------------- | ||
|
||
# If extensions (or modules to document with autodoc) are in another directory, | ||
# add these directories to sys.path here. If the directory is relative to the | ||
# documentation root, use os.path.abspath to make it absolute, like shown here. | ||
# | ||
# import os | ||
# import sys | ||
# sys.path.insert(0, os.path.abspath('.')) | ||
|
||
|
||
# -- Project information ----------------------------------------------------- | ||
|
||
project = "postgrest-py" | ||
copyright = ( | ||
"2022, Anand Krishna, Daniel Reinón García, Joel Lee, Leynier Gutiérrez González" | ||
) | ||
author = "Anand Krishna, Daniel Reinón García, Joel Lee, Leynier Gutiérrez González" | ||
|
||
|
||
# -- General configuration --------------------------------------------------- | ||
|
||
# Add any Sphinx extension module names here, as strings. They can be | ||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | ||
# ones. | ||
extensions = [ | ||
"sphinx.ext.autodoc", | ||
"sphinx.ext.napoleon", | ||
"sphinx.ext.extlinks", | ||
] | ||
|
||
# Napolean config | ||
napoleon_google_docstring = True | ||
|
||
# autodoc config | ||
autodoc_member_order = "bysource" | ||
autodoc_class_signature = "separated" | ||
|
||
# Add any paths that contain templates here, relative to this directory. | ||
templates_path = ["_templates"] | ||
|
||
# List of patterns, relative to source directory, that match files and | ||
# directories to ignore when looking for source files. | ||
# This pattern also affects html_static_path and html_extra_path. | ||
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] | ||
|
||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
|
||
# The theme to use for HTML and HTML Help pages. See the documentation for | ||
# a list of builtin themes. | ||
# | ||
html_theme = "furo" | ||
|
||
# Add any paths that contain custom static files (such as style sheets) here, | ||
# relative to this directory. They are copied after the builtin static files, | ||
# so a file named "default.css" will overwrite the builtin "default.css". | ||
html_static_path = ["_static"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Examples | ||
======== | ||
|
||
Stay tuned! Examples are coming soon. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Welcome to postgrest-py's documentation! | ||
======================================== | ||
|
||
`PostgREST <https://postgrest.org>`_ client library for Python. This library provides an ORM interface to PostgREST. | ||
|
||
.. attention:: | ||
This library is currently unstable. If you find any bugs, please file an `issue <https://github.com/supabase-community/postgrest-py/issues/>`_. | ||
|
||
Installation | ||
============ | ||
Requirements: | ||
|
||
- Python >= 3.7 | ||
|
||
**With pip:** | ||
pip install postgrest-py | ||
|
||
**With poetry:** | ||
poetry add postgrest-py | ||
|
||
|
||
.. toctree:: | ||
:maxdepth: 3 | ||
:caption: Contents: | ||
|
||
API Reference </api/index> | ||
Examples </examples/index> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@ECHO OFF | ||
|
||
pushd %~dp0 | ||
|
||
REM Command file for Sphinx documentation | ||
|
||
if "%SPHINXBUILD%" == "" ( | ||
set SPHINXBUILD=sphinx-build | ||
) | ||
set SOURCEDIR=. | ||
set BUILDDIR=_build | ||
|
||
if "%1" == "" goto help | ||
|
||
%SPHINXBUILD% >NUL 2>NUL | ||
if errorlevel 9009 ( | ||
echo. | ||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
echo.installed, then set the SPHINXBUILD environment variable to point | ||
echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
echo.may add the Sphinx directory to PATH. | ||
echo. | ||
echo.If you don't have Sphinx installed, grab it from | ||
echo.https://www.sphinx-doc.org/ | ||
exit /b 1 | ||
) | ||
|
||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
goto end | ||
|
||
:help | ||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
|
||
:end | ||
popd |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still relevant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, didn't mean to leave that in. Good catch, reverted in 300a089