12345678910111213141516171819202122232425262728293031323334 |
- import warnings
- warnings.filterwarnings('ignore')
- from apscheduler.schedulers.blocking import BlockingScheduler
- from sync_amz_data.public import sp_api_client
- def func_run():
- days = -4
- try:
- sp_api_client.SpApiRequest.get_allShops("GET_FLAT_FILE_ALL_ORDERS_DATA_BY_ORDER_DATE_GENERAL",days=days,**{})
- except Exception as e:
- print(e)
- try:
- sp_api_client.SpApiRequest.get_allShops("GET_SALES_AND_TRAFFIC_REPORT",days=days,**{"level":"SKU"})
- sp_api_client.SpApiRequest.get_allShops("GET_SALES_AND_TRAFFIC_REPORT",days=days,**{"level":"PARENT"})
- sp_api_client.SpApiRequest.get_allShops("GET_SALES_AND_TRAFFIC_REPORT",days=days,**{"level":"CHILD"})
- except Exception as e:
- print(e)
- print("-"*40)
- try:
- sp_api_client.SpApiRequest.get_allShops("GET_FLAT_FILE_OPEN_LISTINGS_DATA")
- except Exception as e:
- print(e)
- print("="*40)
- try:
- sp_api_client.SpApiRequest.listing_infoTable()
- except Exception as e:
- print(e)
- # func_run()
- #
- if __name__ == '__main__':
- sched = BlockingScheduler()
- sched.add_job(func_run,'cron',hour=18,minute=0,second=0)
- sched.start()
|