Skip to main content

Generic code for processing and execution for OMD EMEA

Project description

OMD-EMEA Code Repository

omd_emea_logo

Overview

omd-emea is a Python package that houses generic code and processes that is used across multiple projects and clients and can be used in other projects. Having and maintaining a Python package using PyPI makes it much easier for others in the company to import code and starting playing with the funcs and processes.

Main Features

There are three main areas (this might increase in the future of course) that houses functionality:

  • apis - contains code utilising the APIs of Facebook and Adverity
  • taxonomy_field_checker - contains functionality to retrieve the latest field names from Taxonomy Checker depending on the name of the client.
  • general - contains generic functions and classes that may come in handy in current and upcoming projects.

How to install it

The source code is currently hosted on GitLab at: https://gitlab.com/omd_MarketingIntelligence/code_repository/-/tree/asdev. Note that it is currently sitting in the branch asdev.

Installation is available with the latest release at the Python Package Index (PyPI):

pip install omd-emea

If you are desperate to install from GitLab, please run the following command:

git clone -b asdev https://gitlab.com/omd_MarketingIntelligence/code_repository.git

Example usage

Below are some examples on some of the functionality of the package:

Importing a table from BigQuery to a pandas dataframe using the GCP class inside the general sub module:

from omd_emea.general.general_functions import GCP

GCP.bq_table_to_dataframe(table_name='example-table',
                          project_id='example-project').head()

Sending an email to an email address using the General class inside the general sub module:

from omd_emea.general.general_functions import General

General.send_email_func(receiver_email='aniruddha.sengupta@omd.com',
                        message='Hello, this is a test',
                        username='omddataengineering@gmail.com',
                        password='pwd')

Using the Logger class inside the general sub module to create a test log and upload to a GCP bucket:

from omd_emea.general.general_functions import Logging

# Initiate the logger
bucket_name = 'example-bucket'
logging_file = Logging(bucket_name=bucket_name).instantiate_log(
    'Initiating the logger'
)
Logging(bucket_name=bucket_name).read_file(file=logging_file)

# Make an example log
Logging(bucket_name=bucket_name).write_to_file(
    file=logging_file,
    log='This is an example log'
)

# Seeking the logging file - comes after all logs have been written
Logging(bucket_name=bucket_name).seek_file(file=logging_file)

# Upload the logging file
Logging(bucket_name=bucket_name).upload_log(
    project='example-project', file=logging_file
)

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

omd_emea-0.1.5.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

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

omd_emea-0.1.5-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file omd_emea-0.1.5.tar.gz.

File metadata

  • Download URL: omd_emea-0.1.5.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.5

File hashes

Hashes for omd_emea-0.1.5.tar.gz
Algorithm Hash digest
SHA256 eb682711ef46340494904e9faed3c90b0283694ee47b6e43e24d3f3f976320f7
MD5 c234ed7684c40c16cfee3d9eb1168c88
BLAKE2b-256 46b96aba1157ce65a90050dff207746e126a1e93d2074b12b05f0a73af294b60

See more details on using hashes here.

File details

Details for the file omd_emea-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: omd_emea-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 18.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.5

File hashes

Hashes for omd_emea-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 62b48429f2ab502165d052fdaa746bfada1100e0bd707e1c8650366a94071506
MD5 f112a66922002317d7bd64832b4992aa
BLAKE2b-256 8ed73e7e40534456e4ef48c55f09a627969f2c4e0777d65769a76a754bc06a54

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