<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Python script to consume JSON web service to file geodatabase in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-script-to-consume-json-web-service-to-file/m-p/734093#M56909</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want some python examples of how to extract features from a REST end point using python, you can find some in this thread: &lt;A href="https://community.esri.com/message/450145"&gt;Re: Extract Features From MapServer/ Rest/ Soap/ etc?&lt;/A&gt;&amp;nbsp; Jake Skinner created a toolbox to do this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are also references to some python code I write to do this:&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;the simple way: &lt;A _jive_internal="true" data-containerid="41573" data-containertype="2020" data-objectid="118781" data-objecttype="1" href="https://community.esri.com/thread/118781#445348" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #287433;"&gt;https://community.esri.com/thread/118781#445348&lt;/A&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;or using a little more advanced: &lt;A _jive_internal="true" data-containerid="41573" data-containertype="2020" data-objectid="118781" data-objecttype="1" href="https://community.esri.com/thread/118781#445572" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #287433;"&gt;https://community.esri.com/thread/118781#445572&lt;/A&gt;‌&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;You can find an example of updating a feature service through Python and REST here:&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;A href="https://community.esri.com/message/447121"&gt;Re: UpdateFeature REST API Python Script Unexpected Error&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Jan 2015 22:16:49 GMT</pubDate>
    <dc:creator>XanderBakker</dc:creator>
    <dc:date>2015-01-28T22:16:49Z</dc:date>
    <item>
      <title>Python script to consume JSON web service to file geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-consume-json-web-service-to-file/m-p/734092#M56908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am working on a proof of concept for a larger project and am sure this has been done and is possible, however I cannot find any examples anywhere.&amp;nbsp; I would like to use my own ArcGIS Feature Service as an example where I use a Python script to parse fields that I would like to keep and print and all geometries.&amp;nbsp; I can handle to print portion to CSV, then table to table conversion.&amp;nbsp; The block below works fine in printing the feature service info.&amp;nbsp; Later, I would like to use UPDATE to apply changes made in a web service directly to our feature service.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="font-weight: bold;"&gt;import &lt;/SPAN&gt;json
&lt;SPAN style="font-weight: bold;"&gt;import &lt;/SPAN&gt;urllib2

url &lt;SPAN style="font-weight: bold;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #dd1144;"&gt;'url'
&lt;/SPAN&gt;r &lt;SPAN style="font-weight: bold;"&gt;= &lt;/SPAN&gt;urllib2.urlopen(url)
data &lt;SPAN style="font-weight: bold;"&gt;= &lt;/SPAN&gt;json.loads(r.read().decode(r.info().getparam(&lt;SPAN style="color: #dd1144;"&gt;'charset'&lt;/SPAN&gt;) &lt;SPAN style="font-weight: bold;"&gt;or &lt;/SPAN&gt;&lt;SPAN style="color: #dd1144;"&gt;'utf-8'&lt;/SPAN&gt;))
&lt;SPAN style="font-weight: bold;"&gt;print &lt;/SPAN&gt;data&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prints:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;{u'maxRecordCount': 1000, u'layers': [{u'id': 0, u'name': u'ServiceRequest.DBO.ServiceTypeDevSchema'}], u'allowGeometryUpdates': True, u'supportsDisconnectedEditing': False, u'description': u'', u'tables': [{u'id': 1, u'name': u'ServiceRequest.DBO.queryTable'}, {u'id': 2, u'name': u'ServiceRequest.DBO.queryTableLocation'}], u'initialExtent': {u'xmin': -118.79175291224679, u'ymin': 34.0096898681482, u'ymax': 34.27571360860003, u'xmax': -118.36725706880667, u'spatialReference': {u'wkid': 4326, u'latestWkid': 4326}}, u'documentInfo': {u'Category': u'', u'Author': u'', u'Title': u'', u'Comments': u'', u'Keywords': u'', u'Subject': u''}, u'capabilities': u'Create,Delete,Query,Update,Uploads,Editing', u'copyrightText': u'', u'units': u'esriDecimalDegrees', u'currentVersion': 10.21, u'enableZDefaults': False, u'hasVersionedData': False, u'spatialReference': {u'wkid': 4326, u'latestWkid': 4326}, u'fullExtent': {u'xmin': -118.54056884699997, u'ymin': 33.941116961000034, u'ymax': 34.222864945000026, u'xmax': -118.23978848099995, u'spatialReference': {u'wkid': 4326, u'latestWkid': 4326}}, u'syncEnabled': False, u'serviceDescription': u'', u'supportedQueryFormats': u'JSON, AMF'}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:18:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-consume-json-web-service-to-file/m-p/734092#M56908</guid>
      <dc:creator>GeoffreyWest1</dc:creator>
      <dc:date>2021-12-12T07:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Python script to consume JSON web service to file geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-consume-json-web-service-to-file/m-p/734093#M56909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want some python examples of how to extract features from a REST end point using python, you can find some in this thread: &lt;A href="https://community.esri.com/message/450145"&gt;Re: Extract Features From MapServer/ Rest/ Soap/ etc?&lt;/A&gt;&amp;nbsp; Jake Skinner created a toolbox to do this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are also references to some python code I write to do this:&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;the simple way: &lt;A _jive_internal="true" data-containerid="41573" data-containertype="2020" data-objectid="118781" data-objecttype="1" href="https://community.esri.com/thread/118781#445348" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #287433;"&gt;https://community.esri.com/thread/118781#445348&lt;/A&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;or using a little more advanced: &lt;A _jive_internal="true" data-containerid="41573" data-containertype="2020" data-objectid="118781" data-objecttype="1" href="https://community.esri.com/thread/118781#445572" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #287433;"&gt;https://community.esri.com/thread/118781#445572&lt;/A&gt;‌&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;You can find an example of updating a feature service through Python and REST here:&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;A href="https://community.esri.com/message/447121"&gt;Re: UpdateFeature REST API Python Script Unexpected Error&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2015 22:16:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-consume-json-web-service-to-file/m-p/734093#M56909</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-01-28T22:16:49Z</dc:date>
    </item>
  </channel>
</rss>

