0

So I want to list the tasks in CVAT using the API but to filter the tasks for specific project (using its project id or name). lookin at the docs for tasks.list.api, I try to use filter argument but cant make it work. As you see I was able to retreive the project I am looking for by client.projects.retreive(id)

    project = client.projects.retrieve(3)
    print(f"Found project {project.id}")

    project_id = "3"
    filter_json = json.dumps({"project_id": project_id})
    tasks = client.tasks.api.list(filter=filter_json)

console output

Found project 3
.
.
.
.
.
cvat_sdk.api_client.exceptions.ApiException: Status Code: 400
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Allow': 'GET, POST, HEAD, OPTIONS', 'Content-Length': '68', 'Content-Type': 'application/vnd.cvat+json', 'Cross-Origin-Opener-Policy': 'same-origin', 'Date': 'Thu, 27 Jul 2023 18:27:31 GMT', 'Referrer-Policy': 'same-origin', 'Server': 'nginx/1.18.0 (Ubuntu)', 'Vary': 'Accept, Origin', 'X-Content-Type-Options': 'nosniff', 'X-Frame-Options': 'DENY', 'X-Request-Id': '6fa1519f-07ee-47cb-958a-00c33bcfec34'})
HTTP response body: ["filter: project_id operation with 3 arguments is not implemented"]
Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36
Ahmed
  • 89
  • 7

1 Answers1

0

You should be able to use list(project_id=project_id). However the filter option is poorly documented and I filed an issue.

Yuval
  • 3,207
  • 32
  • 45