Actions
Idea #21551
openPython SDK methods to generate keep: URIs
Start date:
Due date:
Story points:
-
Description
These would be utility methods to make it easier to write Python that generates CWL inputs. Something like:
class ArvadosFile(object):
def keep_uri(self) -> str:
return f'{self.parent.keep_uri()}/{self.name}'
class Collection(RichCollectionBase):
def keep_uri(self, path: Optional[str]=None) -> str:
if path is None:
parts = [f'keep:{self.portable_data_hash()}']
parts.extend(self.stream_name().split('/'))
if parts[-1] == '.':
parts.pop()
parts.append('')
return '/'.join(parts)
else:
return self.find(path).keep_uri()
Basically given any file or collection object, it should be possible to get the corresponding keep: URI. This might need additional handling for corner cases but this is the gist.
Actions