<?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 - Download Zip File in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-download-zip-file/m-p/1156407#M64125</link>
    <description>&lt;P&gt;I ran it manually from task scheduler, and it is working. It seems like configuration issue with windows task. I am not sure where to narrow it down. It hasn't been changed.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Mar 2022 20:54:42 GMT</pubDate>
    <dc:creator>AlexP_</dc:creator>
    <dc:date>2022-03-22T20:54:42Z</dc:date>
    <item>
      <title>Python - Download Zip File</title>
      <link>https://community.esri.com/t5/python-questions/python-download-zip-file/m-p/1094346#M62220</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am using python notebook on ArcGIS Pro 2.8. Please see script and screenshots. I was able to get data zip file download but unable to extract data zip file. It has FGBD as another zip file inside the zip file folder. Am I missing something?? Please kindly assist as soon as possible. I am not sure which group I can post. Thank you, Alex&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS

# Python Standard Library Modules
from pathlib import Path, PurePath
from zipfile import ZipFile

public_data_item_id = '123'

anon_gis = GIS(username="123", password="123")

data_item = anon_gis.content.get(public_data_item_id)

data_path = Path('C:\123')

if not data_path.exists():
    data_path.mkdir()

zip_path = data_path.joinpath('PAData.zip')
extract_path = data_path.joinpath('PADataDatasets')

data_item.download(save_path=data_path)

print (PurePath(zip_path))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlexP__0-1630500985280.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/22170iE08C2BAAB972AF86/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlexP__0-1630500985280.png" alt="AlexP__0-1630500985280.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlexP__1-1630500996117.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/22171i9085AFAC9C1586D5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlexP__1-1630500996117.png" alt="AlexP__1-1630500996117.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 13:01:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-download-zip-file/m-p/1094346#M62220</guid>
      <dc:creator>AlexP_</dc:creator>
      <dc:date>2021-09-01T13:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Python - Download Zip File</title>
      <link>https://community.esri.com/t5/python-questions/python-download-zip-file/m-p/1094625#M62233</link>
      <description>&lt;P&gt;Try &lt;A href="https://stackoverflow.com/a/3451150" target="_self"&gt;this solution&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;with ZipFile(zip_path, 'r') as zip_ref:
    zip_ref.extractall(extract_path)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 19:45:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-download-zip-file/m-p/1094625#M62233</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-09-01T19:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Python - Download Zip File</title>
      <link>https://community.esri.com/t5/python-questions/python-download-zip-file/m-p/1156122#M64120</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/191789"&gt;@BlakeTerhune&lt;/a&gt;&amp;nbsp; &amp;nbsp;Please see screenshots and python script. i also set it up on task scheduler. it was working running since September 2021 until stop recently. I haven't change any script and task scheduler.&amp;nbsp; For some reasons, my zip file 'PaFiles.gdb' stopped working. I found out that the last time inside that zip file, it ran populated on Jan. 2022 but everything else is fine.&amp;nbsp; Please advise. Thank you for your help.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlexP__1-1647960880536.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/36951iD536954747E0763A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlexP__1-1647960880536.png" alt="AlexP__1-1647960880536.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlexP__2-1647961091882.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/36952iDA05D82DCE05946A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlexP__2-1647961091882.png" alt="AlexP__2-1647961091882.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlexP__0-1647959878029.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/36947i93E6112970DC4751/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlexP__0-1647959878029.png" alt="AlexP__0-1647959878029.png" /&gt;&lt;/span&gt;&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

# Python Standard Library Modules
from pathlib import Path, PurePath
from zipfile import ZipFile

public_data_item_id = '123'

anon_gis = GIS(username="123", password="123")

data_item = anon_gis.content.get(public_data_item_id)

data_path = Path('C:\123')

if not data_path.exists():
    data_path.mkdir()
 
    
zip_path = data_path.joinpath('PAData.zip')
extract_path = data_path.joinpath('PADataDatasets')

with ZipFile(zip_path, 'r') as zip_ref:
    zip_ref.extractall(extract_path)  
    

data_item.download(save_path=data_path)

print (PurePath(zip_path))

from pathlib import Path, PurePath
from zipfile import ZipFile

data_path = Path('C:\123\PADataDatasets\PA_Data')

if not data_path.exists():
    data_path.mkdir()
 
    
zip_path = data_path.joinpath('PaFiles.gdb.zip')
extract_path = data_path.joinpath('PaFiles.gdb')

with ZipFile(zip_path, 'r') as zip_ref:
    zip_ref.extractall(extract_path)  
    

print (PurePath(zip_path))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 14:58:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-download-zip-file/m-p/1156122#M64120</guid>
      <dc:creator>AlexP_</dc:creator>
      <dc:date>2022-03-22T14:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Python - Download Zip File</title>
      <link>https://community.esri.com/t5/python-questions/python-download-zip-file/m-p/1156287#M64123</link>
      <description>&lt;P&gt;If it was working fine, it must be an access issue. I would start by logging in to the computer running the scheduled task as the user the scheduled task is running as, then see if you can run the script inside of an IDE there. If that works, then there's a configuration issue with Windows Task Scheduler. If it doesn't work, you should be able to debug it from the IDE.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 18:03:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-download-zip-file/m-p/1156287#M64123</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2022-03-22T18:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Python - Download Zip File</title>
      <link>https://community.esri.com/t5/python-questions/python-download-zip-file/m-p/1156407#M64125</link>
      <description>&lt;P&gt;I ran it manually from task scheduler, and it is working. It seems like configuration issue with windows task. I am not sure where to narrow it down. It hasn't been changed.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 20:54:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-download-zip-file/m-p/1156407#M64125</guid>
      <dc:creator>AlexP_</dc:creator>
      <dc:date>2022-03-22T20:54:42Z</dc:date>
    </item>
  </channel>
</rss>

