Delete a Folder

The 'Delete a folder' feature is as the name suggests to delete a new folder in a resource of your HydroShare account which would contain all the files you wish to discard along with it. Once deleted, you cannot retrieve them back. This feature is brought about by the HydroShare api Python library.

The way you could go about performing this function is by following the instructions below:

Step 1: Sign into HydroShare using your credentials

In the boxes below you enter your HydroShare username and its password. If you have to make an HydroShare account, click here.

Step 2: Enter in the Resource ID and then enter the name of the folder you want to delete

The resource Id is a unique identifier for every resource on Hydroshare. You can findit by browsing to your HydroShare resource copying the ID from the URL. Like for example, this is an example hyperlink https://www.hydroshare.org/resource/08c6e88adaa647cd9bb28e5d619178e0/ from which the 32 letter combination at the end is called the resource id. And so the resource id from the example hyperlink is 08c6e88adaa647cd9bb28e5d619178e0

Resource ID

Learn more:

To try this on your own, you can use the code snippet below that is used in this demonstration.

    
from hs_restclient import HydroShare, HydroShareAuthBasic
auth = HydroShareAuthBasic(username='myusername', password='mypassword')
hs = HydroShare(auth=auth)
folder_to_delete = "folder_1/folder_2"
response_json = hs.deleteResourceFolder('ID OF RESOURCE GOES HERE', pathname=folder_to_delete)