Skip to main content

Getting Started

A library to help create python pipelines for processing Tracer Data

Full Online Documentation

This is primarily for working with Social Media Organic and Paid Advertisement Data but also contains generic functions for writing to postgreSQL and snowflake databases, creating notifications in Slack Channels and writing to Google Sheets

Library Installation

pip install veetility

To upgrade the library after an update

pip install veetility --upgrade

Initialisation of the UtilityFunctions class

An instance of the "UtilityFunctions" class can be initiated with the ability to read/write with google sheets and also to read/write to tables in a postgreSQL database. However none of these are mandatory.

Google Sheets Authentication

In order to use the functions that read/write from google sheets then a dictionary needs to be passed to the "gspread_auth_dict" argument. This dictionary can be obtained from a google API credentials JSON file.

The instructions for creating this JSON file can be found from the gspread documentation

Then copy the JSON information in curly brackets as a python dictionary into the gspread.service_account_from_dict() authentication method. The "client_email" parameter in the JSON material is the email address of the google sheet client we have created. This email address must be given read or write access to any google sheet you want to interact with.

PostgreSQL connection parameters

The following correction parameters need to be passed in during initialisation of the class instance

  1. db_name e.g. "vayner_external_XXXXXXXXXXX"
  2. db_host e.g. "dashboard-vayner-XXXXXXXXXXXXXXXXXXXX.rds.amazonaws.com"
  3. db_port e.g. "5432" (this is the default for postgreSQL)
  4. db_user e.g. "tom.jones"
  5. db_password e.g. "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Setup in code

It is advisable to put the parameters into a config.py file (cf) which can then be imported into the main script

import config as cf
from veetility import utility_functions

util = utility_functions.UtilityFunctions(cf.google_sheet_auth_dict,cf.db_user, 
                                          cf.db_password,cf.db_host,
                                          cf.db_port, cf.db_name)

Usage in code

Once an instance of the class UtilityFunctions has been created, e.g. "util" then functions (methods) of the class can be used e.g. "write_to_gsheet()".

This can write a pandas.DataFrame to any google sheet the "client_email" has been given "editor" access to. First pass in the name of the Google Sheet workbook, then the tab of the workbook, then the pandas.DataFrame

util.write_to_gsheet("Indeed Data Error Tracking","PaidNoBoostedMatch", 
                        paid_no_boosted_match)

Metadata

Release files for veetility 0.5.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for veetility 0.5.3
File Size Uploaded Provenance Actions
veetility-0.5.3.tar.gz 69.4 kB Without provenance Details for veetility-0.5.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for veetility 0.5.3
File Interpreter ABI Platform Actions
veetility-0.5.3-py3-none-any.whl Python 3 none any Details for veetility-0.5.3-py3-none-any.whl

Total release size: 143.8 kB

Release files / veetility-0.5.3.tar.gz

Download URL veetility-0.5.3.tar.gz
Size 69.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0038f79ff82014ff5ff922fa3657e9a0e7ac7abc2f8a053f03f374b3bfe9a9d3
BLAKE2b-256 checksum
How to use checksums
f449c48883d1bdc63eeb9a8fc23e81c52091fec1a0ac4b4d564748b02a3fdaea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.17

Release files / veetility-0.5.3-py3-none-any.whl

Download URL veetility-0.5.3-py3-none-any.whl
Size 74.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
93bffe007b0f66da47d05213c777ad0d699016e42640f9c493cb5f38c8234be1
BLAKE2b-256 checksum
How to use checksums
f53bd0280814abe4f0987802f27c25c0948a7a3bee7c4930108feda8a13c921f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.17

Security for veetility 0.5.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.5.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page