diff --git a/.readthedocs.yaml b/.readthedocs.yaml index f596d61..87ff0a5 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,35 +1,19 @@ -# Read the Docs configuration file for Sphinx projects +# Read the Docs configuration file for MkDocs projects # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details # Required version: 2 -# Set the OS, Python version and other tools you might need +# Set the version of Python and other tools you might need build: os: ubuntu-22.04 tools: python: "3.10" - # You can also specify other tool versions: - # nodejs: "20" - # rust: "1.70" - # golang: "1.20" -# Build documentation in the "docs/" directory with Sphinx -sphinx: - configuration: docs/source/conf.py - # You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs - # builder: "dirhtml" - # Fail on all warnings to avoid broken references - # fail_on_warning: true +mkdocs: + configuration: mkdocs.yml -# Optionally build your docs in additional formats such as PDF and ePub -# formats: -# - pdf -# - epub - -# Optional but recommended, declare the Python requirements required -# to build your documentation -# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +# Optionally declare the Python requirements required to build your docs python: install: - requirements: requirements.txt diff --git a/docs/.pages b/docs/.pages new file mode 100644 index 0000000..1f5118a --- /dev/null +++ b/docs/.pages @@ -0,0 +1,7 @@ +nav: + - index.md + - getting_started.md + - faq.md + - horde_sdk + +order: asc diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index d0c3cbf..0000000 --- a/docs/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# 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 = source -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) diff --git a/docs/build_docs.py b/docs/build_docs.py new file mode 100644 index 0000000..e32ccd6 --- /dev/null +++ b/docs/build_docs.py @@ -0,0 +1,77 @@ +from pathlib import Path + + +def main() -> None: + # Create mkdocs documentation using mkdocstrings + project_root = Path(__file__).parent.parent + code_root = Path(__file__).parent.parent / "horde_sdk" + + # Get every .py file in the code_root directory and all subdirectories + py_files = list(code_root.glob("**/*.py")) + + # Sort the files by path + sorted_py_files = sorted(py_files, key=lambda x: str(x)) + + pyfile_lookup = convert_list_of_paths_to_namespaces(sorted_py_files, project_root) + + # Get all the folders in code_root and its subdirectories + code_root_paths = list(code_root.glob("**/*")) + code_root_paths.append(code_root) + code_root_paths = [path for path in code_root_paths if path.is_dir()] + + folder_lookup = convert_list_of_paths_to_namespaces(code_root_paths, project_root) + # Remove any files from the folder_lookup + + # For each folder in the folder_lookup, create a file in the docs folder + for folder, _namespace in folder_lookup.items(): + relative_folder = folder.relative_to(project_root) + relative_folder = "docs" / relative_folder + relative_folder.mkdir(parents=True, exist_ok=True) + + with open(relative_folder / ".pages", "w") as f: + f.write(f"title: {relative_folder.name}\n") + + # Get all the files in the folder + files_in_folder = list(folder.glob("*.py")) + + # Remove any files that start with a dunderscore + files_in_folder = [file for file in files_in_folder if "__" not in str(file)] + + # Sort the files by path + sorted_files_in_folder = sorted(files_in_folder, key=lambda x: str(x)) + + if len(sorted_files_in_folder) == 0: + continue + + for file in sorted_files_in_folder: + with open(relative_folder / f"{file.stem}.md", "w") as f: + f.write(f"# {file.stem}\n") + file_namespace = pyfile_lookup[file] + f.write(f"::: {file_namespace}\n") + + +def convert_list_of_paths_to_namespaces(paths: list[Path], root: Path) -> dict[Path, str]: + # Convert path to string, remove everything in the path before "horde_sdk" + lookup = {path: str(path).replace(str(root), "") for path in paths} + + # Remove any entry with a dunderscore + lookup = {key: value for key, value in lookup.items() if "__" not in value} + + # If ends in .py, remove that + lookup = {key: value[:-3] if value.endswith(".py") else value for key, value in lookup.items()} + + # Replace all slashes with dots + lookup = {key: value.replace("\\", ".") for key, value in lookup.items()} + + # Unix paths too + lookup = {key: value.replace("/", ".") for key, value in lookup.items()} + + # Remove the first dot + lookup = {key: value[1:] if value.startswith(".") else value for key, value in lookup.items()} + + # Purge any empty values + return {key: value for key, value in lookup.items() if value} + + +if __name__ == "__main__": + main() diff --git a/docs/faq.md b/docs/faq.md new file mode 100644 index 0000000..4cde98e --- /dev/null +++ b/docs/faq.md @@ -0,0 +1,27 @@ +title: Frequently Asked Questions + +# Why can't I change an attribute of one of my \*Response or \*Request objects? + +> The objects returned by horde_sdk are immutable. If you need to change +> something, you'll need to create a new object with the changes you +> want. See [pydantic's +> docs](https://docs.pydantic.dev/2.0/usage/validation_errors/#frozen_instance) +> for more information. + +# I don't like types. Why is this library so focused on them? + +> Types are a great way to ensure that your code is correct. They also +> make it easier for other developers to understand what your code is +> doing with [type +> hints](https://docs.python.org/3/library/typing.html). These *hint* +> what data format class attributes or functions are expecting or will +> return. This is how IDEs such as PyCharm or VSCode can provide +> autocomplete and other helpful features. +> +> If you don't like working with the objects within your own code, you +> can always translate between the types and dicts using pydantic's +> `.model_dump()` `.model_validate()`. There is also a convenience +> function +> `horde_sdk.generic_api.apimodels.HordeAPIModel.to_json_horde_sdk_safe` +> which may be useful. All API models in this library have this method, +> but certain other classes may not. diff --git a/docs/getting_started.md b/docs/getting_started.md new file mode 100644 index 0000000..6c64d57 --- /dev/null +++ b/docs/getting_started.md @@ -0,0 +1,83 @@ +# Getting Started + +See `installation` for installation instructions. + +## General Notes and Guidance + +### Typing + +- Under the hood, **this project is strongly typed**. Practically, + this shouldn't leak out too much and should mostly be contained to + validation logic. + - If you do find something won't work because of type issues, but + you think it should, please [file an issue on + github](https://github.com/Haidra-Org/horde-sdk/issues). +- This project relies very heavily on [pydantic + 2.0](https://docs.pydantic.dev/2.0/). If you are unfamiliar with the + concepts of pydantic, you may be served by glancing at the + documentation for it before consuming this library. + - Every class from this library potentially has validation on its + `__init__(...)` function. You should be prepared to handle + pydantic's ValidationError + exception as a result. + - Most classes from this library have a `model_dump(...)` ([see + the + doc](https://docs.pydantic.dev/2.0/usage/serialization/#modelmodel_dump)) + method which will return a dictionary representation of the + object if you would rather deal with that than the object + itself. + - If you have json or a compatible dict, you can use + [model_validate](https://docs.pydantic.dev/2.0/api/main/#pydantic.main.BaseModel.model_validate) + or + [model_validate_json](https://docs.pydantic.dev/2.0/api/main/#pydantic.main.BaseModel.model_validate_json) + +### Inheritance + +- At first glance, the hierarchy of classes may seem a bit confusing. + Rest assured, however, that these very docs are very helpful here. + All relevant inherited attributes and functions are included in the + child class documentation. Accordingly if you are looking at the + code, and don't want to go up the hierarchy and figure out the + inheritance, use these docs to see the resolved attributes and + functions. + +### Naming + +- Objects serializable to an API request are suffixed with `Request`. +- Objects serializable to an API response are suffixed with + `Response`. +- Objects which are not meant to be instantiated are prefixed with + `Base`. + - These in-between objects are typically logically-speaking parent + classes of multiple API objects, but do not represent an actual + API object on their own. + - See `horde_sdk.generic_api.apimodels` for some of the key + `Base*` classes. +- Certain API models have attributes which would collide with a python + builtin, such as `id` or `type`. In these cases, the attribute has a + trailing underscore, as in `id_`. Ingested json still will work with + the field id\` (its a alias). + +### Faux Immutability (or 'Why can't I change this attribute?!') + +- All of the \*Request and \*Response class, and many other classes, + implement faux immutability, and their attributes are **read only**. +- This is to prevent you from side stepping any validation. +- See [pydantic's + docs](https://docs.pydantic.dev/2.0/usage/validation_errors/#frozen_instance) + for more information. See a +- See also `faq` for more information. + +# Examples + +
+ +
+ +Note + +
+ +TODO: Add examples + +
diff --git a/docs/horde_sdk/.pages b/docs/horde_sdk/.pages new file mode 100644 index 0000000..d8b7cc5 --- /dev/null +++ b/docs/horde_sdk/.pages @@ -0,0 +1 @@ +title: horde_sdk diff --git a/docs/horde_sdk/ai_horde_api/.pages b/docs/horde_sdk/ai_horde_api/.pages new file mode 100644 index 0000000..dc6dba0 --- /dev/null +++ b/docs/horde_sdk/ai_horde_api/.pages @@ -0,0 +1 @@ +title: ai_horde_api diff --git a/docs/horde_sdk/ai_horde_api/ai_horde_client.md b/docs/horde_sdk/ai_horde_api/ai_horde_client.md new file mode 100644 index 0000000..238094c --- /dev/null +++ b/docs/horde_sdk/ai_horde_api/ai_horde_client.md @@ -0,0 +1,2 @@ +# ai_horde_client +::: horde_sdk.ai_horde_api.ai_horde_client diff --git a/docs/horde_sdk/ai_horde_api/apimodels/.pages b/docs/horde_sdk/ai_horde_api/apimodels/.pages new file mode 100644 index 0000000..ca3a870 --- /dev/null +++ b/docs/horde_sdk/ai_horde_api/apimodels/.pages @@ -0,0 +1 @@ +title: apimodels diff --git a/docs/horde_sdk/ai_horde_api/apimodels/_stats.md b/docs/horde_sdk/ai_horde_api/apimodels/_stats.md new file mode 100644 index 0000000..af66e45 --- /dev/null +++ b/docs/horde_sdk/ai_horde_api/apimodels/_stats.md @@ -0,0 +1,2 @@ +# _stats +::: horde_sdk.ai_horde_api.apimodels._stats diff --git a/docs/horde_sdk/ai_horde_api/apimodels/base.md b/docs/horde_sdk/ai_horde_api/apimodels/base.md new file mode 100644 index 0000000..e81bf7d --- /dev/null +++ b/docs/horde_sdk/ai_horde_api/apimodels/base.md @@ -0,0 +1,2 @@ +# base +::: horde_sdk.ai_horde_api.apimodels.base diff --git a/docs/horde_sdk/ai_horde_api/apimodels/generate/.pages b/docs/horde_sdk/ai_horde_api/apimodels/generate/.pages new file mode 100644 index 0000000..28eb2c4 --- /dev/null +++ b/docs/horde_sdk/ai_horde_api/apimodels/generate/.pages @@ -0,0 +1 @@ +title: generate diff --git a/docs/horde_sdk/ai_horde_api/apimodels/generate/_async.md b/docs/horde_sdk/ai_horde_api/apimodels/generate/_async.md new file mode 100644 index 0000000..23cf93f --- /dev/null +++ b/docs/horde_sdk/ai_horde_api/apimodels/generate/_async.md @@ -0,0 +1,2 @@ +# _async +::: horde_sdk.ai_horde_api.apimodels.generate._async diff --git a/docs/horde_sdk/ai_horde_api/apimodels/generate/_check.md b/docs/horde_sdk/ai_horde_api/apimodels/generate/_check.md new file mode 100644 index 0000000..705d0cd --- /dev/null +++ b/docs/horde_sdk/ai_horde_api/apimodels/generate/_check.md @@ -0,0 +1,2 @@ +# _check +::: horde_sdk.ai_horde_api.apimodels.generate._check diff --git a/docs/horde_sdk/ai_horde_api/apimodels/generate/_pop.md b/docs/horde_sdk/ai_horde_api/apimodels/generate/_pop.md new file mode 100644 index 0000000..dd462b5 --- /dev/null +++ b/docs/horde_sdk/ai_horde_api/apimodels/generate/_pop.md @@ -0,0 +1,2 @@ +# _pop +::: horde_sdk.ai_horde_api.apimodels.generate._pop diff --git a/docs/horde_sdk/ai_horde_api/apimodels/generate/_status.md b/docs/horde_sdk/ai_horde_api/apimodels/generate/_status.md new file mode 100644 index 0000000..71b819c --- /dev/null +++ b/docs/horde_sdk/ai_horde_api/apimodels/generate/_status.md @@ -0,0 +1,2 @@ +# _status +::: horde_sdk.ai_horde_api.apimodels.generate._status diff --git a/docs/horde_sdk/ai_horde_api/apimodels/generate/_submit.md b/docs/horde_sdk/ai_horde_api/apimodels/generate/_submit.md new file mode 100644 index 0000000..6226cd3 --- /dev/null +++ b/docs/horde_sdk/ai_horde_api/apimodels/generate/_submit.md @@ -0,0 +1,2 @@ +# _submit +::: horde_sdk.ai_horde_api.apimodels.generate._submit diff --git a/docs/horde_sdk/ai_horde_api/apimodels/workers/.pages b/docs/horde_sdk/ai_horde_api/apimodels/workers/.pages new file mode 100644 index 0000000..5455460 --- /dev/null +++ b/docs/horde_sdk/ai_horde_api/apimodels/workers/.pages @@ -0,0 +1 @@ +title: workers diff --git a/docs/horde_sdk/ai_horde_api/apimodels/workers/_workers_all.md b/docs/horde_sdk/ai_horde_api/apimodels/workers/_workers_all.md new file mode 100644 index 0000000..21f655e --- /dev/null +++ b/docs/horde_sdk/ai_horde_api/apimodels/workers/_workers_all.md @@ -0,0 +1,2 @@ +# _workers_all +::: horde_sdk.ai_horde_api.apimodels.workers._workers_all diff --git a/docs/horde_sdk/ai_horde_api/consts.md b/docs/horde_sdk/ai_horde_api/consts.md new file mode 100644 index 0000000..59fb9fc --- /dev/null +++ b/docs/horde_sdk/ai_horde_api/consts.md @@ -0,0 +1,2 @@ +# consts +::: horde_sdk.ai_horde_api.consts diff --git a/docs/horde_sdk/ai_horde_api/endpoints.md b/docs/horde_sdk/ai_horde_api/endpoints.md new file mode 100644 index 0000000..2b72c22 --- /dev/null +++ b/docs/horde_sdk/ai_horde_api/endpoints.md @@ -0,0 +1,2 @@ +# endpoints +::: horde_sdk.ai_horde_api.endpoints diff --git a/docs/horde_sdk/ai_horde_api/fields.md b/docs/horde_sdk/ai_horde_api/fields.md new file mode 100644 index 0000000..44408a8 --- /dev/null +++ b/docs/horde_sdk/ai_horde_api/fields.md @@ -0,0 +1,2 @@ +# fields +::: horde_sdk.ai_horde_api.fields diff --git a/docs/horde_sdk/ai_horde_api/metadata.md b/docs/horde_sdk/ai_horde_api/metadata.md new file mode 100644 index 0000000..a01f403 --- /dev/null +++ b/docs/horde_sdk/ai_horde_api/metadata.md @@ -0,0 +1,2 @@ +# metadata +::: horde_sdk.ai_horde_api.metadata diff --git a/docs/horde_sdk/ai_horde_worker/.pages b/docs/horde_sdk/ai_horde_worker/.pages new file mode 100644 index 0000000..bd629ca --- /dev/null +++ b/docs/horde_sdk/ai_horde_worker/.pages @@ -0,0 +1 @@ +title: ai_horde_worker diff --git a/docs/horde_sdk/ai_horde_worker/locale_info/.pages b/docs/horde_sdk/ai_horde_worker/locale_info/.pages new file mode 100644 index 0000000..30faca7 --- /dev/null +++ b/docs/horde_sdk/ai_horde_worker/locale_info/.pages @@ -0,0 +1 @@ +title: locale_info diff --git a/docs/horde_sdk/consts.md b/docs/horde_sdk/consts.md new file mode 100644 index 0000000..d2e0f6d --- /dev/null +++ b/docs/horde_sdk/consts.md @@ -0,0 +1,2 @@ +# consts +::: horde_sdk.consts diff --git a/docs/horde_sdk/generic_api/.pages b/docs/horde_sdk/generic_api/.pages new file mode 100644 index 0000000..f574d07 --- /dev/null +++ b/docs/horde_sdk/generic_api/.pages @@ -0,0 +1 @@ +title: generic_api diff --git a/docs/horde_sdk/generic_api/_reflection.md b/docs/horde_sdk/generic_api/_reflection.md new file mode 100644 index 0000000..a72933c --- /dev/null +++ b/docs/horde_sdk/generic_api/_reflection.md @@ -0,0 +1,2 @@ +# _reflection +::: horde_sdk.generic_api._reflection diff --git a/docs/horde_sdk/generic_api/apimodels.md b/docs/horde_sdk/generic_api/apimodels.md new file mode 100644 index 0000000..2557f88 --- /dev/null +++ b/docs/horde_sdk/generic_api/apimodels.md @@ -0,0 +1,2 @@ +# apimodels +::: horde_sdk.generic_api.apimodels diff --git a/docs/horde_sdk/generic_api/endpoints.md b/docs/horde_sdk/generic_api/endpoints.md new file mode 100644 index 0000000..d3a1ef6 --- /dev/null +++ b/docs/horde_sdk/generic_api/endpoints.md @@ -0,0 +1,2 @@ +# endpoints +::: horde_sdk.generic_api.endpoints diff --git a/docs/horde_sdk/generic_api/generic_client.md b/docs/horde_sdk/generic_api/generic_client.md new file mode 100644 index 0000000..276785d --- /dev/null +++ b/docs/horde_sdk/generic_api/generic_client.md @@ -0,0 +1,2 @@ +# generic_client +::: horde_sdk.generic_api.generic_client diff --git a/docs/horde_sdk/generic_api/metadata.md b/docs/horde_sdk/generic_api/metadata.md new file mode 100644 index 0000000..2358fe8 --- /dev/null +++ b/docs/horde_sdk/generic_api/metadata.md @@ -0,0 +1,2 @@ +# metadata +::: horde_sdk.generic_api.metadata diff --git a/docs/horde_sdk/generic_api/utils/.pages b/docs/horde_sdk/generic_api/utils/.pages new file mode 100644 index 0000000..2c9da37 --- /dev/null +++ b/docs/horde_sdk/generic_api/utils/.pages @@ -0,0 +1 @@ +title: utils diff --git a/docs/horde_sdk/generic_api/utils/swagger.md b/docs/horde_sdk/generic_api/utils/swagger.md new file mode 100644 index 0000000..99900fa --- /dev/null +++ b/docs/horde_sdk/generic_api/utils/swagger.md @@ -0,0 +1,2 @@ +# swagger +::: horde_sdk.generic_api.utils.swagger diff --git a/docs/horde_sdk/locales/.pages b/docs/horde_sdk/locales/.pages new file mode 100644 index 0000000..427e412 --- /dev/null +++ b/docs/horde_sdk/locales/.pages @@ -0,0 +1 @@ +title: locales diff --git a/docs/horde_sdk/localize.md b/docs/horde_sdk/localize.md new file mode 100644 index 0000000..ccfb205 --- /dev/null +++ b/docs/horde_sdk/localize.md @@ -0,0 +1,2 @@ +# localize +::: horde_sdk.localize diff --git a/docs/horde_sdk/ratings_api/.pages b/docs/horde_sdk/ratings_api/.pages new file mode 100644 index 0000000..1522299 --- /dev/null +++ b/docs/horde_sdk/ratings_api/.pages @@ -0,0 +1 @@ +title: ratings_api diff --git a/docs/horde_sdk/ratings_api/apimodels.md b/docs/horde_sdk/ratings_api/apimodels.md new file mode 100644 index 0000000..18eb8c8 --- /dev/null +++ b/docs/horde_sdk/ratings_api/apimodels.md @@ -0,0 +1,2 @@ +# apimodels +::: horde_sdk.ratings_api.apimodels diff --git a/docs/horde_sdk/ratings_api/endpoints.md b/docs/horde_sdk/ratings_api/endpoints.md new file mode 100644 index 0000000..98d6cc7 --- /dev/null +++ b/docs/horde_sdk/ratings_api/endpoints.md @@ -0,0 +1,2 @@ +# endpoints +::: horde_sdk.ratings_api.endpoints diff --git a/docs/horde_sdk/ratings_api/metadata.md b/docs/horde_sdk/ratings_api/metadata.md new file mode 100644 index 0000000..fc5bc05 --- /dev/null +++ b/docs/horde_sdk/ratings_api/metadata.md @@ -0,0 +1,2 @@ +# metadata +::: horde_sdk.ratings_api.metadata diff --git a/docs/horde_sdk/ratings_api/ratings_client.md b/docs/horde_sdk/ratings_api/ratings_client.md new file mode 100644 index 0000000..25933fb --- /dev/null +++ b/docs/horde_sdk/ratings_api/ratings_client.md @@ -0,0 +1,2 @@ +# ratings_client +::: horde_sdk.ratings_api.ratings_client diff --git a/docs/horde_sdk/scripts/.pages b/docs/horde_sdk/scripts/.pages new file mode 100644 index 0000000..a0fde6f --- /dev/null +++ b/docs/horde_sdk/scripts/.pages @@ -0,0 +1 @@ +title: scripts diff --git a/docs/horde_sdk/scripts/write_all_payload_examples.md b/docs/horde_sdk/scripts/write_all_payload_examples.md new file mode 100644 index 0000000..2fba08d --- /dev/null +++ b/docs/horde_sdk/scripts/write_all_payload_examples.md @@ -0,0 +1,2 @@ +# write_all_payload_examples +::: horde_sdk.scripts.write_all_payload_examples diff --git a/docs/horde_sdk/scripts/write_all_response_examples.md b/docs/horde_sdk/scripts/write_all_response_examples.md new file mode 100644 index 0000000..dd1378f --- /dev/null +++ b/docs/horde_sdk/scripts/write_all_response_examples.md @@ -0,0 +1,2 @@ +# write_all_response_examples +::: horde_sdk.scripts.write_all_response_examples diff --git a/docs/horde_sdk/utils.md b/docs/horde_sdk/utils.md new file mode 100644 index 0000000..d07844f --- /dev/null +++ b/docs/horde_sdk/utils.md @@ -0,0 +1,2 @@ +# utils +::: horde_sdk.utils diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..291ca38 --- /dev/null +++ b/docs/index.md @@ -0,0 +1 @@ +# Home diff --git a/docs/source/usage.rst b/docs/installation.md similarity index 56% rename from docs/source/usage.rst rename to docs/installation.md index e3628b6..2ce5d57 100644 --- a/docs/source/usage.rst +++ b/docs/installation.md @@ -1,13 +1,9 @@ -Usage -===== - -Installation ------------- +title: Installation To get started, you need to install the package into your project: -.. code-block:: console - - pip install horde_sdk +``` console +pip install horde_sdk +``` Note that this package requires 3.10 or higher. diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index dc1312a..0000000 --- a/docs/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=source -set BUILDDIR=build - -%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 -) - -if "%1" == "" goto help - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/docs/source/conf.py b/docs/source/conf.py deleted file mode 100644 index 7c85ac3..0000000 --- a/docs/source/conf.py +++ /dev/null @@ -1,42 +0,0 @@ -# Configuration file for the Sphinx documentation builder. -# -# For the full list of built-in configuration values, see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - - -import pathlib -import sys - -# -- Path setup -------------------------------------------------------------- -sys.path.insert(0, str(pathlib.Path(__file__).parent.parent.parent / "src")) - -# -- Project information ----------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information - -project = "horde_sdk" -copyright = "2023, hairda-org" # noqa: A001 -author = "tazlin, db0" -release = "0.1.x" - -# -- General configuration --------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration - -extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon"] - -templates_path = ["_templates"] -exclude_patterns: list[str] = [] - -autodoc_default_options = { - "members": True, - "member-order": "bysource", - "undoc-members": "__init__", - "exclude-members": "__weakref__,model_fields,model_config", -} - -# -- Options for HTML output ------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output - -html_theme = "sphinx_rtd_theme" -# html_theme = "groundwork" - -html_static_path = ["_static"] diff --git a/docs/source/horde_sdk.ai_horde_api.apimodels.generate.rst b/docs/source/horde_sdk.ai_horde_api.apimodels.generate.rst deleted file mode 100644 index 5af2111..0000000 --- a/docs/source/horde_sdk.ai_horde_api.apimodels.generate.rst +++ /dev/null @@ -1,10 +0,0 @@ -horde\_sdk.ai\_horde\_api.apimodels.generate package -==================================================== - -Module contents ---------------- - -.. automodule:: horde_sdk.ai_horde_api.apimodels.generate - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/horde_sdk.ai_horde_api.apimodels.rst b/docs/source/horde_sdk.ai_horde_api.apimodels.rst deleted file mode 100644 index 899d551..0000000 --- a/docs/source/horde_sdk.ai_horde_api.apimodels.rst +++ /dev/null @@ -1,29 +0,0 @@ -horde\_sdk.ai\_horde\_api.apimodels package -=========================================== - -Subpackages ------------ - -.. toctree:: - :maxdepth: 4 - - horde_sdk.ai_horde_api.apimodels.generate - -Submodules ----------- - -horde\_sdk.ai\_horde\_api.apimodels.base module ------------------------------------------------ - -.. automodule:: horde_sdk.ai_horde_api.apimodels.base - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: horde_sdk.ai_horde_api.apimodels - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/horde_sdk.ai_horde_api.rst b/docs/source/horde_sdk.ai_horde_api.rst deleted file mode 100644 index 4ea7570..0000000 --- a/docs/source/horde_sdk.ai_horde_api.rst +++ /dev/null @@ -1,61 +0,0 @@ -horde\_sdk.ai\_horde\_api package -================================= - -Subpackages ------------ - -.. toctree:: - :maxdepth: 4 - - horde_sdk.ai_horde_api.apimodels - -Submodules ----------- - -horde\_sdk.ai\_horde\_api.ai\_horde\_client module --------------------------------------------------- - -.. automodule:: horde_sdk.ai_horde_api.ai_horde_client - :members: - :undoc-members: - :show-inheritance: - -horde\_sdk.ai\_horde\_api.consts module ---------------------------------------- - -.. automodule:: horde_sdk.ai_horde_api.consts - :members: - :undoc-members: - :show-inheritance: - -horde\_sdk.ai\_horde\_api.endpoints module ------------------------------------------- - -.. automodule:: horde_sdk.ai_horde_api.endpoints - :members: - :undoc-members: - :show-inheritance: - -horde\_sdk.ai\_horde\_api.fields module ---------------------------------------- - -.. automodule:: horde_sdk.ai_horde_api.fields - :members: - :undoc-members: - :show-inheritance: - -horde\_sdk.ai\_horde\_api.metadata module ------------------------------------------ - -.. automodule:: horde_sdk.ai_horde_api.metadata - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: horde_sdk.ai_horde_api - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/horde_sdk.ai_horde_worker.locale_info.rst b/docs/source/horde_sdk.ai_horde_worker.locale_info.rst deleted file mode 100644 index 9df9dd0..0000000 --- a/docs/source/horde_sdk.ai_horde_worker.locale_info.rst +++ /dev/null @@ -1,21 +0,0 @@ -horde\_sdk.ai\_horde\_worker.locale\_info package -================================================= - -Submodules ----------- - -horde\_sdk.ai\_horde\_worker.locale\_info.bridge\_data\_fields module ---------------------------------------------------------------------- - -.. automodule:: horde_sdk.ai_horde_worker.locale_info.bridge_data_fields - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: horde_sdk.ai_horde_worker.locale_info - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/horde_sdk.ai_horde_worker.rst b/docs/source/horde_sdk.ai_horde_worker.rst deleted file mode 100644 index 34daaf7..0000000 --- a/docs/source/horde_sdk.ai_horde_worker.rst +++ /dev/null @@ -1,37 +0,0 @@ -horde\_sdk.ai\_horde\_worker package -==================================== - -Subpackages ------------ - -.. toctree:: - :maxdepth: 4 - - horde_sdk.ai_horde_worker.locale_info - -Submodules ----------- - -horde\_sdk.ai\_horde\_worker.bridge\_data module ------------------------------------------------- - -.. automodule:: horde_sdk.ai_horde_worker.bridge_data - :members: - :undoc-members: - :show-inheritance: - -horde\_sdk.ai\_horde\_worker.kudos module ------------------------------------------ - -.. automodule:: horde_sdk.ai_horde_worker.kudos - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: horde_sdk.ai_horde_worker - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/horde_sdk.generic_api.rst b/docs/source/horde_sdk.generic_api.rst deleted file mode 100644 index 37f9d5a..0000000 --- a/docs/source/horde_sdk.generic_api.rst +++ /dev/null @@ -1,45 +0,0 @@ -horde\_sdk.generic\_api package -=============================== - -Submodules ----------- - -horde\_sdk.generic\_api.apimodels module ----------------------------------------- - -.. automodule:: horde_sdk.generic_api.apimodels - :members: - :undoc-members: - :show-inheritance: - -horde\_sdk.generic\_api.endpoints module ----------------------------------------- - -.. automodule:: horde_sdk.generic_api.endpoints - :members: - :undoc-members: - :show-inheritance: - -horde\_sdk.generic\_api.generic\_client module ----------------------------------------------- - -.. automodule:: horde_sdk.generic_api.generic_client - :members: - :undoc-members: - :show-inheritance: - -horde\_sdk.generic\_api.metadata module ---------------------------------------- - -.. automodule:: horde_sdk.generic_api.metadata - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: horde_sdk.generic_api - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/horde_sdk.ratings_api.rst b/docs/source/horde_sdk.ratings_api.rst deleted file mode 100644 index f6ddb26..0000000 --- a/docs/source/horde_sdk.ratings_api.rst +++ /dev/null @@ -1,45 +0,0 @@ -horde\_sdk.ratings\_api package -=============================== - -Submodules ----------- - -horde\_sdk.ratings\_api.apimodels module ----------------------------------------- - -.. automodule:: horde_sdk.ratings_api.apimodels - :members: - :undoc-members: - :show-inheritance: - -horde\_sdk.ratings\_api.endpoints module ----------------------------------------- - -.. automodule:: horde_sdk.ratings_api.endpoints - :members: - :undoc-members: - :show-inheritance: - -horde\_sdk.ratings\_api.metadata module ---------------------------------------- - -.. automodule:: horde_sdk.ratings_api.metadata - :members: - :undoc-members: - :show-inheritance: - -horde\_sdk.ratings\_api.ratings\_client module ----------------------------------------------- - -.. automodule:: horde_sdk.ratings_api.ratings_client - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: horde_sdk.ratings_api - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/horde_sdk.rst b/docs/source/horde_sdk.rst deleted file mode 100644 index e92bd71..0000000 --- a/docs/source/horde_sdk.rst +++ /dev/null @@ -1,48 +0,0 @@ -horde\_sdk package -================== - -Subpackages ------------ - -.. toctree:: - :maxdepth: 4 - - horde_sdk.ai_horde_api - horde_sdk.ai_horde_worker - horde_sdk.generic_api - horde_sdk.ratings_api - -Submodules ----------- - -horde\_sdk.consts module ------------------------- - -.. automodule:: horde_sdk.consts - :members: - :undoc-members: - :show-inheritance: - -horde\_sdk.localize module --------------------------- - -.. automodule:: horde_sdk.localize - :members: - :undoc-members: - :show-inheritance: - -horde\_sdk.utils module ------------------------ - -.. automodule:: horde_sdk.utils - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: horde_sdk - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/index.rst b/docs/source/index.rst deleted file mode 100644 index 6d47163..0000000 --- a/docs/source/index.rst +++ /dev/null @@ -1,31 +0,0 @@ -.. horde_sdk documentation master file, created by - sphinx-quickstart on Fri Jul 7 10:37:15 2023. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to horde_sdk's documentation! -===================================== - -**horde_sdk** is a Python library for interacting with the AI-Horde API and for working in its ecosystem. - -.. note:: - **horde_sdk** is currently in alpha. Everything is subject to change. - -To get started, check out the :ref:`Installation` section. - -.. toctree:: - :maxdepth: 2 - - modules - horde_sdk - horde_sdk.ai_horde_api - horde_sdk.generic_api - - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/docs/source/modules.rst b/docs/source/modules.rst deleted file mode 100644 index 8f5299e..0000000 --- a/docs/source/modules.rst +++ /dev/null @@ -1,7 +0,0 @@ -src -=== - -.. toctree:: - :maxdepth: 4 - - horde_sdk diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css new file mode 100644 index 0000000..b496434 --- /dev/null +++ b/docs/stylesheets/extra.css @@ -0,0 +1,67 @@ +.doc-object-name { + font-weight: bold; + letter-spacing: 0.0em; +} +.doc.doc-children .doc-object { + background-color: rgb(240, 240, 240); + padding-left: 3px; + padding-right: 3px; +} + +.doc-label code { + background-color: rgb(222, 222, 222); + +} + +.md-typeset h2 { + line-height: unset; + margin: unset; +} + +.md-typeset details { + padding: 0 +} + + +.md-typeset .highlighttable { + margin: 0; +} + +[dir=ltr] .md-typeset summary { + margin: 0; +} + +.md-typeset{ + line-height: 1.3; +} + +h3.doc-heading { + margin: 0 0 5px 0; + font-size: 1.25em; +} + +details.quote div.highlight { + margin: 0; +} + +code { + font-weight: 500; +} + +.highlight.language-python{ + font-weight: bold; + +} + +.doc-label-async code{ + color: red; + font-weight: bold; +} +.doc-attribute h2 code span{ + font-size: 0.7em; +} + + +.md-nav__item--nested label { + font-style: italic; +}