tune_reporting.base.endpoints package

Submodules

tune_reporting.base.endpoints.advertiser_report_actuals_base module

TUNE Service Actuals Reports Endpoint base

class tune_reporting.base.endpoints.advertiser_report_actuals_base.AdvertiserReportActualsBase(controller, filter_debug_mode, filter_test_profile_id)[source]

Bases: tune_reporting.base.endpoints.advertiser_report_base.AdvertiserReportBase

Base class intended for gathering from Advertiser Stats actuals.

The constructor.

Parameters:
  • controller (str) – TUNE Reporting API endpoint name.
  • filter_debug_mode (bool) – Remove debug mode information from results.
  • filter_test_profile_id (bool) – Remove test profile information from results.
count(map_params)[source]

Counts all existing records that match filter criteria and returns an array of found model data.

param (dict) map_params:
 

start_date: YYYY-MM-DD HH:MM:SS

end_date: YYYY-MM-DD HH:MM:SS

group: Group results using this endpoint’s fields.

filter: Apply constraints based upon values

associated with this endpoint’s fields.

response_timezone: Setting expected timezone for results,

default is set in account.

return:

(TuneServiceResponse)

export(map_params)[source]

Places a job into a queue to generate a report that will contain records that match provided filter criteria, and it returns a job identifier to be provided to action /export/download.json to download completed report.

param (dict) map_params:
 

start_date: YYYY-MM-DD HH:MM:SS

end_date: YYYY-MM-DD HH:MM:SS

fields: Present results using these endpoint’s fields.

group: Group results using this endpoint’s fields.

filter: Apply constraints based upon values

associated with this endpoint’s fields.

timestamp: Set to breakdown stats by timestamp choices:

hour, datehour, date, week, month.

response_timezone: Setting expected timezone for results,

default is set in account.

return:

(TuneServiceResponse)

fetch(job_id)[source]

Helper function for fetching report upon completion. Starts worker for polling export queue.

param str job_id:
 Job identifier assigned for report export.
return:(TuneServiceResponse)
find(map_params)[source]

Finds all existing records that match filter criteria and returns an array of found model data.

param (dict) map_params:
 

start_date: YYYY-MM-DD HH:MM:SS

end_date: YYYY-MM-DD HH:MM:SS

fields: Present results using these endpoint’s fields.

group: Group results using this endpoint’s fields.

filter: Apply constraints based upon values

associated with this endpoint’s fields.

limit: Limit number of results, default 10, 0 shows all.

page: Pagination, default 1.

sort: Sort results using this endpoint’s fields.

Directions: DESC, ASC.

timestamp: Set to breakdown stats by timestamp choices:

hour, datehour, date, week, month.

response_timezone: Setting expected timezone for results,

default is set in account.

return:

(TuneServiceResponse)

status(job_id)[source]

Query status of insight reports. Upon completion will return url to download requested report.

param (str) job_id:
 Export queue job identifier.
return:(TuneServiceResponse)

tune_reporting.base.endpoints.advertiser_report_base module

TUNE Service Reports Endpoint base

class tune_reporting.base.endpoints.advertiser_report_base.AdvertiserReportBase(controller, filter_debug_mode, filter_test_profile_id)[source]

Bases: tune_reporting.base.endpoints.endpoint_base.EndpointBase

Base components for every TUNE Reporting API reports.

The constructor.

Parameters:
  • (string) (controller) – TUNE Reporting API endpoint name.
  • filter_debug_mode (bool) – Remove debug mode information from results.
  • filter_test_profile_id (bool) – Remove test profile information from results.
call(action, map_query_string)[source]

Make service request for report.

param (str) action:
 Endpoint action name.
param (dict) map_query_string:
 Query str parameters of action.
return:(TuneServiceResponse)

tune_reporting.base.endpoints.advertiser_report_cohort_base module

TUNE Service Insights Reports Endpoint base

class tune_reporting.base.endpoints.advertiser_report_cohort_base.AdvertiserReportCohortBase(controller, filter_debug_mode, filter_test_profile_id)[source]

Bases: tune_reporting.base.endpoints.advertiser_report_base.AdvertiserReportBase

Base class for handling TUNE Reporting API Insight stats reports.

The constructor.

Parameters:
  • controller (str) – TUNE Reporting API endpoint name.
  • filter_debug_mode (bool) – Remove debug mode information from results.
  • filter_test_profile_id (bool) – Remove test profile information from results.
static parse_response_report_job_id(response)[source]

Helper function for parsing export response to gather job identifier.

param (object) response:
 TuneServiceResponse
return (str):Report Job identifier
static parse_response_report_url(response)[source]

Helper function for parsing export status response to gather report url.

param (object) response:
 TuneServiceResponse
return (str):Report Url
throws:TuneSdkException
status(job_id)[source]

Query status of insight reports. Upon completion will return url to download requested report.

param str job_id:
 Export queue identifier
return:(TuneServiceResponse)

tune_reporting.base.endpoints.advertiser_report_log_base module

TUNE Service Logs Reports Endpoint base

class tune_reporting.base.endpoints.advertiser_report_log_base.AdvertiserReportLogBase(controller, filter_debug_mode, filter_test_profile_id)[source]

