import datetime import os from utils import build_context days_ago = 7 today = datetime.datetime.now().strftime("%Y-%m-%d") start_date = (datetime.datetime.now() - datetime.timedelta(days=days_ago) ).strftime("%Y-%m-%d") # Renamed reports from the update to V1... thus V1_1 v1_reports = { 'basica2': 'useractivity', 'assetestimatedrevenuea1': 'assetrevenue', 'estimatedrevenuea1' : 'revenue', 'adratesa1': 'adrates' } string_test = "ahhhh!" initial_context = { 'jobid' : 'jobid', 'content_owner': 'a', 'start_time':'b', 's3_target':'c', 'local_target':'d', 'payload':'e' } Orchard_Music = 'J8vAyKuNSYBIN_9RIdxggQ' Orchard_Entertainment = 'oVAQ96fyMa57I6WozL2gUw' IODA = 'n293L2XLLmtg5wlKBao5Uw' CMS = [Orchard_Music,Orchard_Entertainment,IODA] CMS_DICT = {Orchard_Music:'orchardMusic', Orchard_Entertainment:'orchardEntertainment', IODA:'IODA'} CRED_PATH = os.environ.get('CRED_PATH') STAGE = os.environ.get('YT_STAGE') if CRED_PATH: CLIENT_SECRETS_FILE = os.path.join(CRED_PATH,'client_secrets_installed.json') TOKEN = os.path.join(CRED_PATH,'youtube_access_token.json') # S3 locations BUCKET = 's3://dev-rsaporta' KEY = 'DataAnalyticsDept/youtubeAnalytics/reportsV1_1' S3_PATH = os.path.join(BUCKET,KEY) # Snowflake stuff PROD_DB = 'PROD' PROD_SCHEMA = 'YT_REPORTS_API_V1_1' PROD_FMT = 'LY_DEV.TEMPLATES.YOUTUBE_DAILY' # Target builders s3_target_template = {} # ANALYTICS API Versioning YOUTUBE_REPORTING_API_SERVICE_NAME = "youtubereporting" YOUTUBE_REPORTING_API_VERSION = "v1" # Scopes needed to get Authenticated YOUTUBE_REPORT_SCOPES = ( "https://www.googleapis.com/auth/youtube.readonly", "https://www.googleapis.com/auth/yt-analytics.readonly", "https://www.googleapis.com/auth/yt-analytics-monetary.readonly", "https://www.googleapis.com/auth/youtubepartner", "https://www.googleapis.com/auth/youtubepartner-channel-audit" ) MISSING_CLIENT_SECRETS_MESSAGE = """ WARNING: Please configure OAuth 2.0 To make this sample run you will need to populate the client_secrets.json file found at: %s with information from the Developers Console https://console.developers.google.com/ For more information about the client_secrets.json file format, please visit: https://developers.google.com/api-client-library/python/guide/aaa_client_secrets """ % os.path.abspath(CLIENT_SECRETS_FILE)