Skip to content

Commit 81056d0

Browse files
committed
sphinx docs
1 parent d00a4ed commit 81056d0

9 files changed

Lines changed: 1453 additions & 2 deletions

File tree

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_build/

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 ?= uv run 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/index.rst

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
API Reference
2+
=============
3+
4+
This section contains detailed API documentation for the Runloop SDK.
5+
6+
.. toctree::
7+
:maxdepth: 2
8+
9+
typedicts
10+
11+
SDK Classes
12+
-----------
13+
14+
Synchronous SDK
15+
~~~~~~~~~~~~~~~
16+
17+
.. autoclass:: runloop_api_client.RunloopSDK
18+
:members:
19+
:undoc-members:
20+
:show-inheritance:
21+
22+
.. autoclass:: runloop_api_client.sdk.sync.DevboxOps
23+
:members:
24+
:undoc-members:
25+
:show-inheritance:
26+
27+
.. autoclass:: runloop_api_client.sdk.sync.BlueprintOps
28+
:members:
29+
:undoc-members:
30+
:show-inheritance:
31+
32+
.. autoclass:: runloop_api_client.sdk.sync.SnapshotOps
33+
:members:
34+
:undoc-members:
35+
:show-inheritance:
36+
37+
.. autoclass:: runloop_api_client.sdk.sync.StorageObjectOps
38+
:members:
39+
:undoc-members:
40+
:show-inheritance:
41+
42+
Resource Classes
43+
~~~~~~~~~~~~~~~~
44+
45+
.. autoclass:: runloop_api_client.sdk.devbox.Devbox
46+
:members:
47+
:undoc-members:
48+
:show-inheritance:
49+
50+
.. autoclass:: runloop_api_client.sdk.blueprint.Blueprint
51+
:members:
52+
:undoc-members:
53+
:show-inheritance:
54+
55+
.. autoclass:: runloop_api_client.sdk.snapshot.Snapshot
56+
:members:
57+
:undoc-members:
58+
:show-inheritance:
59+
60+
.. autoclass:: runloop_api_client.sdk.storage_object.StorageObject
61+
:members:
62+
:undoc-members:
63+
:show-inheritance:
64+
65+
.. autoclass:: runloop_api_client.sdk.execution.Execution
66+
:members:
67+
:undoc-members:
68+
:show-inheritance:
69+
70+
.. autoclass:: runloop_api_client.sdk.execution_result.ExecutionResult
71+
:members:
72+
:undoc-members:
73+
:show-inheritance:
74+
75+
Asynchronous SDK
76+
~~~~~~~~~~~~~~~~
77+
78+
.. autoclass:: runloop_api_client.AsyncRunloopSDK
79+
:members:
80+
:undoc-members:
81+
:show-inheritance:
82+
83+
.. autoclass:: runloop_api_client.sdk.async_.AsyncDevboxOps
84+
:members:
85+
:undoc-members:
86+
:show-inheritance:
87+
88+
.. autoclass:: runloop_api_client.sdk.async_.AsyncBlueprintOps
89+
:members:
90+
:undoc-members:
91+
:show-inheritance:
92+
93+
.. autoclass:: runloop_api_client.sdk.async_.AsyncSnapshotOps
94+
:members:
95+
:undoc-members:
96+
:show-inheritance:
97+
98+
.. autoclass:: runloop_api_client.sdk.async_.AsyncStorageObjectOps
99+
:members:
100+
:undoc-members:
101+
:show-inheritance:
102+
103+
Asynchronous Resource Classes
104+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
105+
106+
.. autoclass:: runloop_api_client.sdk.async_devbox.AsyncDevbox
107+
:members:
108+
:undoc-members:
109+
:show-inheritance:
110+
111+
.. autoclass:: runloop_api_client.sdk.async_blueprint.AsyncBlueprint
112+
:members:
113+
:undoc-members:
114+
:show-inheritance:
115+
116+
.. autoclass:: runloop_api_client.sdk.async_snapshot.AsyncSnapshot
117+
:members:
118+
:undoc-members:
119+
:show-inheritance:
120+
121+
.. autoclass:: runloop_api_client.sdk.async_storage_object.AsyncStorageObject
122+
:members:
123+
:undoc-members:
124+
:show-inheritance:
125+
126+
.. autoclass:: runloop_api_client.sdk.async_execution.AsyncExecution
127+
:members:
128+
:undoc-members:
129+
:show-inheritance:
130+
131+
.. autoclass:: runloop_api_client.sdk.async_execution_result.AsyncExecutionResult
132+
:members:
133+
:undoc-members:
134+
:show-inheritance:
135+

