Checking for non-preferred file/folder path names (may take a long time depending on the number of files/folders) ...

HydroShare Python Client Library (hsclient) Usage Examples


Authors:
Owners: This resource does not have an owner who is an active HydroShare user. Contact CUAHSI (help@cuahsi.org) for information on this resource.
Type: Resource
Storage: The size of this resource is 23.0 MB
Created: Jan 07, 2021 at 12:19 a.m.
Last updated: Nov 14, 2024 at 10:08 p.m.
Citation: See how to cite this resource
Sharing Status: Public
Views: 2791
Downloads: 570
+1 Votes: 1 other +1 this
Comments: 1 comment

Abstract

This resource contains a set of Jupyter Notebooks that provide Python code examples for using the HydroShare Python Client library (hsclient). The hsclient library enables users to automate most of the functions available via HydroShare's web user interface through Python coding. It enables creation of new resources and editing of existing resources. Edits may include changes to metadata elements and/or content files within resources. A link to the GitHub source code repository for hsclient is provided in the related resources section below.

Subject Keywords

Coverage

Spatial

Coordinate System/Geographic Projection:
WGS 84 EPSG:4326
Coordinate Units:
Decimal degrees
North Latitude
42.0500°
East Longitude
-111.5774°
South Latitude
41.9875°
West Longitude
-111.6577°

Temporal

Start Date:
End Date:

Content

Related Resources

This resource is described by Source code repository for the hsclient Python Library - https://github.com/hydroshare/hsclient
This resource belongs to the following collections:
Title Owners Sharing Status My Permission
Collection of resources that illustrate data processing methods and computational and modeling libraries in HydroShare and linked JupyterHub computing platforms David Tarboton  Public &  Shareable Open Access

Credits

Funding Agencies

This resource was created using funding from the following sources:
Agency Name Award Title Award Number
National Science Foundation Collaborative Research: Elements: Advancing Data Science and Analytics for Water (DSAW) 1931297

How to Cite

Horsburgh, J. S., S. S. Black, P. Dash, T. Z. Gichamo (2024). HydroShare Python Client Library (hsclient) Usage Examples, HydroShare, http://www.hydroshare.org/resource/7561aa12fd824ebb8edbee05af19b910

This resource is shared under the Creative Commons Attribution CC BY.

http://creativecommons.org/licenses/by/4.0/
CC-BY

Comments

Dan Ames 8 months, 3 weeks ago

A couple of notes and updates as of Feb 29, 2024:

* In Basic_Operations, the example code for printing the full url doesn't work unless you wrap the url object in str()

* In Metadata_Operations, this line of code fails due to some kind of internal error checking that doesn't like the "None" value.
# You can remove the spatial coverage element by setting it to None
new_resource.metadata.spatial_coverage = None

* The metadata sources example code is failing with this error:
AttributeError: 'ResourceMetadata' object has no attribute 'sources'

* I think the relation type "isDataFor" has been deprecated and replaced with "isDescribedBy"

* This function doesn't seem to be supported: # Instantiate a new Creator object using a HydroShare user object
# First, retrieve HydroShare user object
tony = hs.user(11)

Reply
+1 Votes: Be the first one to 
 this.

New Comment

required