Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.0.3"
".": "0.0.4"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 27
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/dedalus-labs%2Fdedalus-7a281169c5f380aa29376e393f8c5f87d35998fecc9e1210835f1165c0bc467f.yml
openapi_spec_hash: da9a43b37a46e0d22a823085861cdd82
config_hash: 7fcee0473099fe6d9a119f37c80e53d7
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/dedalus-labs%2Fdedalus-6a258bad8212a32bd01b1908ab115e08736d156d6907697a7e556b1809383790.yml
openapi_spec_hash: d80976534189646de029c562bb3ca9a1
config_hash: 795e855c41188604a3e270623e39c126
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 0.0.4 (2026-04-01)

Full Changelog: [v0.0.3...v0.0.4](https://github.com/dedalus-labs/dedalus-python/compare/v0.0.3...v0.0.4)

### Features

* **internal:** implement indices array format for query and form serialization ([964fbdf](https://github.com/dedalus-labs/dedalus-python/commit/964fbdfd66a57ce61c8db07cca40032c877a20ed))


### Chores

* **api:** rename workspaces to machines ([ebbdaee](https://github.com/dedalus-labs/dedalus-python/commit/ebbdaeefd99fb507499f2d9ec5c68f258ccc900e))
* **tests:** bump steady to v0.20.1 ([fe9a91b](https://github.com/dedalus-labs/dedalus-python/commit/fe9a91b905ce79bd75487c4d1ad7b7e027d1c99e))
* **tests:** bump steady to v0.20.2 ([e4097a4](https://github.com/dedalus-labs/dedalus-python/commit/e4097a4700e2ccc894504a796e5fa8511d36eacb))

## 0.0.3 (2026-03-25)

Full Changelog: [v0.0.2...v0.0.3](https://github.com/dedalus-labs/dedalus-python/compare/v0.0.2...v0.0.3)
Expand Down
68 changes: 34 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ client = Dedalus(
api_key=os.environ.get("DEDALUS_API_KEY"), # This is the default and can be omitted
)

workspace = client.workspaces.create(
machine = client.machines.create(
memory_mib=2048,
storage_gib=10,
vcpu=1,
)
print(workspace.workspace_id)
print(machine.machine_id)
```

While you can provide a `x_api_key` keyword argument,
Expand All @@ -69,12 +69,12 @@ client = AsyncDedalus(


async def main() -> None:
workspace = await client.workspaces.create(
machine = await client.machines.create(
memory_mib=2048,
storage_gib=10,
vcpu=1,
)
print(workspace.workspace_id)
print(machine.machine_id)


asyncio.run(main())
Expand Down Expand Up @@ -107,12 +107,12 @@ async def main() -> None:
api_key=os.environ.get("DEDALUS_API_KEY"), # This is the default and can be omitted
http_client=DefaultAioHttpClient(),
) as client:
workspace = await client.workspaces.create(
machine = await client.machines.create(
memory_mib=2048,
storage_gib=10,
vcpu=1,
)
print(workspace.workspace_id)
print(machine.machine_id)


asyncio.run(main())
Expand All @@ -127,11 +127,11 @@ from dedalus_sdk import Dedalus

client = Dedalus()

stream = client.workspaces.watch(
workspace_id="workspace_id",
stream = client.machines.watch(
machine_id="machine_id",
)
for workspace in stream:
print(workspace.workspace_id)
for machine in stream:
print(machine.machine_id)
```

The async client uses the exact same interface.
Expand All @@ -141,11 +141,11 @@ from dedalus_sdk import AsyncDedalus

client = AsyncDedalus()

stream = await client.workspaces.watch(
workspace_id="workspace_id",
stream = await client.machines.watch(
machine_id="machine_id",
)
async for workspace in stream:
print(workspace.workspace_id)
async for machine in stream:
print(machine.machine_id)
```

## Using types
Expand All @@ -168,12 +168,12 @@ from dedalus_sdk import Dedalus

client = Dedalus()

all_workspaces = []
all_machines = []
# Automatically fetches more pages as needed.
for workspace in client.workspaces.list():
# Do something with workspace here
all_workspaces.append(workspace)
print(all_workspaces)
for machine in client.machines.list():
# Do something with machine here
all_machines.append(machine)
print(all_machines)
```

Or, asynchronously:
Expand All @@ -186,11 +186,11 @@ client = AsyncDedalus()


async def main() -> None:
all_workspaces = []
all_machines = []
# Iterate through items across all pages, issuing requests as needed.
async for workspace in client.workspaces.list():
all_workspaces.append(workspace)
print(all_workspaces)
async for machine in client.machines.list():
all_machines.append(machine)
print(all_machines)


asyncio.run(main())
Expand All @@ -199,7 +199,7 @@ asyncio.run(main())
Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:

```python
first_page = await client.workspaces.list()
first_page = await client.machines.list()
if first_page.has_next_page():
print(f"will fetch next page using these details: {first_page.next_page_info()}")
next_page = await first_page.get_next_page()
Expand All @@ -211,11 +211,11 @@ if first_page.has_next_page():
Or just work directly with the returned data:

```python
first_page = await client.workspaces.list()
first_page = await client.machines.list()

print(f"next page cursor: {first_page.next_cursor}") # => "next page cursor: ..."
for workspace in first_page.items:
print(workspace.workspace_id)
for machine in first_page.items:
print(machine.machine_id)

# Remove `await` for non-async usage.
```
Expand All @@ -236,7 +236,7 @@ from dedalus_sdk import Dedalus
client = Dedalus()

try:
client.workspaces.create(
client.machines.create(
memory_mib=2048,
storage_gib=10,
vcpu=1,
Expand Down Expand Up @@ -283,7 +283,7 @@ client = Dedalus(
)

# Or, configure per-request:
client.with_options(max_retries=5).workspaces.create(
client.with_options(max_retries=5).machines.create(
memory_mib=2048,
storage_gib=10,
vcpu=1,
Expand All @@ -310,7 +310,7 @@ client = Dedalus(
)

# Override per-request:
client.with_options(timeout=5.0).workspaces.create(
client.with_options(timeout=5.0).machines.create(
memory_mib=2048,
storage_gib=10,
vcpu=1,
Expand Down Expand Up @@ -355,15 +355,15 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
from dedalus_sdk import Dedalus

client = Dedalus()
response = client.workspaces.with_raw_response.create(
response = client.machines.with_raw_response.create(
memory_mib=2048,
storage_gib=10,
vcpu=1,
)
print(response.headers.get('X-My-Header'))

workspace = response.parse() # get the object that `workspaces.create()` would have returned
print(workspace.workspace_id)
machine = response.parse() # get the object that `machines.create()` would have returned
print(machine.machine_id)
```

These methods return an [`APIResponse`](https://github.com/dedalus-labs/dedalus-python/tree/main/src/dedalus_sdk/_response.py) object.
Expand All @@ -377,7 +377,7 @@ The above interface eagerly reads the full response body when you make the reque
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.

```python
with client.workspaces.with_streaming_response.create(
with client.machines.with_streaming_response.create(
memory_mib=2048,
storage_gib=10,
vcpu=1,
Expand Down
Loading
Loading