File tree Expand file tree Collapse file tree 2 files changed +32
-8
lines changed
samples/03_org_administrators Expand file tree Collapse file tree 2 files changed +32
-8
lines changed Original file line number Diff line number Diff line change 48
48
" \n " ,
49
49
" import pandas as pd\n " ,
50
50
" \n " ,
51
- " from arcgis.gis import GIS"
51
+ " from arcgis.gis import GIS, ItemTypeEnum, ItemProperties "
52
52
]
53
53
},
54
54
{
466
466
}
467
467
],
468
468
"source" : [
469
- " gis.content.add({}, output_dir + out_file)"
469
+ " root_folder = gis.content.folders.get()\n " ,
470
+ " \n " ,
471
+ " new_item_props = ItemProperties(\n " ,
472
+ " \" title\" :out_file,\n " ,
473
+ " \" type\" :ItemTypeEnum.CSV.value,\n " ,
474
+ " \" tags\" :\" item_metatdata_report\" ,\n " ,
475
+ " \" snippet\" :\" Report on item attributes from API\"\n " ,
476
+ " )\n " ,
477
+ " \n " ,
478
+ " root_folder.add(\n " ,
479
+ " item_properties=new_item_props,\n " ,
480
+ " file=os.path.join(output_dir + out_file)\n " ,
481
+ " ).result()"
470
482
]
471
483
},
472
484
{
516
528
"name" : " python" ,
517
529
"nbconvert_exporter" : " python" ,
518
530
"pygments_lexer" : " ipython3" ,
519
- "version" : " 3.7.16 "
531
+ "version" : " 3.11.0 "
520
532
},
521
533
"toc" : {
522
534
"base_numbering" : 1 ,
533
545
}
534
546
},
535
547
"nbformat" : 4 ,
536
- "nbformat_minor" : 2
548
+ "nbformat_minor" : 4
537
549
}
Original file line number Diff line number Diff line change 44
44
" \n " ,
45
45
" import pandas as pd\n " ,
46
46
" \n " ,
47
- " from arcgis.gis import GIS"
47
+ " from arcgis.gis import GIS, ItemPropertie, ItemTypeEnum "
48
48
]
49
49
},
50
50
{
281
281
}
282
282
],
283
283
"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()"
285
297
]
286
298
},
287
299
{
331
343
"name" : " python" ,
332
344
"nbconvert_exporter" : " python" ,
333
345
"pygments_lexer" : " ipython3" ,
334
- "version" : " 3.7.16 "
346
+ "version" : " 3.11.0 "
335
347
},
336
348
"toc" : {
337
349
"base_numbering" : 1 ,
348
360
}
349
361
},
350
362
"nbformat" : 4 ,
351
- "nbformat_minor" : 2
363
+ "nbformat_minor" : 4
352
364
}
You can’t perform that action at this time.
0 commit comments