Skip to main content

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.

Source Distribution

cpnnaming-0.0.2.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cpnnaming-0.0.2-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file cpnnaming-0.0.2.tar.gz.

File metadata

  • Download URL: cpnnaming-0.0.2.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for cpnnaming-0.0.2.tar.gz
Algorithm Hash digest
SHA256 a28500a17b604e506c5f96c0194d306eb39b9ed689d2b1c09663055299b13a9c
MD5 6847c7408c460d17b0303702cfabb1c7
BLAKE2b-256 876297c247a7107e5a471100a9318b35d9ddea63f17864088f50f7486b830f73

See more details on using hashes here.

File details

Details for the file cpnnaming-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: cpnnaming-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for cpnnaming-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 37754eddee6bbee9c8616c77ba72f27781403ddf5cdac7b3e7a9cc61d923be61
MD5 a79f8435452184c0d085140533ae767e
BLAKE2b-256 3c3a2d258c44580ec55e341625e778a49fdd132664bb1055208eba60013ec812

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page