audeering / audbackend

Manage file storage on different backends
https://audeering.github.io/audbackend/
Other
3 stars 0 forks source link

Provide interface method to get actual path/URL on backend? #221

Open hagenw opened 2 months ago

hagenw commented 2 months ago

In some packages we provided a method to get the actual path of a file on the backend, which might be useful to navigate to the file or download it directly, e.g. audmodel.url().

For the two backends we have at the moment, this can be achieved with (when using an interface that versions files):

This has a few problems though:

frankenjoe commented 2 months ago

their might be backends, where we don't can provide a meaningful URL/root path

Yes, that's why we removed Backend.path in https://github.com/audeering/audbackend/pull/47.

Probably the simplest solution would be to add an optional return argument to Backend.put_file(). Backends like FileSystem and Artifactory can use it to return the path on the backend. But other backends, like the SQL backend in the documentation, may also return None.

The other, more complex solution I see, is that we add a method to Backend and Interface that translates a virtual backend path to its "real" path. But again the return value can be Noneas it may not make sense on all backends.