<?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: development tips for AGOL notebooks? in ArcGIS Notebooks Questions</title>
    <link>https://community.esri.com/t5/arcgis-notebooks-questions/development-tips-for-agol-notebooks/m-p/1170434#M535</link>
    <description>&lt;P&gt;Thanks, Ravi. Those links are going to fill in a lot of my missing knowledge. It looks pretty easy&amp;nbsp; to go from SEDF to hosted feature layer via&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/guide/part3-data-io-writing-data/#Publish-as-a-Feature-Layer" target="_self"&gt;sdf.spatial.to_featurelayer&lt;/A&gt;. What's the simplest way to &lt;EM&gt;&lt;U&gt;append&lt;/U&gt;&lt;/EM&gt; an SEDF to a hosted feature layer? (Or a total overwrite works, too.)&lt;/P&gt;&lt;P&gt;I've seen that&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html?highlight=to_featurelayer#arcgis.features.FeatureLayer.append" target="_self"&gt;FeatureLayer.append()&lt;/A&gt; takes various input formats, but SDF is not one of them. It looks like FeatureCollection is supported, and I can &lt;A href="https://developers.arcgis.com/python/guide/part3-data-io-writing-data/#Write-to-FeatureCollection" target="_self"&gt;export an SDF to that&lt;/A&gt;. To append local data to a hosted feature layer, I'm envisioning a path like: FGDB feature class &amp;gt;&amp;gt; SEDF &amp;gt;&amp;gt; Feature Collection json &amp;gt;&amp;gt; FeatureLayer.append().&amp;nbsp;Does that seem like the simplest route?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Other ideas that I like less:&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;This&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/sample-notebooks/updating-features-in-a-feature-layer/#Adding-new-features" target="_self"&gt;sample&lt;/A&gt;&amp;nbsp;converts an SDF to a list of dict objects, which are appended with FeatureLayer.edit_features(adds=&amp;lt;list&amp;gt;). I understand it, but looping through all the fields seems more cumbersome.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;If I upload a zipped FGDB item and create a hosted feature layer from it, overwriting the former will update the latter. This is more of an overwrite than an append, which is probably ok, but has quite a few steps to save out a new FGDB, zip it up, upload it, clean up temp data, etc.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 03 May 2022 23:12:06 GMT</pubDate>
    <dc:creator>davedoesgis</dc:creator>
    <dc:date>2022-05-03T23:12:06Z</dc:date>
    <item>
      <title>development tips for AGOL notebooks?</title>
      <link>https://community.esri.com/t5/arcgis-notebooks-questions/development-tips-for-agol-notebooks/m-p/1169098#M520</link>
      <description>&lt;P&gt;I'm trying to create a couple of live data feeds with Python. I would normally build them with arcpy and Windows scheduled tasks, but IT permissions issues are putting up roadblocks. It looks like AGOL Notebooks might suit my needs, and I will probably run an ArcPy kernel (we have credits). I have some specific questions, but any tips or tricks moving to the AGOL Notebook environment are appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you're using arcpy to do processing, how do you publish to AGOL? In Pro, I would have a local feature class in an APRX map layer, which I use to create a service definition draft and service definition. My symbology and metadata all tag along for the ride. In AGOL notebooks, I'm envisioning my feature classes and rasters will be variables, such as the output from a geoprocessing task, but then what's the preferred&amp;nbsp;way to publish that to AGOL?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where do you store temp data?&amp;nbsp;I uploaded a mostly empty zipped FGDB to my notebook's files and unzipped it. I can read and write there, so I guess that works, but I'm not sure this is the best way to use this tool. No specific question here, just wondering about general strategies for temp data storage. Do you tend to use more in-memory feature classes and rasters in this environment? Or do you publish temp data to AGOL and then consume it?&amp;nbsp;&lt;/P&gt;&lt;P&gt;How about development workflow?&amp;nbsp;Do you develop in a local IDE (e.g.: Visual Studio Code, Spyder, PyCharm)&amp;nbsp; or Pro Notebook and push that out to your AGOL Notebook? Or do you just develop in AGOL? I think I would go crazy without a debugger...&lt;/P&gt;&lt;P&gt;How about source code management in Git? I see AGOL Notebooks have snapshots, but wondering if anyone has tips for checking code into Git.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I could keep going, but any strategies, things you struggled with, or clever hacks are appreciated. My brain is on overload thinking about moving from IDE-based arcpy code to the AGOL Notebook environment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 23:18:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-notebooks-questions/development-tips-for-agol-notebooks/m-p/1169098#M520</guid>
      <dc:creator>davedoesgis</dc:creator>
      <dc:date>2022-04-28T23:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: development tips for AGOL notebooks?</title>
      <link>https://community.esri.com/t5/arcgis-notebooks-questions/development-tips-for-agol-notebooks/m-p/1169186#M521</link>
      <description>&lt;P&gt;A few tips:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Re: an IDE, absolutely go that way.&amp;nbsp; Developing in an IDE is way easier than a notebook, get it working there first with the debugger and then push it to the notebook.&amp;nbsp; Use source control from your local copy.&lt;/LI&gt;&lt;LI&gt;In-memory feature classes are definitely the way to go provided you don't need to rely on domains/etc.&amp;nbsp; For files, you can use the notebook environment's /tmp directory.&lt;/LI&gt;&lt;LI&gt;Use the ArcGIS API for Python wherever possibly over ArcPy equivalents.&amp;nbsp; This might not be relevant for your specific task since you're publishing but I use scheduled notebooks for analysis a lot and reading/writing to services is better with the new API.&amp;nbsp; (An exception would be for AGOL analysis tools with ArcPy equivalents - e.g. if you need a spatial join use in-memory feature classes and ArcPy's spatial join over the AGOL version, for credit reasons.)&lt;/LI&gt;&lt;LI&gt;If you need to store credentials, keep them in a file in the notebook's /arcgis/home directory and not the notebook.&lt;/LI&gt;&lt;LI&gt;For configuration and logging, create a hosted feature service with two tables, one with config/key values and the other for writing log messages to.&amp;nbsp; You can then build a dashboard that reads from your log table.&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Fri, 29 Apr 2022 08:15:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-notebooks-questions/development-tips-for-agol-notebooks/m-p/1169186#M521</guid>
      <dc:creator>MobiusSnake</dc:creator>
      <dc:date>2022-04-29T08:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: development tips for AGOL notebooks?</title>
      <link>https://community.esri.com/t5/arcgis-notebooks-questions/development-tips-for-agol-notebooks/m-p/1169356#M523</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/115587"&gt;@MobiusSnake&lt;/a&gt;&amp;nbsp;- Thanks, this is encouraging. I love the idea of logging to a table and building a dashboard. Checking the Notebook task output is super clunky.&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do you publish from ArcPy to AGOL? I've done it via creating .sddraft and .sd files, but it's super clunky. I was hoping there's a more integrated way if I'm running my code on AGOL. Can I at least use in-memory feature classes and rasters, or do I need to persist them?&amp;nbsp;&lt;/P&gt;&lt;P&gt;About that /tmp directory, that's a nice easter egg. It doesn't show up in the file listing. Does AGOL clean that up for us, or do we still have to manage it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 15:32:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-notebooks-questions/development-tips-for-agol-notebooks/m-p/1169356#M523</guid>
      <dc:creator>davedoesgis</dc:creator>
      <dc:date>2022-04-29T15:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: development tips for AGOL notebooks?</title>
      <link>https://community.esri.com/t5/arcgis-notebooks-questions/development-tips-for-agol-notebooks/m-p/1169372#M524</link>
      <description>&lt;P&gt;I haven't had to publish services within AGOL so I can't really say much about that specific workflow.&lt;/P&gt;&lt;P&gt;I clean up the /tmp folder myself but not sure if it's done automatically at some interval.&amp;nbsp; I know if you write a file to it then close and re-open the notebook within a short period of time your file will still be there though, so it's not immediate clean-up.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 15:53:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-notebooks-questions/development-tips-for-agol-notebooks/m-p/1169372#M524</guid>
      <dc:creator>MobiusSnake</dc:creator>
      <dc:date>2022-04-29T15:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: development tips for AGOL notebooks?</title>
      <link>https://community.esri.com/t5/arcgis-notebooks-questions/development-tips-for-agol-notebooks/m-p/1169426#M526</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/331220"&gt;@davedoesgis&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what type of services do you publish? you can check out publishing capability available in ArcGIS API for Python, for task such as publishing a feature layer from FGDB, Shp, Service Definition etc.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/python/guide/accessing-and-creating-content/#Publishing-an-item-as-a-web-layer" target="_blank"&gt;https://developers.arcgis.com/python/guide/accessing-and-creating-content/#Publishing-an-item-as-a-web-layer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Would be interested to hear more on your comment about accessing task output being clunky and see how see how we could improve the experience here.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anything you write under /arcgis/home will be persisted and can be accessed anytime. Other file locations are temporary and content will be lost once the container goes away.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 17:46:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-notebooks-questions/development-tips-for-agol-notebooks/m-p/1169426#M526</guid>
      <dc:creator>RaviNarayanan</dc:creator>
      <dc:date>2022-04-29T17:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: development tips for AGOL notebooks?</title>
      <link>https://community.esri.com/t5/arcgis-notebooks-questions/development-tips-for-agol-notebooks/m-p/1169498#M527</link>
      <description>&lt;P&gt;I guess I called two things clunky in my reply. I need a thesaurus &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Regarding seeing the task output, that is referencing how many mouse clicks it takes to just see the latest output compared to something like tailing a log file on a server. You have to log in to AGOL, find and open the Notebook, click tasks, click on your task, click the last run. I guess it's not that hard, but compared to a server log file I can access via UNC path, I just open it from my Notepad++ history (if it isn't open already) and hit Ctrl-End.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regarding publishing out of an ArcPy environment, I just find the whole .sddraft and .sd files process cumbersome. I have to run&amp;nbsp;getWebLayerSharingDraft(), set a bunch of properties, run&amp;nbsp;exportToSDDraft(), and then run&amp;nbsp;StageService_server(). And then I don't think I even have the item ID or a reference to what was created, so more code to find it before&amp;nbsp;I can further work with it. Depending on how many properties I want to tweak, I'm looking at minimum ~40 lines of code.&amp;nbsp;In the Pro GUI, I right click on a map layer and choose share as web layer. There's a few properties to fill out and you're on your way. It seems like it's as simple as running a GP tool (e.g.: clip is one line of ArcPy code), so I was surprised to see how much there is to do behind the scenes when you're coding it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Creating or overwriting a feature layer with a zipped FGDB is pretty easy in the 'arcgis' package. But you still have to make sure your FGDB only contains the FCs to upload and zip it up before you can get started. It's not too bad, but I sure wish there was a way to just publish an unzipped feature class with one command.&amp;nbsp;&lt;/P&gt;&lt;P&gt;And if you have a variable that stores an in-memory feature class (i.e.: output from a GP tool), is there some way to publish those? I suspect we're looking at more code to store them before you get to the workflows I mentioned above.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm looking at possibly going from an FGDB feature class to a pandas dataframe (using pd.DataFrame.spatial.from_featureclass). Once I have that, is there a pretty streamlined workflow to update a FeatureLayer with that?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 21:21:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-notebooks-questions/development-tips-for-agol-notebooks/m-p/1169498#M527</guid>
      <dc:creator>davedoesgis</dc:creator>
      <dc:date>2022-04-29T21:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: development tips for AGOL notebooks?</title>
      <link>https://community.esri.com/t5/arcgis-notebooks-questions/development-tips-for-agol-notebooks/m-p/1170398#M533</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/331220"&gt;@davedoesgis&lt;/a&gt;&amp;nbsp;Thanks for this additional info. We will take your feedback into consideration when making future enhancements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tasks can also be accessed/managed via ArcGIS API for Python. Here is a sample code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
