Skip to content

Commit

Permalink
1.2.5 release
Browse files Browse the repository at this point in the history
  • Loading branch information
pkdash committed Dec 7, 2016
1 parent f50724a commit 8ebc4f0
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
9 changes: 9 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# 1.2.5 - 12/7/2016
- Add ability to supply key/value metadata (in addition to 'title', 'abstract', 'keywords', and 'metadata')
to createResource()
- Add getResourceMap (/hsapi/resource/\<pid\>map/)

# 1.2.4 - 9/2/2016
- Add support for async resource bag (BagIt archive) creation prior to downloading
the bag file in getResource()

# 1.2.3 - 7/12/2016
- Add ability to supply metadata (in addition to 'title', 'abstract', and 'keywords')
to createResource()
Expand Down
15 changes: 14 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ To create a resource:
>>> rtype = 'GenericResource'
>>> fpath = '/path/to/a/file'
>>> metadata = '[{"coverage":{"type":"period", "value":{"start":"01/01/2000", "end":"12/12/2010"}}}, {"creator":{"name":"John Smith"}}, {"creator":{"name":"Lisa Miller"}}]'
>>> resource_id = hs.createResource(rtype, title, resource_file=fpath, keywords=keywords, abstract=abstract, metadata=metadata)
>>> extra_metadata = '{"key-1": "value-1", "key-2": "value-2"}'
>>> resource_id = hs.createResource(rtype, title, resource_file=fpath, keywords=keywords, abstract=abstract, metadata=metadata, extra_metadata=extra_metadata)

To make a resource public:

Expand Down Expand Up @@ -204,7 +205,19 @@ To delete a file from a resource:
>>> fname = 'somefile.txt'
>>> resource_id = hs.deleteResourceFile('ID OF RESOURCE GOES HERE', fname)

To get resource map xml data for a resource:

>>> from hs_restclient import HydroShare, HydroShareAuthBasic
>>> auth = HydroShareAuthBasic(username='myusername', password='mypassword')
>>> hs = HydroShare(auth=auth)
>>> resource_map_xml = hs.getResourceMap('ID OF RESOURCE GOES HERE')

To get science xml data for a resource:

>>> from hs_restclient import HydroShare, HydroShareAuthBasic
>>> auth = HydroShareAuthBasic(username='myusername', password='mypassword')
>>> hs = HydroShare(auth=auth)
>>> science_metadata_xml = hs.getScienceMetadata('ID OF RESOURCE GOES HERE')

Index
-----
Expand Down
2 changes: 1 addition & 1 deletion hs_restclient/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""

__title__ = 'hs_restclient'
__version__ = '1.2.3'
__version__ = '1.2.5'


import os
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='1.2.3',
version='1.2.5',

description='HydroShare REST API client library',
long_description=long_description,
Expand Down

0 comments on commit 8ebc4f0

Please sign in to comment.