docs/api/typedicts.rst

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
TypedDict Reference
2+
===================
3+
4+
This page documents all TypedDict parameter types used throughout the SDK.
5+
These typed dictionaries define the structure of parameters passed to SDK methods.
6+
7+
SDK TypedDicts
8+
--------------
9+
10+
These are the primary TypedDict classes used in SDK methods, combining multiple
11+
parameter types and options.
12+
13+
Core Request Options
14+
~~~~~~~~~~~~~~~~~~~~
15+
16+
.. autotypeddict:: runloop_api_client.sdk._types.ExecuteStreamingCallbacks
17+
18+
.. autotypeddict:: runloop_api_client.sdk._types.RequestOptions
19+
20+
.. autotypeddict:: runloop_api_client.sdk._types.LongRequestOptions
21+
22+
.. autotypeddict:: runloop_api_client.sdk._types.PollingRequestOptions
23+
24+
.. autotypeddict:: runloop_api_client.sdk._types.LongPollingRequestOptions
25+
26+
Devbox Parameters
27+
~~~~~~~~~~~~~~~~~
28+
29+
.. autotypeddict:: runloop_api_client.sdk._types.SDKDevboxCreateParams
30+
31+
.. autotypeddict:: runloop_api_client.sdk._types.SDKDevboxExtraCreateParams
32+
33+
.. autotypeddict:: runloop_api_client.sdk._types.SDKDevboxExecuteParams
34+
35+
.. autotypeddict:: runloop_api_client.sdk._types.SDKDevboxExecuteAsyncParams
36+
37+
.. autotypeddict:: runloop_api_client.sdk._types.SDKDevboxListParams
38+
39+
File Operation Parameters
40+
~~~~~~~~~~~~~~~~~~~~~~~~~
41+
42+
.. autotypeddict:: runloop_api_client.sdk._types.SDKDevboxReadFileContentsParams
43+
44+
.. autotypeddict:: runloop_api_client.sdk._types.SDKDevboxWriteFileContentsParams
45+
46+
.. autotypeddict:: runloop_api_client.sdk._types.SDKDevboxDownloadFileParams
47+
48+
.. autotypeddict:: runloop_api_client.sdk._types.SDKDevboxUploadFileParams
49+
50+
Network Operation Parameters
51+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
52+
53+
.. autotypeddict:: runloop_api_client.sdk._types.SDKDevboxCreateTunnelParams
54+
55+
.. autotypeddict:: runloop_api_client.sdk._types.SDKDevboxRemoveTunnelParams
56+
57+
Snapshot Parameters
58+
~~~~~~~~~~~~~~~~~~~
59+
60+
.. autotypeddict:: runloop_api_client.sdk._types.SDKDevboxSnapshotDiskParams
61+
62+
.. autotypeddict:: runloop_api_client.sdk._types.SDKDevboxSnapshotDiskAsyncParams
63+
64+
.. autotypeddict:: runloop_api_client.sdk._types.SDKDiskSnapshotListParams
65+
66+
.. autotypeddict:: runloop_api_client.sdk._types.SDKDiskSnapshotUpdateParams
67+
68+
Blueprint Parameters
69+
~~~~~~~~~~~~~~~~~~~~
70+
71+
.. autotypeddict:: runloop_api_client.sdk._types.SDKBlueprintCreateParams
72+
73+
.. autotypeddict:: runloop_api_client.sdk._types.SDKBlueprintListParams
74+
75+
Storage Object Parameters
76+
~~~~~~~~~~~~~~~~~~~~~~~~~
77+
78+
.. autotypeddict:: runloop_api_client.sdk._types.SDKObjectCreateParams
79+
80+
.. autotypeddict:: runloop_api_client.sdk._types.SDKObjectListParams
81+
82+
.. autotypeddict:: runloop_api_client.sdk._types.SDKObjectDownloadParams

