[ARVADOS] updated: 1.3.0-2090-g24c356c04

Git user git at public.arvados.org
Fri Jan 17 16:41:37 UTC 2020


Summary of changes:
 doc/sdk/python/cookbook.html.textile.liquid | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

       via  24c356c045c01884c0c37b16168d98ba16f0e1a6 (commit)
      from  d90dd5662fd356d38768b16e0f2d04fb10c19e87 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 24c356c045c01884c0c37b16168d98ba16f0e1a6
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Fri Jan 17 11:41:01 2020 -0500

    Add "copy files from a collection to a new collection" to cookbook
    
    closes #16044
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/doc/sdk/python/cookbook.html.textile.liquid b/doc/sdk/python/cookbook.html.textile.liquid
index 0bc697077..34f0a5014 100644
--- a/doc/sdk/python/cookbook.html.textile.liquid
+++ b/doc/sdk/python/cookbook.html.textile.liquid
@@ -235,3 +235,24 @@ with c.open(filename, "rb") as reader:
             content = reader.read(128*1024)
 print("Finished downloading %s" % filename)
 {% endcodeblock %}
+
+h2. Copy files from a collection a new collection
+
+{% codeblock as python %}
+import arvados.collection
+
+source_collection = "x1u39-4zz18-krzg64ufvehgitl"
+target_project = "x1u39-j7d0g-67q94einb8ptznm"
+target_name = "Files copied from source_collection"
+files_to_copy = ["folder1/sample1/sample1_R1.fastq",
+                 "folder1/sample2/sample2_R1.fastq"]
+
+source = arvados.collection.CollectionReader(source_collection)
+target = arvados.collection.Collection()
+
+for f in files_to_copy:
+    target.copy(f, "", source_collection=source)
+
+target.save_new(name=target_name, owner_uuid=target_project)
+print("Created collection %s" % target.manifest_locator())
+{% endcodeblock %}

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list