Best way to interact with Export Task Data via Python

Whether data rows / annotations are fetched via the SDK or via an export task, I’d like to work with this data under the same object-oriented representation within my python code. I don’t want all of the intricacies of the dictionary schema of the exported .NDJSON to be buried throughout my code.

It would be nice to convert the NDJSON data into the labelbox python DB entities so that I can utilize them as objects.
Otherwise, I find myself having to extract all the NDJSON data into a set of self-made python classes just so that I can work with these classes within my python code, and not the NDJSON dict.

But this seems like a lot of additional work and I was hoping to see if their were other solutions out there.

Thanks

Hey Chris,

Please consider using project.labels(). This should allow you to deal with the exported labels in a more structured, object-oriented approach. However, its worth noting that this method can be quite slow when dealing with a lot of labels. I hope this helped. Let me know if you have any other questions!

Best,
Christian

1 Like