Skip to content

Commit 90a4433

Browse files
committed
work-in-progress
1 parent 90b90dc commit 90a4433

File tree

8 files changed

+525
-60
lines changed

8 files changed

+525
-60
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,12 @@ Run it:
132132
uv run python example.py
133133
```
134134

135-
### Generating the documentation
135+
### Previewing the documentation
136136

137137
If added a new service, create a documentation template under api/services for that service.
138138

139139
```bash
140-
cd docs
141-
make html
140+
uv run mkdocs serve
142141
```
143142

144143
### Code style

docs/Makefile

Lines changed: 0 additions & 20 deletions
This file was deleted.

docs/index.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Verda Python SDK
2+
3+
Welcome to the documentation for the official Verda (formerly Datacrunch) Python SDK.
4+
5+
The Public API documentation is [available here](https://api.verda.com/v1/docs)
6+
7+
The Python SDK is open-sourced and can be [found here](https://github.com/verda-cloud/sdk-python)
8+
9+
## Basic Examples:
10+
11+
First, get your client credentials - [instructions available here](https://api.verda.com/v1/docs#description/quick-start-guide).
12+
13+
Deploy a new instance:
14+
15+
```python
16+
import os
17+
from verda import VerdaClient
18+
19+
# Get client secret from environment variable
20+
CLIENT_SECRET = os.environ['VERDA_CLIENT_SECRET']
21+
CLIENT_ID = 'Ibk5bdxV64lKAWOqYnvSi' # Replace with your client ID
22+
23+
# Create client
24+
verda = VerdaClient(CLIENT_ID, CLIENT_SECRET)
25+
26+
# Get all SSH keys id's
27+
ssh_keys = verda.ssh_keys.get()
28+
ssh_keys_ids = list(map(lambda ssh_key: ssh_key.id, ssh_keys))
29+
30+
# Create a new instance
31+
instance = verda.instances.create(instance_type='1V100.6V',
32+
image='ubuntu-24.04-cuda-12.8-open-docker',
33+
ssh_key_ids=ssh_keys_ids,
34+
hostname='example',
35+
description='example instance')
36+
```
37+
38+
List all existing instances, ssh keys, startup scripts:
39+
40+
```python
41+
instances = verda.instances.get()
42+
keys = verda.ssh_keys.get()
43+
scripts = verda.startup_scripts.get()
44+
```
45+
46+
List all available instance & image types (information about available
47+
os images and instances to deploy)
48+
49+
```python
50+
instance_types = verda.instance_types.get()
51+
images_types = verda.images.get()
52+
```

docs/make.bat

Lines changed: 0 additions & 35 deletions
This file was deleted.

docs/requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

mkdocs.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
site_name: Python SDK
2+
site_url: https://docs.your-internal-domain.com
3+
repo_url: https://github.com/verda-cloud/sdk-python
4+
repo_name: verda-cloud/sdk-python
5+
6+
extra_css:
7+
- stylesheets/extra.css
8+
9+
theme:
10+
name: material
11+
logo: logo_darkmode.svg
12+
palette:
13+
# Auto-switch to dark mode based on system preference
14+
- media: "(prefers-color-scheme)"
15+
toggle:
16+
icon: material/brightness-auto
17+
name: Switch to light mode
18+
features:
19+
- content.code.annotate
20+
- content.tabs.link
21+
- navigation.indexes
22+
- navigation.sections
23+
- search.suggest
24+
- search.highlight
25+
26+
plugins:
27+
- search
28+
- mkdocstrings:
29+
handlers:
30+
python:
31+
paths: [.] # Ensure this points to where your 'verda' package is located
32+
options:
33+
# Common options to match Sphinx autodoc behavior
34+
show_source: true
35+
show_root_heading: true
36+
show_category_heading: true
37+
38+
# Explicit Navigation Map (Replaces toctree)
39+
nav:
40+
- Home: index.md
41+
- Installation: installation.md
42+
- Examples: examples.md
43+
- API Reference:
44+
- Client: reference/client.md
45+
- Exceptions: reference/exceptions.md
46+
- Constants: reference/constants.md
47+
# Add your services manually here
48+
- Services: reference/services.md
49+
- Contributing: contributing.md
50+
- Changelog: changelog.md
51+
52+
markdown_extensions:
53+
# This enables proper styling for fenced code blocks ```python
54+
- pymdownx.superfences
55+
56+
# Optional: enables syntax highlighting for inline code `like this`
57+
- pymdownx.inlinehilite

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ dev = [
3232
"responses>=0.25.8",
3333
"ruff>=0.14.2",
3434
]
35+
docs = [
36+
"mkdocs>=1.6.1",
37+
"mkdocs-material>=9.7.0",
38+
"mkdocstrings[python]>=1.0.0",
39+
]
3540

3641
[project.urls]
3742
Homepage = "https://github.com/verda-cloud"

0 commit comments

Comments
 (0)