Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 4236994

Browse files
Docs and some other stuff
1 parent 4eafabd commit 4236994

File tree

16 files changed

+1534
-152
lines changed

16 files changed

+1534
-152
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,6 @@ dmypy.json
130130

131131
# Pyre type checker
132132
.pyre/
133+
134+
# VSCode Config
135+
.vscode

.readthedocs.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
3+
sphinx:
4+
builder: html
5+
configuration: docs/conf.py
6+
fail_on_warning: false
7+
8+
python:
9+
version: 3.8
10+
install:
11+
- method: pip
12+
path: .
13+
extra_requirements:
14+
- docs
15+
- method: setuptools
16+
path: .

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.rst

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
OpenRobot API Wrapper Documentation
2+
===================================
3+
4+
Client
5+
------
6+
7+
AsyncClient
8+
~~~~~~~~~~~
9+
10+
.. autoclass:: openrobot.api_wrapper.AsyncClient
11+
:members:
12+
:exclude-members: _get_authorization_headers, _request
13+
14+
SyncClient
15+
~~~~~~~~~~
16+
17+
.. autoclass:: openrobot.api_wrapper.SyncClient
18+
:members:
19+
:exclude-members: _get_authorization_headers, _request
20+
21+
Translate
22+
---------
23+
24+
Translate
25+
~~~~~~~~~
26+
27+
.. autoclass:: openrobot.api_wrapper.Translate()
28+
:members: __call__, languages
29+
30+
Results
31+
-------
32+
33+
.. autoclass:: openrobot.api_wrapper.LyricResult()
34+
:members:
35+
:inherited-members:
36+
37+
.. autoclass:: openrobot.api_wrapper.NSFWLabel()
38+
:members:
39+
:inherited-members:
40+
41+
.. autoclass:: openrobot.api_wrapper.NSFWCheckResult()
42+
:members:
43+
:inherited-members:
44+
45+
.. autoclass:: openrobot.api_wrapper.CelebrityFaceBoundingBoxProperty()
46+
:members:
47+
:inherited-members:
48+
49+
.. autoclass:: openrobot.api_wrapper.CelebrityFaceLandmarksCoordinateLandmarksProperty()
50+
:members:
51+
:inherited-members:
52+
53+
.. autoclass:: openrobot.api_wrapper.CelebrityFaceLandmarksProperty()
54+
:members:
55+
:inherited-members:
56+
57+
.. autoclass:: openrobot.api_wrapper.CelebrityFacePose()
58+
:members:
59+
:inherited-members:
60+
61+
.. autoclass:: openrobot.api_wrapper.CelebrityFaceQuality()
62+
:members:
63+
:inherited-members:
64+
65+
.. autoclass:: openrobot.api_wrapper.CelebrityFaceEmotion()
66+
:members:
67+
:inherited-members:
68+
69+
.. autoclass:: openrobot.api_wrapper.CelebrityFaceSmile()
70+
:members:
71+
:inherited-members:
72+
73+
.. autoclass:: openrobot.api_wrapper.CelebrityFaceProperty()
74+
:members:
75+
:inherited-members:
76+
77+
.. autoclass:: openrobot.api_wrapper.CelebrityResult()
78+
:members:
79+
:inherited-members:
80+
81+
.. autoclass:: openrobot.api_wrapper.OCRResult()
82+
:members:
83+
:inherited-members:
84+
85+
.. autoclass:: openrobot.api_wrapper.TranslateResult()
86+
:members:
87+
:inherited-members:

