Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#62] Use updated hsmodels #63

Merged
merged 8 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading