<?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 publishing Python script to server as geoprocessing service?? in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-python-script-to-server-as/m-p/379942#M14737</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to directly publish a Python script as a geoprocessing service, and I cannot seem to get it to work.&amp;nbsp; From what I'm reading, I'm not even certain if I should be able to do this without wrapping a model from Model Builder around my script?&amp;nbsp; Can anyone tell me if there IS indeed a way to publish a straight up Python script as a geoprocessing service from an arc toolbox?&amp;nbsp; And if so, what exactly need I do to my output (feature set) to GET it to become output from the script to the server.&amp;nbsp;&amp;nbsp; Examples welcome.&amp;nbsp; I can't seem to find much information about Python scripts as geoprocessing services.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Jun 2013 16:15:31 GMT</pubDate>
    <dc:creator>CyndyBresloff</dc:creator>
    <dc:date>2013-06-28T16:15:31Z</dc:date>
    <item>
      <title>publishing Python script to server as geoprocessing service??</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-python-script-to-server-as/m-p/379942#M14737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to directly publish a Python script as a geoprocessing service, and I cannot seem to get it to work.&amp;nbsp; From what I'm reading, I'm not even certain if I should be able to do this without wrapping a model from Model Builder around my script?&amp;nbsp; Can anyone tell me if there IS indeed a way to publish a straight up Python script as a geoprocessing service from an arc toolbox?&amp;nbsp; And if so, what exactly need I do to my output (feature set) to GET it to become output from the script to the server.&amp;nbsp;&amp;nbsp; Examples welcome.&amp;nbsp; I can't seem to find much information about Python scripts as geoprocessing services.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jun 2013 16:15:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-python-script-to-server-as/m-p/379942#M14737</guid>
      <dc:creator>CyndyBresloff</dc:creator>
      <dc:date>2013-06-28T16:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: publishing Python script to server as geoprocessing service??</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-python-script-to-server-as/m-p/379943#M14738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Cyndy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The first step to publishing a script is making it into a script tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not sure how far you've got with that, I'll just point you at the &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/#/A_quick_tour_of_creating_tools_with_Python/00150000002q000000/"&gt;high level topic&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Once you've created a script tool, you should be able to run it fine from Desktop. If thats the case, its just a matter of publishing it like you'd publish any other tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/#/Authoring_geoprocessing_tasks_with_Python_scripts/00570000007r000000/"&gt;This help topic&lt;/A&gt;&lt;SPAN&gt; talks about some of the pieces to be aware of with script tools as a gp service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To answer your one question though, if you're doing some sort of "features" as output in the tool - creating your script tool with FeatureClass as the output type. When publishing, everything is handled for you in terms of making output featureclass work in Server. For your input, well it varies greatly, but FeatureSet is one of the most commonly used input parameters as it allows you to both "draw" input features as well as pass in existing layers and featureclasses.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jul 2013 14:58:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-python-script-to-server-as/m-p/379943#M14738</guid>
      <dc:creator>KevinHibma</dc:creator>
      <dc:date>2013-07-01T14:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: publishing Python script to server as geoprocessing service??</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-python-script-to-server-as/m-p/379944#M14739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Kevin -&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Getting to the script tool point was easy.&amp;nbsp; I'm actually now stuck at the point where I don't know how to manage paths in my script for server vs as a Desktop tool.&amp;nbsp; Ie, in my tool on the desktop I give it the path to look for my data, and I'm not sure how to rewrite that bit for the script as a server tool.&amp;nbsp; I also am not sure how to direct the script for a scratch directory path for when it runs via server.&amp;nbsp; Can you advice, I'm not getting an answer for this through the help. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example - if I a using an arcpy method that uses a path as one of the parameters, what do I use?&amp;nbsp; arcpy.env.Workspace won't work with the setting I use for Desktop, and not setting it results in an error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Thanks!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jul 2013 20:00:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-python-script-to-server-as/m-p/379944#M14739</guid>
      <dc:creator>CyndyBresloff</dc:creator>
      <dc:date>2013-07-02T20:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: publishing Python script to server as geoprocessing service??</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-python-script-to-server-as/m-p/379945#M14740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Cyndy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The 2nd link I provided above talks about data inputs and outputs.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's some quick points:&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;Input from a tool parameter will be part of the service, it gets there when publishing a result. The Service Editor handles this&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;We call data defined inside the tool, "project data". During publishing we scan the script, match it if possible to data registered in the data store or copy and update paths if there isn't a match&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Outputs should almost always be written to scratch. Use the os.path.join(arcpy.env.scratchGDB, "output") style&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;BR /&gt;&lt;SPAN&gt;If you happen to be coming to UC, I'm giving a demo theater that will touch on all these topics.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://events.esri.com/uc/2013/infoweb/onlineagenda/?fa=ofg_details_form&amp;amp;ScheduleID=1830"&gt;http://events.esri.com/uc/2013/infoweb/onlineagenda/?fa=ofg_details_form&amp;amp;ScheduleID=1830&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jul 2013 20:20:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-python-script-to-server-as/m-p/379945#M14740</guid>
      <dc:creator>KevinHibma</dc:creator>
      <dc:date>2013-07-02T20:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: publishing Python script to server as geoprocessing service??</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-python-script-to-server-as/m-p/379946#M14741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;almost seems like there should be 'types' of gp tools - those that run in desktop and those that are designed, from the ground up, to be run as ags gp services.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jul 2013 20:28:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-python-script-to-server-as/m-p/379946#M14741</guid>
      <dc:creator>KevinGooss</dc:creator>
      <dc:date>2013-07-11T20:28:26Z</dc:date>
    </item>
  </channel>
</rss>

