Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Developed by Brado, this is a package to perform QA on campaign names

Project description

cpnnaming

Brado Internal Tool to make sure our paid media campaigns follow our campaign naming template. The package will perform quality check and return campaign names that are not following naming template.

enter image description here

Steps:

  • Connect to the PostgreSQL database using given credentials and get a list of specific campaign names using schema and table names

  • Use gs2df package to get reference file uploaded on Google Sheets (Campaign Naming Rules) and run campaignnaming-qa script to check campaign names against rules

  • The Campaign Naming Rules is a new Google Sheet that ONLY documents rules for campaign naming template. The Google Sheets synced with the Campaign Naming Convention. So once rules are changed, mannually adjustment is not required.

  • Upload failed campaign naming dataset to a new table (Failed Campaign Name) into database

Rules for Campaign Naming QA

  1. Make sure there are 10 underscores

  2. In sections that are not up to the creator (Product & Country), make sure they have the correct information. Ex. Channel needs to contain one of the following: SE, DN, PS, EM, YT, IR, APP.

  3. These are "Non-Paid Social" Campaigns. They should not contains "PS" or any Social Tactic/Engine.

  4. New rules should always be updated into the Google Sheets file "Campaign Naming Convention" before check failed campaign names!

Installation

Install the whole package

$ pip install cpnnaming

Functions in package

  • [retrieve_data] - connect to the dataset and download qa check campaign names as a data table
from cpnnaming.retrieve_data import cntdb
  • [qa_check] - QA check for each campaign names retreived and return campaign names that fails the QA check
 from cpnnaming.qa_check import qa_checking
  • [upload_result] - upload campaign names that fails the QA check back to the dataset
from cpnnaming.qa_check import upld_file

Usage

  • Enter the schema and table name to download campaign names as a dataframe using retrieve_data.get_data(schema,table)

Note: The template for datatable naming TBD.

  • Follow this instruction to get a .json file and put it in the same directory with .py file

  • Any changes in QA rules need to be updated in Campaign Naming Convention Google Sheet.

  • Import reference excel from Google Sheets API using rules=gs2df.gs2df('client_secret_540551931166-21q6c10ctr74s4t9d83j1muknjvuoo69.apps.googleusercontent.com.json','Campaign Naming Rules') and reach different sheets using index a[0],a[1],...

Note: first parameter: your own .json file, second parameter: Google Sheets Name

  • Create a new table called Campaign Naming Failed and upload this dataset to a new table using upload_table(schema, table, failed_df)

Note: Uploaded table will replace existing table every time.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for cpnnaming, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size cpnnaming-0.0.2-py3-none-any.whl (7.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size cpnnaming-0.0.2.tar.gz (5.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page