Skip to content

Commit d6ab5cc

Browse files
committed
add folder syntax for samples
1 parent 3de1175 commit d6ab5cc

File tree

2 files changed

+34
-8
lines changed

2 files changed

+34
-8
lines changed

samples/03_org_administrators/validate_item_metadata.ipynb

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"\n",
4949
"import pandas as pd\n",
5050
"\n",
51-
"from arcgis.gis import GIS"
51+
"from arcgis.gis import GIS, ItemTypeEnum, ItemProperties"
5252
]
5353
},
5454
{
@@ -466,7 +466,21 @@
466466
}
467467
],
468468
"source": [
469-
"gis.content.add({}, output_dir + out_file)"
469+
"from arcgis.gis\n",
470+
"\n",
471+
"root_folder = gis.content.folders.get()\n",
472+
"\n",
473+
"new_item_props = ItemProperties(\n",
474+
" \"title\":out_file,\n",
475+
" \"type\":ItemTypeEnum.CSV.value,\n",
476+
" \"tags\":\"item_metatdata_report\",\n",
477+
" \"snippet\":\"Report on item attributes from aPI\"\n",
478+
")\n",
479+
"\n",
480+
"root_folder.add(\n",
481+
" item_properties=new_item_props,\n",
482+
" file=os.path.join(output_dir + out_file)\n",
483+
").result()"
470484
]
471485
},
472486
{
@@ -516,7 +530,7 @@
516530
"name": "python",
517531
"nbconvert_exporter": "python",
518532
"pygments_lexer": "ipython3",
519-
"version": "3.7.16"
533+
"version": "3.11.0"
520534
},
521535
"toc": {
522536
"base_numbering": 1,
@@ -533,5 +547,5 @@
533547
}
534548
},
535549
"nbformat": 4,
536-
"nbformat_minor": 2
550+
"nbformat_minor": 4
537551
}

samples/03_org_administrators/validate_user_profiles.ipynb

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"\n",
4545
"import pandas as pd\n",
4646
"\n",
47-
"from arcgis.gis import GIS"
47+
"from arcgis.gis import GIS, ItemPropertie, ItemTypeEnum"
4848
]
4949
},
5050
{
@@ -281,7 +281,19 @@
281281
}
282282
],
283283
"source": [
284-
"gis.content.add({}, output_dir + out_file)"
284+
"item_props = ItemProperties(\n",
285+
" \"title\" = out_file,\n",
286+
" \"type\" = ItemTypeEnum.CSV,\n",
287+
" \"tags\" = \"user_profile_report\",\n",
288+
" \"snippet\" = \"Report on user profile data from Python API\"\n",
289+
")\n",
290+
"\n",
291+
"root_folder = gis.content.folders.get()\n",
292+
"\n",
293+
"gis.content.add(\n",
294+
" item_properties = item_props,\n",
295+
" file= os.path.join(output_dir + out_file)\n",
296+
").result()"
285297
]
286298
},
287299
{
@@ -331,7 +343,7 @@
331343
"name": "python",
332344
"nbconvert_exporter": "python",
333345
"pygments_lexer": "ipython3",
334-
"version": "3.7.16"
346+
"version": "3.11.0"
335347
},
336348
"toc": {
337349
"base_numbering": 1,
@@ -348,5 +360,5 @@
348360
}
349361
},
350362
"nbformat": 4,
351-
"nbformat_minor": 2
363+
"nbformat_minor": 4
352364
}

0 commit comments

Comments
 (0)