<?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 Updated best practices and process for using ArcGIS Python API in AWS Lambda layer in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/updated-best-practices-and-process-for-using/m-p/1230456#M7990</link>
    <description>&lt;P&gt;I believe that the post from 2018 (&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-on-aws-lambda/m-p/785315#M1344" target="_blank"&gt;https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-on-aws-lambda/m-p/785315#M1344&lt;/A&gt;) does not necessarily still apply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In short, would like to access the ArcGIS Python API in AWS Lambda for basic scripting.&amp;nbsp; So what I'd like to do is install the --no-deps version of the ArcGIS Python API (&lt;A href="https://developers.arcgis.com/python/guide/install-and-set-up/#install-with-minimum-dependencies" target="_blank"&gt;https://developers.arcgis.com/python/guide/install-and-set-up/#install-with-minimum-dependencies&lt;/A&gt;), along with required dependencies.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The documentation on the minimum dependencies is a little off - for example the documentation says one of the dependencies is requests_toolbelt.&amp;nbsp; For conda, it needs to be specified as requests-toolbelt.&amp;nbsp; Pip has a package requests_toolbelt.&amp;nbsp; The same goes for ntlm_auth (Conda it is ntlm-auth and Pip it is ntlm_auth).&lt;/P&gt;&lt;P&gt;It also seems like there are some other dependencies that are not included in the documentation: cachetools, lxml, and reqeusts_oauthlib are two of them that are required when trying to leverage the --no-deps version of the ArcGIS Python API with Python3.9.&lt;/P&gt;&lt;P&gt;Lastly, unclear on exactly what process should be used for implementing this in an AWS lambda layer (if this is even possible).&amp;nbsp; Conda to build environment (which packages the Python runtime as well so makes the layer even larger).&amp;nbsp; Pip to build?&amp;nbsp; What directory structure is needed for the .zip file?&amp;nbsp; These are all things I'm struggling with that I feel like other folks might have solved.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have heard AWS lambda has issues with certain libraries built with C, and also can't accept zip folders larger than a certain size (even if uploaded to S3 first).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Nov 2022 15:25:03 GMT</pubDate>
    <dc:creator>Jay_Gregory</dc:creator>
    <dc:date>2022-11-10T15:25:03Z</dc:date>
    <item>
      <title>Updated best practices and process for using ArcGIS Python API in AWS Lambda layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/updated-best-practices-and-process-for-using/m-p/1230456#M7990</link>
      <description>&lt;P&gt;I believe that the post from 2018 (&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-on-aws-lambda/m-p/785315#M1344" target="_blank"&gt;https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-on-aws-lambda/m-p/785315#M1344&lt;/A&gt;) does not necessarily still apply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In short, would like to access the ArcGIS Python API in AWS Lambda for basic scripting.&amp;nbsp; So what I'd like to do is install the --no-deps version of the ArcGIS Python API (&lt;A href="https://developers.arcgis.com/python/guide/install-and-set-up/#install-with-minimum-dependencies" target="_blank"&gt;https://developers.arcgis.com/python/guide/install-and-set-up/#install-with-minimum-dependencies&lt;/A&gt;), along with required dependencies.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The documentation on the minimum dependencies is a little off - for example the documentation says one of the dependencies is requests_toolbelt.&amp;nbsp; For conda, it needs to be specified as requests-toolbelt.&amp;nbsp; Pip has a package requests_toolbelt.&amp;nbsp; The same goes for ntlm_auth (Conda it is ntlm-auth and Pip it is ntlm_auth).&lt;/P&gt;&lt;P&gt;It also seems like there are some other dependencies that are not included in the documentation: cachetools, lxml, and reqeusts_oauthlib are two of them that are required when trying to leverage the --no-deps version of the ArcGIS Python API with Python3.9.&lt;/P&gt;&lt;P&gt;Lastly, unclear on exactly what process should be used for implementing this in an AWS lambda layer (if this is even possible).&amp;nbsp; Conda to build environment (which packages the Python runtime as well so makes the layer even larger).&amp;nbsp; Pip to build?&amp;nbsp; What directory structure is needed for the .zip file?&amp;nbsp; These are all things I'm struggling with that I feel like other folks might have solved.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have heard AWS lambda has issues with certain libraries built with C, and also can't accept zip folders larger than a certain size (even if uploaded to S3 first).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 15:25:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/updated-best-practices-and-process-for-using/m-p/1230456#M7990</guid>
      <dc:creator>Jay_Gregory</dc:creator>
      <dc:date>2022-11-10T15:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: Updated best practices and process for using ArcGIS Python API in AWS Lambda layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/updated-best-practices-and-process-for-using/m-p/1231224#M7994</link>
      <description>&lt;P&gt;I've used the Python API in a Lambda before and ran into the bloat issue with dependencies that you hint at. In my case, I was able to get it under the size limit but not without some work. My recommendation would be to take a moment to consider what functionality you actually need from the api and any other 3rd party libraries. If all you're using the api for is 2-3 things it might make sense just to code those parts yourself and keep things lean.&lt;/P&gt;&lt;P&gt;As far as setup goes, I'd recommend trying out a Serverless - it makes things much easier and leaves you with a template you can use for future Lambdas.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 14:08:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/updated-best-practices-and-process-for-using/m-p/1231224#M7994</guid>
      <dc:creator>EarlMedina</dc:creator>
      <dc:date>2022-11-14T14:08:03Z</dc:date>
    </item>
  </channel>
</rss>