docs/conf.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
6+
import os
7+
import sys
8+
9+
# Add the src directory to the path so we can import the package
10+
sys.path.insert(0, os.path.abspath('../src'))
11+
12+
# -- Project information -----------------------------------------------------
13+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
14+
15+
project = 'Runloop Python SDK'
16+
copyright = '2025, Runloop'
17+
author = 'Runloop'
18+
release = '0.68.0'
19+
20+
# -- General configuration ---------------------------------------------------
21+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
22+
23+
extensions = [
24+
'sphinx.ext.autodoc',
25+
'sphinx.ext.napoleon',
26+
'sphinx.ext.intersphinx',
27+
'sphinx.ext.viewcode',
28+
'sphinx_toolbox.more_autodoc.autotypeddict',
29+
'sphinx_autodoc_typehints',
30+
]
31+
32+
templates_path = ['_templates']
33+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
34+
35+
# -- Options for HTML output -------------------------------------------------
36+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
37+
38+
html_theme = 'furo'
39+
html_static_path = ['_static']
40+
41+
# -- Extension configuration -------------------------------------------------
42+
43+
# Napoleon settings
44+
napoleon_google_docstring = False
45+
napoleon_numpy_docstring = False
46+
napoleon_use_param = True
47+
napoleon_use_rtype = True
48+
napoleon_use_ivar = True
49+
50+
# Autodoc settings
51+
autodoc_default_options = {
52+
'members': None,
53+
'undoc-members': None,
54+
'show-inheritance': None,
55+
}
56+
57+
autodoc_typehints = 'description'
58+
autodoc_typehints_description_target = 'documented'
59+
60+
# Intersphinx mapping
61+
intersphinx_mapping = {
62+
'python': ('https://docs.python.org/3', None),
63+
'httpx': ('https://www.python-httpx.org', None),
64+
}
65+

docs/index.rst

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
Runloop Python SDK Documentation
2+
==================================
3+
4+
The Runloop Python SDK provides a Pythonic, object-oriented interface for managing
5+
devboxes, blueprints, snapshots, and storage objects. The SDK offers both synchronous
6+
and asynchronous variants to match your runtime requirements.
7+
8+
.. toctree::
9+
:maxdepth: 2
10+
:caption: Contents:
11+
12+
api/index
13+
14+
Installation
15+
------------
16+
17+
Install the SDK using pip:
18+
19+
.. code-block:: bash
20+
21+
pip install runloop_api_client
22+
23+
Quick Start
24+
-----------
25+
26+
Synchronous Example
27+
~~~~~~~~~~~~~~~~~~~
28+
29+
.. code-block:: python
30+
31+
from runloop_api_client import RunloopSDK
32+
33+
runloop = RunloopSDK()
34+
35+
# Create a ready-to-use devbox
36+
with runloop.devbox.create(name="my-devbox") as devbox:
37+
result = devbox.cmd.exec(command="echo 'Hello from Runloop!'")
38+
print(result.stdout())
39+
40+
Asynchronous Example
41+
~~~~~~~~~~~~~~~~~~~~
42+
43+
.. code-block:: python
44+
45+
from runloop_api_client import AsyncRunloopSDK
46+
47+
async def main():
48+
runloop = AsyncRunloopSDK()
49+
50+
async with runloop.devbox.create(name="my-devbox") as devbox:
51+
result = await devbox.cmd.exec(command="echo 'Hello from Runloop!'")
52+
print(await result.stdout())
53+
54+
import asyncio
55+
asyncio.run(main())
56+
57+
Indices and tables
58+
==================
59+
60+
* :ref:`genindex`
61+
* :ref:`modindex`
62+
* :ref:`search`
63+

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
furo==2021.11.16

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ dev = [
6464
"uuid-utils>=0.11.0",
6565
"pytest-cov>=7.0.0",
6666
]
67+
docs = [
68+
"furo>=2025.9.25",
69+
"sphinx>=7.4.7",
70+
"sphinx-autodoc-typehints>=2.3.0",
71+
"sphinx-toolbox>=4.0.0",
72+
]
6773
pydantic-v1 = [
6874
"pydantic>=1.9.0, <2",
6975
]

0 commit comments

Comments
 (0)