Bases: tune_reporting.base.endpoints.advertiser_report_base.AdvertiserReportBase

Base class intended for gathering from Advertiser Stats logs.

The constructor.

Parameters:
  • controller (str) – TUNE Reporting API endpoint name.
  • filter_debug_mode (bool) – Remove debug mode information from results.
  • filter_test_profile_id (bool) – Remove test profile information from results.
count(map_params)[source]

Counts all existing records that match filter criteria and returns an array of found model data.

:param (dict) map_params

start_date: YYYY-MM-DD HH:MM:SS

end_date: YYYY-MM-DD HH:MM:SS

filter: Apply constraints based upon values
associated with this endpoint’s fields.
response_timezone: Setting expected timezone for results,
default is set in account.
return:(TuneServiceResponse)
export(map_params)[source]

Places a job into a queue to generate a report that will contain records that match provided filter criteria, and it returns a job identifier to be provided to action /export/download.json to download completed report.

param (dict) map_params:
 

start_date: YYYY-MM-DD HH:MM:SS

end_date: YYYY-MM-DD HH:MM:SS

fields: Present results using these endpoint’s fields.

filter: Apply constraints based upon values

associated with this endpoint’s fields.

format: Export format choices: csv.

response_timezone: Setting expected timezone for results,

default is set in account.

return:

(TuneServiceResponse)

fetch(job_id)[source]

Helper function for fetching report upon completion.

Parameters:job_id (str) – Job identifier assigned for report export.
Returns:(TuneServiceResponse)
find(map_params)[source]

Finds all existing records that match filter criteria and returns an array of found model data.

param (dict) map_params:
 

start_date: YYYY-MM-DD HH:MM:SS

end_date: YYYY-MM-DD HH:MM:SS

fields: Present results using these endpoint’s fields.

filter: Apply constraints based upon values

associated with this endpoint’s fields.

limit: Limit number of results, default 10, 0 shows all.

page: Pagination, default 1.

sort: Sort results using this endpoint’s fields.

Directions: DESC, ASC.

response_timezone: Setting expected timezone for results,

default is set in account.

return (object):
 

(TuneServiceResponse)

status(job_id)[source]

Query status of insight reports. Upon completion will return url to download requested report.

param str job_id:
 Export queue identifier
return (object):
 (TuneServiceResponse)

tune_reporting.base.endpoints.endpoint_base module

TUNE Service Endpoint base

class tune_reporting.base.endpoints.endpoint_base.EndpointBase(controller, use_config)[source]

Bases: object

Base components for every TUNE Reporting API request.

The constructor.

Parameters:
  • (string) (controller) – TUNE Reporting API endpoint name.
  • (boolean) (use_config) – Use TUNE Reporting SDK config.
auth_key[source]

TUNE Reporting API KEY.

auth_type[source]

TUNE Reporting API Authentication Type.

call(action, map_query_string=None)[source]

Call TUNE Reporting API service requesting response endpoint_base upon provided controller/action?query_string.

param str action:
 TUNE Reporting API endpoint’s action name.
param array map_query_string:
 Action’s query string parameters.
return:(TuneServiceResponse)
controller[source]

TUNE Reporting API controller.

define()[source]

Gather all metadata for this endpoint.

Returns:TuneServiceResponse:
fields(enum_fields_selection=4)[source]

Gather specific set of fields for this endpoint.

Parameters:int – TUNE_FIELDS_ALL, TUNE_FIELDS_DEFAULT, TUNE_FIELDS_RECOMMENDED
Return (array):list endpoint fields

Property getter recommended and valid fields for an endpoint.

model_name()[source]

Get model name for this endpoint.

static parse_response_report_job_id(response)[source]

Helper function for parsing export response to gather job identifier.

param (TuneServiceResponse) response:
 
return (str):Report Job identifier
throws:(TuneSdkException)
static parse_response_report_url(response)[source]

Helper function for parsing export status response to gather report url.

param object response:
 TuneServiceResponse
return (str):Report Url
throws:TuneSdkException
static version()[source]

Get SDK version.

tune_reporting.base.endpoints.report_export_worker module

TUNE Reports Export Status Worker

class tune_reporting.base.endpoints.report_export_worker.ReportExportWorker(export_controller, export_action, auth_key, auth_type, job_id, verbose=False, sleep=10, timeout=0)[source]

Bases: object

Worker for handle polling of report request on export queue.

The constructor.

Parameters:
  • export_controller (str) – Export controller.
  • export_action (str) – Export status action.
:param str auth_key TUNE Reporting authentication
key.
:param str auth_type TUNE Reporting authentication
type.
Parameters:
  • job_id (str) – Provided Job Identifier to reference requested report on export queue.
  • verbose (bool) – Debug purposes only to view progress of job on export queue.
  • sleep (int) – Polling delay between querying job status on export queue.
  • timeout (int) – Poll until exceeds timeout.
response[source]

Property that will hold completed report downloaded from TUNE Reporting API service.

return:Response
rtype:TuneServiceResponse
run()[source]

Poll status until status of “complete” or “fail” to gather download URL for report export.

return:True upon success.
rtype:bool

Module contents

tune management shared endpoints module