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.8.tar.gz (18.4 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.8-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: omd_emea-0.1.8.tar.gz
  • Upload date:
  • Size: 18.4 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.8.tar.gz
Algorithm Hash digest
SHA256 30100232ec514de26f551d7baadbb7959eab0f615bb18a9877e170485ba5c777
MD5 f50746e7159be902ee8bb58b9af16364
BLAKE2b-256 fb1139a24d41365b121d419b0319295f81b1ed7cc843057c5b530dfeb8ba48cb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: omd_emea-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 18.7 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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 d0b2c62669a37bef897d63aff7443783745d08696ebfbe330ca001174b5129d8
MD5 37bca886cd3dcf83ba038ca5d56bab87
BLAKE2b-256 28675578f7d8014ca205e75defe5995e7398db839a01613769d8431d9cd89adf

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