Get in touch

Get in touch

Prefer using email? Say hi at hello@moveshelf.com

This section explains how to delete all trials within a specified condition from Moveshelf using the Moveshelf API, based on the session's ID and the condition name.
Prerequisites
Before implementing this example, ensure that your processing script includes all necessary setup steps. In particular, you should have:
Implementation
To delete all trials within an existing condition, add the following lines of code to your processing script:
## README: this example shows how we can delete all trials/clips within
# a condition from Moveshelf using the Moveshelf API.

# Delete all trials within a condition
session_id = "<sessionId>" # session["id"]
condition_name = "<conditionName>" # e.g., "Barefoot"

result = api.deleteClipByCondition(session_id, condition_name)

print(f"Deletion Results:")
print(f"  Successfully deleted: {result['deleted_count']} trials")
print(f"  Failed to delete: {result['failed_count']} trials")

# Show detailed results
for detail in result['details']:
    status = "✓" if detail['deleted'] else "✗"
    print(f"  {status} {detail['title']} ({detail['clip_id']})")