mirror of
https://github.com/dataforcanada/d4c-datapkg-statistical.git
synced 2026-10-04 13:15:47 +02:00
Will compare against the productIds available at https://www150.statcan.gc.ca/t1/wds/rest/getAllCubesListLite
2.3 KiB
2.3 KiB
In [1]:
import time
import aria2p
# initialization, these are the default values
aria2 = aria2p.API(
aria2p.Client(
host="http://localhost",
port=6800,
secret=""
)
)In [2]:
# Helper function to wait for download to finish
def wait_for_download(download):
print(f"Waiting for download: {download.name}")
while download.is_active:
print(f"Progress: {download.progress_string()} - {download.status}")
time.sleep(10)
download = aria2.get_download(download.gid) # refresh state
print(f"Download completed: {download.name} - Status: {download.status}")
return downloadIn [ ]:
urls = ['https://data.dataforcanada.org/processed/statistics_canada/boundaries/2021/digital_boundary_files/db_2021.parquet']
download = aria2.add_uris(urls, options={"out": "test.parquet"})
download = wait_for_download(download)Waiting for download: test.parquet Progress: 0.00% - active
In [ ]: