Skip to main content

Package containing the common functions used in all the Advanced Analytics algorithms

Project description

README

This package contains all the common functions used to run the Advanced Analytics algorithms. We provide a brief explanation of each of the modules and the corresponding functions:

  • athena_data_provider contains the class AthenaDataProvider, which is initialized by giving the parameters

    • aws_access_key_id
    • aws_secret_access_key
    • s3_staging_dir
    • region_name.

    The function read_query returns a DataFrame with the information requested by the query passed as argument.

  • logger contains the class Logger, which logs important messages and prints them to the terminal or CloudWatch in AWS.

  • metrics contains the class Metrics, which creates the metrics and pushes them to Datadog.

  • s3_client contains the class S3Client, that is initialized using boto3.client and boto3.resource and the environment variable RESULT_BUCKET.

    The function upload_files uploads the DataFrame returned by the algorithm (output_df) to the given path (output_path) in AWS, for the chosen variant (variant – typically production or the name of the experiment, if testing new features).


If changes are made to this package, it has to be updated in PyPI by doing:

  1. Update the version number in the file pyproject.toml under the field version.
  2. In the terminal, run the command python3 -m build. This will create two new files in the directory dist.
  3. Upload the package by typing twine upload dist/* in the terminal. Since the account is protected by a two-factor authentication we have to use a token, meaning that you must
    • set your username to __token__ and
    • set your password to the token value, including the pypi- prefix.
  4. Check that the package has been correcly updated in https://pypi.org/project/wag-advanced-analytics-utils/.

To use these modules in a Python script do the following:

  • start by installing the package by running
    pip install wag_advanced_analytics_utils
    
    or
    pipenv install wag_advanced_analytics_utils
    
  • import the desired class by typing
    from wag_advanced_analytics_utils.{module_name} import class_name
    
    where {module_name} is one of the modules of the package and class_name is (one of) the class contained in the module.

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

wag_advanced_analytics_utils-0.0.4.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file wag_advanced_analytics_utils-0.0.4.tar.gz.

File metadata

File hashes

Hashes for wag_advanced_analytics_utils-0.0.4.tar.gz
Algorithm Hash digest
SHA256 9a4327e7ea9831be2eb518746e8e88c835462dabbe4ec317085045912240ab5d
MD5 791e630b6fc747f0a7cfb3620ed5b218
BLAKE2b-256 fdca6ca15cdc5ac5c0fe0f799848170de3eb510586528cafefb63968530a9aa2

See more details on using hashes here.

File details

Details for the file wag_advanced_analytics_utils-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for wag_advanced_analytics_utils-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c5454845aafeb5bf231820cba5a9f45b97cfa41d7a1d1c8c68a8b1d2f642fe28
MD5 dba9b6e9bb6ea112d64092b9c8023f72
BLAKE2b-256 d7b9bb96e4eb7a1de28412f49e8b7f8f4407814e36009db16615900ccc3eea39

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page