client.projects
Projects are the top-level workspace for simulations, sweeps, and starred components. Every simulation and sweep belongs to exactly one project.
Methods
| Method | Endpoint | Returns |
|---|---|---|
client.projects.create(name=...) | POST /v1/projects | New project |
client.projects.list() | GET /v1/projects | CursorPager of projects |
client.projects.retrieve(project_id) | GET /v1/projects/{id} | Single project |
client.projects.update(project_id, **fields) | PATCH /v1/projects/{id} | Updated project |
client.projects.delete(project_id) | DELETE /v1/projects/{id} | None |
Create a project
from thrustlab import Client
client = Client()
project = client.projects.create(name="Quad-X build")
print(project["id"]) # proj_2c5tQ...
Project resource fields
| Field | Meaning |
|---|---|
object | Always "project" |
id | Public project id (proj_...) |
name | Display name (1-255 chars) |
aircraft_type_tag | Optional free-form tag (up to 50 chars), e.g. "quad", "fixed_wing" — settable on create/update |
notes | Optional free-form notes, no length cap — settable on create/update |
created_at | Creation timestamp |
updated_at | Last-modified timestamp |
run_count | Total simulations + sweeps ever run in this project |
completed_count | Runs that finished successfully |
running_count | Runs currently in progress |
failed_count | Runs that errored out |
last_activity_at | Timestamp of the most recent run, or updated_at if the project has none |
aircraft_type_tag and notes are the only fields settable via
create()/update() beyond name; the *_count fields and
last_activity_at are read-only aggregates computed by the server.
List projects
list() returns a cursor pager; iterate to
walk every page automatically.
for project in client.projects.list():
print(project["id"], project["name"], project["created_at"])
For UI-style "show 20 at a time", pass limit and read .data directly:
page = client.projects.list(limit=20)
for project in page.data:
print(project["name"])
print(f"more pages? {page.has_more}")
Rename a project
client.projects.update("proj_2c5tQ...", name="Quad-X v2")
update accepts any patchable field as a keyword argument. See the
API reference for the full list.
Delete a project
Deletion is hard, not soft. It cascade-deletes the project's simulations, sweeps, and starred components. There is no undo and no soft-delete flag — once the call returns, that history is gone. If you need to retain results, fetch them before deleting the parent project.
client.projects.delete("proj_2c5tQ...") # irreversible — cascades to sims, sweeps, starred components
End-to-end: project + first simulation
from thrustlab import Client
client = Client()
project = client.projects.create(name="hover study")
sim = client.simulations.create(
project_id=project["id"],
battery_component_id="comp_batt_xxx",
airspeed_m_s=0.0,
density_kg_m3=1.225,
battery_charge_pct=100,
rotor_groups=[{
"label": "main", "count": 4,
"motor_component_id": "comp_motor_xxx",
"propeller_component_id": "comp_prop_xxx",
"throttle_pct": 70,
}],
)
result = client.simulations.wait(sim["id"], timeout=300)
print(result["status"])
See also
- Simulations
- Sweeps
- Starred components — per-project favorites