Skip to content

Commit

Permalink
Merge pull request #63 from hydroshare/62-use-updated-hsmodels
Browse files Browse the repository at this point in the history
Use updated hsmodels
  • Loading branch information
pkdash authored May 16, 2024
2 parents 712cf01 + be03078 commit 0117347
Show file tree
Hide file tree
Showing 9 changed files with 396 additions and 369 deletions.
397 changes: 212 additions & 185 deletions docs/examples/Aggregation_Data_Object_Operations.ipynb

Large diffs are not rendered by default.

120 changes: 60 additions & 60 deletions docs/examples/Aggregation_Operations.ipynb

Large diffs are not rendered by default.

52 changes: 25 additions & 27 deletions docs/examples/Basic_Operations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "hzriLgMl0oJ2"
},
"outputs": [],
"source": [
"!pip install hsclient"
]
],
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
Expand All @@ -50,18 +50,18 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "3njsiY73m7_V"
},
"outputs": [],
"source": [
"from hsclient import HydroShare\n",
"\n",
"username = 'username'\n",
"password = 'password'\n",
"hs = HydroShare(username, password)"
]
],
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
Expand All @@ -72,15 +72,15 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from hsclient import HydroShare\n",
"\n",
"hs = HydroShare()\n",
"hs.sign_in()"
]
],
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
Expand All @@ -105,12 +105,8 @@
}
},
{
"metadata": {},
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "W9azvJ_Co87w"
},
"outputs": [],
"source": [
"# Create the new, empty resource\n",
"new_resource = hs.create()\n",
Expand All @@ -121,7 +117,9 @@
"\n",
"# Construct a hyperlink to access the HydroShare landing page for the new resource\n",
"print(f'Your new resource is available at: {new_resource.metadata.url}')"
]
],
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
Expand All @@ -136,16 +134,16 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "-My8I_cmLOIf"
},
"outputs": [],
"source": [
"# Get an existing resource using its identifier\n",
"existing_resource = hs.resource(res_identifier)\n",
"print(f'Just retrieved the resource with ID: {res_identifier}')"
]
],
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
Expand All @@ -160,14 +158,14 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "G9LBisuOx5WM"
},
"outputs": [],
"source": [
"new_resource.delete()"
]
],
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
Expand All @@ -180,16 +178,16 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "Wf91WAB1H5KS"
},
"outputs": [],
"source": [
"# Delete the resource using its identifier\n",
"hs.resource(res_identifier).delete()\n",
"print(f'Deleted resource with ID: {res_identifier}')"
]
],
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
Expand All @@ -206,11 +204,9 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "Xqgoq9yk15e4"
},
"outputs": [],
"source": [
"# Get the resource you want to download using its identifier\n",
"res_identifier = '7561aa12fd824ebb8edbee05af19b910'\n",
Expand All @@ -219,7 +215,9 @@
"# Download the resource as a zipped Bagit file\n",
"# Pass in a file path if you want to download to a particular location\n",
"res.download()"
]
],
"outputs": [],
"execution_count": null
}
],
"metadata": {
Expand Down
Loading

0 comments on commit 0117347

Please sign in to comment.