Skip to content

Instantly share code, notes, and snippets.

View zedauna's full-sized avatar

VIGAN Jéros zedauna

View GitHub Profile
@zedauna
zedauna / AGO_PullHostedFeatures.py
Created November 5, 2023 10:36 — forked from oevans/AGO_PullHostedFeatures.py
Python script to pull hosted features with attachments into a local file geodatabase. See ReadMe below.
import os, urllib, urllib2, datetime, arcpy, json
## ============================================================================== ##
## function to update a field - basically converts longs to dates for date fields ##
## since json has dates as a long (milliseconds since unix epoch) and geodb wants ##
## a proper date, not a long.
## ============================================================================== ##
def updateValue(row,field_to_update,value):
outputfield=next((f for f in fields if f.name ==field_to_update),None) #find the output field