ThrustLab

client.starred_components

Per-project favorites. Starring a component scopes it to a project's "starred" list — useful for picking a curated short-list of motors to sweep against, or sharing a project preset with a collaborator.

Methods

MethodEndpointReturns
client.starred_components.list(project_id=...)GET /v1/starred_componentsCursorPager of starred components
client.starred_components.add(project_id=..., component_id=..., component_type=...)POST /v1/starred_componentsNew starred_component resource
client.starred_components.remove(star_id)DELETE /v1/starred_components/{star_id}None

Stars are their own resource with a star_<ksuid> id — not an anonymous (project, component) pair. remove() takes that star id, not the component id. list() also accepts an optional component_type (motor | battery | propeller) to narrow within a project.

Star a component

project_id, component_id, and component_type are all required:

from thrustlab import Client

client = Client()
star = client.starred_components.add(
    project_id="proj_2c5tQ...",
    component_id="comp_2c5tQ...",
    component_type="motor",
)
print(star["id"])  # star_2c5tQ...

Starring the same component twice in the same project raises a 409 (already_starred) — starring is not idempotent.

List starred components for a project

for star in client.starred_components.list(project_id="proj_2c5tQ..."):
    print(star["id"], star["component_id"], star["component_type"])

You typically want to dereference these to full components. Filter on component_type rather than the component id's prefix — every component id has the same comp_ prefix regardless of type:

stars = client.starred_components.list(project_id="proj_xxx")
motors = [
    client.components.retrieve(s["component_id"])
    for s in stars
    if s["component_type"] == "motor"
]

Unstar a component

client.starred_components.remove(star["id"])

The argument is the star's own star_<ksuid> id, not the underlying component id. Removing an unknown or already-removed star raises a 404 — unlike starring, unstarring is not idempotent.

See also

We use cookies and analytics tools to understand how you use ThrustLab and improve the experience. Privacy Policy

Python SDK — Starred components · ThrustLab API