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.
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
-
Make sure there are 10 underscores
-
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.
-
These are "Non-Paid Social" Campaigns. They should not contains "PS" or any Social Tactic/Engine.
-
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 indexa[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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for cpnnaming-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37754eddee6bbee9c8616c77ba72f27781403ddf5cdac7b3e7a9cc61d923be61 |
|
MD5 | a79f8435452184c0d085140533ae767e |
|
BLAKE2b-256 | 3c3a2d258c44580ec55e341625e778a49fdd132664bb1055208eba60013ec812 |