Project

General

Profile

Actions

Support #21940

closed

Provide example of using replace_files to pluck files from a large set of collections

Added by Peter Amstutz 4 days ago. Updated 4 days ago.

Status:
Closed
Priority:
Normal
Assigned To:
Category:
SDKs
Due date:
Story points:
-
Actions #1

Updated by Peter Amstutz 4 days ago

  • Status changed from New to Closed

This turned out to not be useful to the support request, but here's the code.

#!/bin/env python3

import arvados

api = arvados.api()

files = ["e715923f01e46037a8ccae85487f0d79+1243/ERR2122553.g.vcf.gz",
         "4fce132bc4ae9b4cc844115246a6bd41+175/head.html",
         "294b75dc55a50fc863148199c3164f75+65/sample-metadata.yml"]

rf = {}

for f in files:
    sp = f.split("/", 2)
    rf["/"+sp[1]] = f

print(rf)

item = api.collections().create(body={"name": "foo"}, replace_files=rf).execute()
print(item)
Actions

Also available in: Atom PDF