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.1.tar.gz (17.6 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.1-py3-none-any.whl (32.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: omd_emea-0.1.1.tar.gz
  • Upload date:
  • Size: 17.6 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.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.5

File hashes

Hashes for omd_emea-0.1.1.tar.gz
Algorithm Hash digest
SHA256 387001514b8a0d2a9dfc0b08c9584f7cd741a82eb35fa4ae1428dcfdfcb49e19
MD5 d36f4c8e5caf184c23bacf352796532e
BLAKE2b-256 ab89b0b13d6c51e4035b79447b57e7c6a10ce28aaabe62274ba94af4249daddb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: omd_emea-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 32.2 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.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.5

File hashes

Hashes for omd_emea-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3ee57fb5c832a7dd8a49b936bc7ae9dc37006829b656cb9117a2ed00fd9b95ca
MD5 b175b79eb9f09f328b1f008a8e400b9d
BLAKE2b-256 06df8a0873d055d8dabf1323a2834bebff55fba44031a298755320402569978e

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