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

Uploaded Python 3

File details

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

File metadata

  • Download URL: omd_emea-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 e4f9e6cfdf1e162cc2dc48158278cf0fca1cebef7e8298e97b42ccecfde82e89
MD5 a3908f2c5845cf178dd3a622e1633e00
BLAKE2b-256 420a98d08cd5aa616dc73d56670cf90db79ac3e45e7e8c142fe0eea377e20c70

See more details on using hashes here.

File details

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

File metadata

  • Download URL: omd_emea-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.8 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9e39a6df0aad47517096ff57888fa519b4c90351e674de828db18b77f1a08579
MD5 275afea88c6d273a5a7acf52beab5d67
BLAKE2b-256 fa3db2c7c8d25920361af3d4536877c7fc8ae3d5192ac96e676826efcad2255f

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