2222"""
2323import asyncio
2424
25- from planet import Session , DataClient
25+ from planet import Session
2626
2727river_item_id = '20221003_002705_38_2461'
2828river_item_type = 'PSScene'
3333wildfire_asset_type = 'basic_analytic_4b'
3434
3535
36- async def download_and_validate (item_id , item_type_id , asset_type_id , client ):
36+ async def download_and_validate (client , item_id , item_type_id , asset_type_id ):
37+ """Activate, download, and validate an asset as a single task."""
3738 # Get asset description
3839 asset = await client .get_asset (item_type_id , item_id , asset_type_id )
3940
@@ -51,19 +52,19 @@ async def download_and_validate(item_id, item_type_id, asset_type_id, client):
5152
5253
5354async def main ():
55+ """Download and validate assets in parallel."""
5456 async with Session () as sess :
55- # Data client object
56- client = DataClient (sess )
57- # Download and validate assets in parallel
57+ client = sess .client ('data' )
5858 await asyncio .gather (
59- download_and_validate (river_item_id ,
59+ download_and_validate (client ,
60+ river_item_id ,
6061 river_item_type ,
61- river_asset_type ,
62- client ) ,
63- download_and_validate ( wildfire_item_id ,
62+ river_asset_type ) ,
63+ download_and_validate ( client ,
64+ wildfire_item_id ,
6465 wildfire_item_type ,
65- wildfire_asset_type ,
66- client ) )
66+ wildfire_asset_type )
67+ )
6768
6869
6970if __name__ == '__main__' :
0 commit comments