from arcgis.gis import tasks
gis = GIS("home")
# tasks are a user resource and can accessed as below
tasks = gis.users.me.tasks
item = gis.content.get("mynotebooksitemId")
my_notebook_task = tasks.search(item,True,"ExecuteNotebook")
# get status of a task run from its properties.
my_notebook_task_property = my_notebook_task[0].runs[0].properties
# you can get the result as an HTML
taskId = my_notebook_task_property['task']['id']
runId = my_notebook_task_property['runId']
task_result = item.resources.get(taskId +'_'+ run_id + '.json')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regarding creation of feature layer from in-memory layer and pandas data frame, there are some references here:&lt;/P&gt;&lt;P&gt;&lt;A title="Data IO with SeDF" href="https://developers.arcgis.com/python/guide/part2-data-io-reading-data/" target="_blank" rel="noopener"&gt;Data IO with SeDF - Accessing Data&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A title="Data IO with SeDF - writing data" href="https://developers.arcgis.com/python/guide/part3-data-io-writing-data/" target="_blank" rel="noopener"&gt;Data IO with SeDF - writing data&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 21:24:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-notebooks-questions/development-tips-for-agol-notebooks/m-p/1170398#M533</guid>
      <dc:creator>RaviNarayanan</dc:creator>
      <dc:date>2022-05-03T21:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: development tips for AGOL notebooks?</title>
      <link>https://community.esri.com/t5/arcgis-notebooks-questions/development-tips-for-agol-notebooks/m-p/1170434#M535</link>
      <description>&lt;P&gt;Thanks, Ravi. Those links are going to fill in a lot of my missing knowledge. It looks pretty easy&amp;nbsp; to go from SEDF to hosted feature layer via&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/guide/part3-data-io-writing-data/#Publish-as-a-Feature-Layer" target="_self"&gt;sdf.spatial.to_featurelayer&lt;/A&gt;. What's the simplest way to &lt;EM&gt;&lt;U&gt;append&lt;/U&gt;&lt;/EM&gt; an SEDF to a hosted feature layer? (Or a total overwrite works, too.)&lt;/P&gt;&lt;P&gt;I've seen that&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html?highlight=to_featurelayer#arcgis.features.FeatureLayer.append" target="_self"&gt;FeatureLayer.append()&lt;/A&gt; takes various input formats, but SDF is not one of them. It looks like FeatureCollection is supported, and I can &lt;A href="https://developers.arcgis.com/python/guide/part3-data-io-writing-data/#Write-to-FeatureCollection" target="_self"&gt;export an SDF to that&lt;/A&gt;. To append local data to a hosted feature layer, I'm envisioning a path like: FGDB feature class &amp;gt;&amp;gt; SEDF &amp;gt;&amp;gt; Feature Collection json &amp;gt;&amp;gt; FeatureLayer.append().&amp;nbsp;Does that seem like the simplest route?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Other ideas that I like less:&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;This&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/sample-notebooks/updating-features-in-a-feature-layer/#Adding-new-features" target="_self"&gt;sample&lt;/A&gt;&amp;nbsp;converts an SDF to a list of dict objects, which are appended with FeatureLayer.edit_features(adds=&amp;lt;list&amp;gt;). I understand it, but looping through all the fields seems more cumbersome.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;If I upload a zipped FGDB item and create a hosted feature layer from it, overwriting the former will update the latter. This is more of an overwrite than an append, which is probably ok, but has quite a few steps to save out a new FGDB, zip it up, upload it, clean up temp data, etc.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 23:12:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-notebooks-questions/development-tips-for-agol-notebooks/m-p/1170434#M535</guid>
      <dc:creator>davedoesgis</dc:creator>
      <dc:date>2022-05-03T23:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: development tips for AGOL notebooks?</title>
      <link>https://community.esri.com/t5/arcgis-notebooks-questions/development-tips-for-agol-notebooks/m-p/1341795#M690</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/331220"&gt;@davedoesgis&lt;/a&gt;!&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the October 2023 update of ArcGIS Online, we added a "manage tasks" experience on the ArcGIS Notebooks home page that allows you to manage all notebook tasks accessible to you.&amp;nbsp;We hope this new experience can help you quickly check notebook tasks &lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;.&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://doc.arcgis.com/en/arcgis-online/create-maps/manage-scheduled-tasks.htm" target="_blank" rel="noopener"&gt;Manage scheduled tasks&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://doc.arcgis.com/en/arcgis-online/reference/whats-new.htm" target="_blank" rel="noopener"&gt;What's new in ArcGIS Online (October 2023)&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Let us know if you have any other questions.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Lingtao&lt;BR /&gt;Product Engineer for ArcGIS Notebooks&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 05:12:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-notebooks-questions/development-tips-for-agol-notebooks/m-p/1341795#M690</guid>
      <dc:creator>xlt208</dc:creator>
      <dc:date>2023-10-26T05:12:17Z</dc:date>
    </item>
  </channel>
</rss>

