Submissions
If a motor or battery you need isn't in the catalog, you can send it in for review. Once ThrustLab approves it, it joins the catalog for everyone. You can send in motors and batteries this way. Propellers can't be submitted.
To use a part just for yourself, without review, save a private one. See Components.
Send in a motor
from thrustlab import Client
client = Client()
submission = client.submissions.create(
component_data={
"component_type": "motor",
"name": "Example 4260 800Kv",
"manufacturer": "Example Motors",
"data_json": {
"kv": 800.0,
"n": 14,
"R": 0.042,
"weight": 120.0,
"diameter": 42.0,
"length": 25.0,
"u_nominal": 10.0,
"iq_nominal": 1.1,
"iq_max": 65.0,
},
"source_url": "https://example.com/datasheet",
"notes": "Values from the maker's datasheet.",
}
)
print(submission["id"], submission["status"])component_data needs five things: component_type ("motor" or "battery"), name, manufacturer, data_json and source_url. notes is optional. Use the link to where you found the numbers, so a reviewer can check them.
data_json holds the same fields as a private part's spec_json. For a motor, R is the resistance between two motor wires, in ohms, as the datasheet gives it. Components lists the motor fields.
Follow the review
A submission has a status:
| Status | Meaning |
|---|---|
submitted | Waiting for a reviewer. |
under_review | A reviewer has started. |
approved | In the catalog. |
rejected | Not accepted. The reviewer_notes field may say why. |
for item in client.submissions.list(status="rejected"):
print(item["name"], item["reviewer_notes"])list shows your own submissions, newest first. retrieve(submission_id) reads one.
Fix or withdraw a submission
You can change a submission while its status is submitted:
client.submissions.update(submission["id"], source_url="https://example.com/new-link")
client.submissions.withdraw(submission["id"])update takes name, manufacturer, data_json, source_url and notes. You can't change component_type. withdraw deletes the submission for good.
Once a reviewer has started, both calls fail with a ConflictError.
Get told about the outcome
ThrustLab can send your server a message when a submission is sent, approved or rejected. The events are component.submitted, component.approved and component.rejected. See Webhook endpoints.