Skip to content

Commit 212532d

Browse files
committed
docs
1 parent 304ff5b commit 212532d

File tree

10 files changed

+1418
-4
lines changed

10 files changed

+1418
-4
lines changed

.github/workflows/docs.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: website
2+
3+
# build the documentation whenever there are new commits on main
4+
on:
5+
push:
6+
branches:
7+
- main
8+
# Alternative: only build for tags.
9+
# tags:
10+
# - '*'
11+
12+
# security: restrict permissions for CI jobs.
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
# Build the documentation and upload the static HTML files as an artifact.
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v3
22+
- uses: actions/setup-python@v4
23+
with:
24+
python-version: '3.11'
25+
26+
# ADJUST THIS: install all dependencies (including pdoc)
27+
- run: pip install -e .
28+
# ADJUST THIS: build your documentation into docs/.
29+
# We use a custom build script for pdoc itself, ideally you just run `pdoc -o docs/ ...` here.
30+
- run: make docs
31+
32+
- uses: actions/upload-pages-artifact@v1
33+
with:
34+
path: docs/
35+
36+
# Deploy the artifact to GitHub pages.
37+
# This is a separate job so that only actions/deploy-pages has the necessary permissions.
38+
deploy:
39+
needs: build
40+
runs-on: ubuntu-latest
41+
permissions:
42+
pages: write
43+
id-token: write
44+
environment:
45+
name: github-pages
46+
url: ${{ steps.deployment.outputs.page_url }}
47+
steps:
48+
- id: deployment
49+
uses: actions/deploy-pages@v2

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release to PyPI
1+
name: release
22

33
on:
44
push:

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ style:
1616
pre-commit run --all-files
1717

1818
check: style test
19+
20+
docs:
21+
pdoc ./abnosql '!abnosql.cli'

abnosql/__init__.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
from abnosql.cli import cli
44
from abnosql.table import table
5-
6-
__version__ = '0.0.1'
5+
from abnosql.table import TableBase
6+
from abnosql.table import TableSpecs
77

88

99
logger = logging.getLogger(__name__)
1010
logger.addHandler(logging.NullHandler())
1111

1212
__all__ = [ # type: ignore
1313
cli,
14-
table
14+
table,
15+
TableBase,
16+
TableSpecs
1517
]

abnosql/table.py

+14
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ def set_config(self, table: str) -> t.Dict: # type: ignore[empty-body] # noqa E
2020
"""Hook to set config
2121
2222
Args:
23+
2324
table: table name
2425
2526
Returns:
27+
2628
dictionary containing config
2729
2830
"""
@@ -33,10 +35,12 @@ def get_item_post(self, table: str, item: t.Dict) -> t.Dict: # type: ignore[emp
3335
"""Hook invoked after get_item()
3436
3537
Args:
38+
3639
table: table name
3740
item: dictionary item retrieved from get_item call
3841
3942
Returns:
43+
4044
dictionary containing updated item
4145
4246
"""
@@ -47,6 +51,7 @@ def put_item_post(self, table: str, item: t.Dict) -> None: # type: ignore[empty
4751
"""Hook invoked after put_item()
4852
4953
Args:
54+
5055
table: table name
5156
item: dictionary containing partition and range/sort key
5257
@@ -58,6 +63,7 @@ def put_items_post(self, table: str, items: t.List[t.Dict]) -> None: # type: ig
5863
"""Hook invoked after put_items()
5964
6065
Args:
66+
6167
table: table name
6268
item: list of dictionary items written to table
6369
@@ -69,6 +75,7 @@ def delete_item_post(self, table: str, key: t.Dict) -> None: # type: ignore[emp
6975
"""Hook invoked after delete_item()
7076
7177
Args:
78+
7279
table: table name
7380
key: dictionary of item written to table
7481
@@ -84,6 +91,7 @@ def __init__(
8491
"""Instantiate table object
8592
8693
Args:
94+
8795
pm: pluggy plugin manager
8896
name: table name
8997
config: optional config dict dict
@@ -95,9 +103,11 @@ def get_item(self, **kwargs) -> t.Dict:
95103
"""Get table/collection item
96104
97105
Args:
106+
98107
partition key and range/sort key (if used)
99108
100109
Returns:
110+
101111
item dictionary or None if not found
102112
103113
"""
@@ -108,6 +118,7 @@ def put_item(self, item: t.Dict):
108118
"""Puts table/collection item
109119
110120
Args:
121+
111122
item: dictionary
112123
113124
"""
@@ -118,6 +129,7 @@ def put_items(self, items: t.Iterable[t.Dict]):
118129
"""Puts multiple table/collection items
119130
120131
Args:
132+
121133
items: list of item dictionaries
122134
123135
"""
@@ -144,6 +156,7 @@ def query(
144156
"""Perform key based query with optional exact match filters
145157
146158
Args:
159+
147160
key: dictionary containing partition key and range/sort key
148161
filters: optional dictionary of key=value to query and filter on
149162
limit: query limit
@@ -166,6 +179,7 @@ def query_sql(
166179
"""Perform key based query with optional exact match filters
167180
168181
Args:
182+
169183
statement: SQL statement to query table
170184
parameters: optional dictionary containing @key = value placeholders
171185
limit: query limit

docs/abnosql.html

+98
Large diffs are not rendered by default.

docs/abnosql/table.html

+1,194
Large diffs are not rendered by default.

docs/index.html

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="refresh" content="0; url=./abnosql/table.html"/>
6+
</head>
7+
</html>

docs/search.js

+46
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def get_version():
4646
'responses'
4747
]
4848
dev_require = tests_require + [
49+
'pdoc',
4950
'pre-commit'
5051
]
5152

0 commit comments

Comments
 (0)