Posts tagged with yaml

I'm pretty new to python and Flask development. I'm primarily a frontend JavaScript/React developer.

I am building a tool that uses the Google Ads api, and their documentation had me create a yaml file with my refresh tokens and other important info.

I'm trying to deploy my flask app to render.com and I'm unsure what to do with the yaml files since I want to keep my tokens secure. Any advice?

So far I've tried adding my tokens in an env file and reading them that way, but it looks like the google ads api needs the yaml file.

im trying to use get functions for reports under googleads.

#My code

from googleads import adwords from googleads import errors import time import datetime import os import sys if __name__ == '__main__':   ## initialize google adwords client object   adwords_client = adwords.AdWordsClient.LoadFromStorage("googleAds.yaml")   ## set your customer-ID   adwords_client.SetClientCustomerId('389204095687-xx.apps.googleusercontent.com')   report_downloader = adwords_client.GetReportDownloader(version='v9')   ## get CLICK_PERFORMANCE report for yesterday as an example   report_date = datetime.datetime.now()-datetime.timedelta(days=1)   report_date_string = report_date.strftime("%Y%m%d")   ## build the report query   report_query = (adwords.ReportQueryBuilder()       .Select('campaign.id','ad_group.id', 'metrics.impressions', 'metrics.clicks')       .From('ad_group')       .During(start_date=report_date_string,end_date=report_date_string)       .Build())   ## download the report as CSV into string   csv_report = report_downloader.DownloadReportWithAwql(       report_query, 'CSV', skip_report_header=True,       skip_column_header=True, skip_report_summary=True,       include_zero_impressions=False)    

But i receive the below traceback error-

   with open(path, 'rb') as handle: FileNotFoundError: [Errno 2] No such file or directory: 'googleAds.yaml' During handling of the above exception, another exception occurred: Traceback (most recent call last):   File "<ipython-input-5-d90ad0259074>", line 16, in <module>     adwords_client = adwords.AdWordsClient.LoadFromStorage("googleAds.yaml")   File "C:\Users\jj\AppData\Local\Continuum\anaconda3\lib\site-packages\googleads\adwords.py", line 193, in LoadFromStorage     cls._OPTIONAL_INIT_VALUES))   File "C:\Users\jj\AppData\Local\Continuum\anaconda3\lib\site-packages\googleads\common.py", line 247, in LoadFromStorage     'Given yaml file, %s, could not be opened.' % path) GoogleAdsValueError: Given yaml file, googleAds.yaml, could not be opened. 

I reviewed the documentation for Oath: https://github.com/googleads/googleads-python-lib/wiki/API-access-using-own-credentials-(installed-application-flow)#step-2---setting-up-the-client-library

but I already have all the credentials, i just dont know how to create the yml file and save it where python can detect it

I was trying to create a AWS stack to deploy Whatsapp Business client API. But Creating stack throws following error. error: The following resource(s) failed to create: [KMSKey, MountTarget2, MountTarget, lambdaStack, dbStack]

I followed this documentation steps. https://developers.facebook.com/docs/whatsapp/on-premises/get-started/installation/aws