docs/conf.py

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
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+
import re
16+
sys.path.insert(0, os.path.abspath('.'))
17+
sys.path.insert(0, os.path.abspath('..'))
18+
19+
20+
# -- Project information -----------------------------------------------------
21+
22+
project = 'OpenRobot API Wrapper'
23+
copyright = '2021, OpenRobot Packages'
24+
author = 'OpenRobot Packages'
25+
26+
version = ''
27+
with open('../openrobot/api_wrapper/__init__.py') as f:
28+
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1)
29+
30+
# The full version, including alpha/beta/rc tags.
31+
release = version
32+
33+
34+
# -- General configuration ---------------------------------------------------
35+
36+
# Add any Sphinx extension module names here, as strings. They can be
37+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
38+
# ones.
39+
extensions = [
40+
'sphinx.ext.autodoc',
41+
'sphinx.ext.extlinks',
42+
'sphinx.ext.intersphinx',
43+
'sphinx.ext.napoleon',
44+
# 'sphinxcontrib-asyncio'
45+
]
46+
47+
napoleon_google_docstring = False
48+
napoleon_numpy_docstring = True
49+
50+
intersphinx_mapping = {
51+
'py': ('https://docs.python.org/3', None),
52+
'aiohttp': ('https://docs.aiohttp.org/en/latest', None),
53+
'requests': ('https://docs.python-requests.org/en/latest/', None)
54+
}
55+
56+
rst_prolog = """
57+
.. |coro| replace:: This function is a |coroutine_link|_.
58+
.. |maybecoro| replace:: This function *could be a* |coroutine_link|_.
59+
.. |coroutine_link| replace:: *coroutine*
60+
.. _coroutine_link: https://docs.python.org/3/library/asyncio-task.html#coroutine
61+
"""
62+
63+
# Add any paths that contain templates here, relative to this directory.
64+
templates_path = []
65+
66+
# List of patterns, relative to source directory, that match files and
67+
# directories to ignore when looking for source files.
68+
# This pattern also affects html_static_path and html_extra_path.
69+
exclude_patterns = ['_build']
70+
71+
72+
# -- Options for HTML output -------------------------------------------------
73+
74+
# The theme to use for HTML and HTML Help pages. See the documentation for
75+
# a list of builtin themes.
76+
#
77+
html_theme = 'karma_sphinx_theme'
78+
79+
html_theme_options = {}
80+
81+
# Add any paths that contain custom static files (such as style sheets) here,
82+
# relative to this directory. They are copied after the builtin static files,
83+
# so a file named "default.css" will overwrite the builtin "default.css".
84+
html_static_path = ['./_static']

docs/index.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
Welcome to OpenRobot API Wrapper's documentation!
2+
=================================================
3+
4+
OpenRobot API Wrapper
5+
---------------------
6+
A package to support `OpenRobot API`_
7+
8+
.. _OpenRobot API: https://api.openrobot.xyz
9+
10+
**Features**
11+
12+
* Synchronous and Asynchronous support.
13+
* Easy to use.
14+
15+
Help and Support
16+
================
17+
DM `proguy914629#5419`_ for support.
18+
19+
.. _proguy914629#5419: https://discord.com/users/699839134709317642
20+
21+
22+
23+
.. toctree::
24+
:maxdepth: 1
25+
:caption: Getting Started:
26+
27+
quickstart.rst
28+
29+
30+
**OpenRobot API Wrapper Documentation**
31+
32+
.. toctree::
33+
:maxdepth: 2
34+
:caption: You can view the documentation here:
35+
36+
api.rst
37+
38+
Index and Search
39+
==================
40+
41+
* :ref:`genindex`
42+
* :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+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.https://www.sphinx-doc.org/
25+
exit /b 1
26+
)
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

docs/quickstart.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
OpenRobot API Wrapper Quickstart
2+
================================
3+
4+
Installing
5+
----------
6+
You can install OpenRobot API Wrapper by doing:
7+
8+
.. code-block:: console
9+
10+
$ pip install git+https://github.com/OpenRobot-Packages/Python-API-Wrapper
11+
12+
If you are having problems to install, try reading `I failed to install a OpenRobot Packages repo. What should i do?`_
13+
14+
.. _I failed to install a OpenRobot Packages repo. What should i do?: https://github.com/OpenRobot-Packages/Python-OpenRobot-Packages#i-failed-to-install-a-openrobot-packages-repo-what-should-i-do
15+
16+
Examples
17+
--------
18+
Examples can be found in the `examples directory`_ on GitHub.
19+
20+
.. _examples directory: https://github.com/OpenRobot-Packages/Python-API-Wrapper/tree/main/examples

openrobot/api_wrapper/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
from ._sync import *
33
from .error import *
44
from .results import *
5+
from .translate import *
6+
7+
from . import _async, _sync, translate, results, error
58

69
__version__ = '0.2.0'

0 commit comments

Comments
 (0)