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.6.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.6-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: omd_emea-0.1.6.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.6.tar.gz
Algorithm Hash digest
SHA256 0fa987587c8bb2735c2a6497b2e26d77a30df6c1007711753ba6b73def55c035
MD5 983264eb8a3bd290443cb7b44db682f5
BLAKE2b-256 9c0874cc77d31032c21e556f064f5417acb42f2a408f2260931064543ec211a5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: omd_emea-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 18.6 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 3def2d74fe4c223b53f2bf17257bffa99faac985bf90806bb6f71b166934b13f
MD5 4078866d3b29f8b1437de410c98eb862
BLAKE2b-256 a6beaac7494f542b31c743a7f0af911ede05aee6ea1911b517d665b339f6d032

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