Commit 4222fa7b authored by Staiger, Christine's avatar Staiger, Christine
Browse files

Add jupyter notebook for python API.

Adjust python API markdown to python-irodsclient v 1.0.
parent baec7f0e
This diff is collapsed.
......@@ -173,7 +173,7 @@ We can download a data object as follows (note that we use the environment varia
import os
options = {kw.VERIFY_CHKSUM_KW: ''}
localpath = os.environ['HOME']+'/'+os.path.basename(obj.path)
obj = session.data_objects.get(obj.path,file=localpath, **options)
obj = session.data_objects.get(obj.path,local_path=localpath, **options)
```
**Exercise** Calculate the MD5 checksum for the downloaded data and compare with the data object's checksum in iRODS. (hint: `import hashlib; hashlib.md5(open(<filename>, 'rb').read()).hexdigest()`
......@@ -401,7 +401,10 @@ We asked in the query for *Collection.name* and *DataObject.name*.
Have look at these two objects:
```py
from pprint import pprint
pprint(vars(Collection))
print(Collection.name.icat_key)
pprint(vars(DataObject))
print(DataObject.name.icat_key)
```
The *icat_key* is the keyword used in the database behind iRODS to store the information.
......@@ -437,4 +440,4 @@ Metadata that the user creates with *obj.metadata.add* or *coll.metadata.add* ar
2. Create an own collection in your iRODS home collection.
3. Copy (`session.data_objects.copy()`) the data objects to the new collection without downloading and uploading them.
4. Verify the checksums.
5. Open the collection to your neighbour by giving read rights.
\ No newline at end of file
5. Open the collection to your neighbour by giving read rights.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment