Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 0974414

Browse files
authored
Docs (#6)
* docs: setup * docs: write basic documentation * chore: fix lock file * chore: calm pre-commit down
1 parent 661842b commit 0974414

File tree

16 files changed

+578
-195
lines changed

16 files changed

+578
-195
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ from storage3 import create_client
1414

1515
url = "https://<your_supabase_id>.supabase.co/storage/v1"
1616
key = "<your api key>"
17+
headers = {"apiKey": key, "Authorization": f"Bearer {key}"}
1718

1819
# pass in is_async=True to create an async client
19-
storage_client = create_client(url, key, is_async=False)
20+
storage_client = create_client(url, headers, is_async=False)
2021

2122
storage_client.list_buckets()
2223
```

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/api/bucket.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Bucket
2+
======
3+
4+
.. autoclass:: storage3._async.file_api.AsyncBucket
5+
:inherited-members:
6+
7+
8+
.. autoclass:: storage3._async.file_api.AsyncBucketProxy
9+
:inherited-members:

docs/api/client.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Client
2+
======
3+
4+
The entrypoint to the library is the Client class. To interact with the Storage API, you make an instance of this class.
5+
6+
7+
.. autofunction:: storage3.create_client
8+
9+
.. autoclass:: storage3.AsyncStorageClient
10+
:members:
11+
:inherited-members:

docs/api/index.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
API Reference
2+
=============
3+
4+
.. note::
5+
The library offers both synchronous and asynchronous clients.
6+
Note that the synchronous and asynchronous classes all provide the exact same interface.
7+
Only the async client and it's methods are documented here.
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
:caption: API Reference:
12+
13+
Client <client>
14+
Bucket <bucket>

docs/conf.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
# import os
14+
# import sys
15+
# sys.path.insert(0, os.path.abspath('.'))
16+
17+
18+
# -- Project information -----------------------------------------------------
19+
20+
project = "storage-py"
21+
copyright = (
22+
"2022, Anand Krishna, Daniel Reinón García, Joel Lee, Leynier Gutiérrez González"
23+
)
24+
author = "Anand Krishna, Daniel Reinón García, Joel Lee, Leynier Gutiérrez González"
25+
26+
27+
# -- General configuration ---------------------------------------------------
28+
29+
# Add any Sphinx extension module names here, as strings. They can be
30+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
31+
# ones.
32+
extensions = [
33+
"sphinx.ext.autodoc",
34+
"sphinx.ext.napoleon",
35+
"sphinx.ext.extlinks",
36+
]
37+
38+
# Add any paths that contain templates here, relative to this directory.
39+
templates_path = ["_templates"]
40+
41+
# List of patterns, relative to source directory, that match files and
42+
# directories to ignore when looking for source files.
43+
# This pattern also affects html_static_path and html_extra_path.
44+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
45+
46+
47+
# -- Options for HTML output -------------------------------------------------
48+
49+
# The theme to use for HTML and HTML Help pages. See the documentation for
50+
# a list of builtin themes.
51+
#
52+
html_theme = "press"
53+
54+
# Add any paths that contain custom static files (such as style sheets) here,
55+
# relative to this directory. They are copied after the builtin static files,
56+
# so a file named "default.css" will overwrite the builtin "default.css".
57+
html_static_path = ["_static"]

docs/examples/index.rst

Whitespace-only changes.

docs/index.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Welcome to storage-py's documentation!
2+
======================================
3+
4+
Python Client library for `Supabase Storage API <https://supabase.com/storage>`_
5+
6+
.. attention::
7+
If you find any bugs, please file an `issue <https://github.com/supabase-community/storage-py/issues/>`_.
8+
9+
10+
Installation
11+
============
12+
13+
Requirements:
14+
15+
- Python >= 3.7
16+
17+
**With pip:**
18+
::
19+
20+
pip install storage3
21+
22+
**With poetry:**
23+
::
24+
25+
poetry add storage3
26+
27+
28+
.. toctree::
29+
:maxdepth: 2
30+
:caption: Contents:
31+
32+
API Reference </api/index>
33+
Examples </examples/index>
34+
35+
Indices and tables
36+
==================
37+
38+
* :ref:`genindex`
39+
* :ref:`modindex`
40+
* :ref:`search`

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=_build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

0 commit comments

Comments
 (0)