LJKS
LJKS

Reputation: 919

How to automatically sync Label Studio source cloud storage

As the title says I would like to automate syncing a source (either local files or redis) with a given project in Label Studio.

It is easy to set up a source for data (by linking some remote source folder/urls) to Label Studio. However I have a situation, where this storage reacts to any user action (i.e. reacts via a Webhook) and given certain circumstances loads new data for the user into this source.

The problem can be solved by having the user manually go into settings and sync with their source. However I probably don't want to have any user going into the settings, seems like a place where I generally would prefer to keep them away from. I could not find whether there would be any direct way to have the user sync either regularly (e.g. every 60 seconds), or on events (every 5 submissions) either from the browser or backend perspective.

Upvotes: 1

Views: 930

Answers (1)

JM Montanier
JM Montanier

Reputation: 88

You can use this method: https://labelstud.io/sdk/client.html#label_studio_sdk.client.Client.sync_storage

In order to get the the storage id, take a look at this direct API call:https://labelstud.io/api#operation/api_storages_list

I did not find a way to get the list of storages from the SDK.

Upvotes: 1

Related Questions