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_providercontains the classAthenaDataProvider, which is initialized by giving the parameters- aws_access_key_id
- aws_secret_access_key
- s3_staging_dir
- region_name.
The function
read_queryreturns a DataFrame with the information requested by the query passed as argument. -
loggercontains the classLogger, which logs important messages and prints them to the terminal or CloudWatch in AWS. -
metricscontains the classMetrics, which creates the metrics and pushes them to Datadog. -
s3_clientcontains the classS3Client, that is initialized using boto3.client and boto3.resource and the environment variableRESULT_BUCKET.The function
upload_filesuploads the DataFrame returned by the algorithm (output_df) to the given path (output_path) in AWS, for the chosen variant (variant– typicallyproductionor 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:
- Update the version number in the file
pyproject.tomlunder the fieldversion. - In the terminal, run the command
python3 -m build. This will create two new files in the directorydist. - 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.
- 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
orpip install wag_advanced_analytics_utilspipenv install wag_advanced_analytics_utils - import the desired class by typing
wherefrom wag_advanced_analytics_utils.{module_name} import class_name{module_name}is one of the modules of the package andclass_nameis (one of) the class contained in the module.
Release files for wag-advanced-analytics-utils 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| wag_advanced_analytics_utils-0.0.5.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wag_advanced_analytics_utils-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.1 kB
Release files / wag_advanced_analytics_utils-0.0.5.tar.gz
| Download URL | wag_advanced_analytics_utils-0.0.5.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ef34ad934f4ae8d9d11c0d0b77aab58f6ba5c121cd8420f79d84d5838942ef69
|
|
BLAKE2b-256 checksum How to use checksums |
7f2061d5cab7f5be11e39e801cca36083a6054fe0f35214feb217b8b9585d37a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.6
|
Release files / wag_advanced_analytics_utils-0.0.5-py3-none-any.whl
| Download URL | wag_advanced_analytics_utils-0.0.5-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d4b477ac2a57a3c0555d264266028fd2517d75eabe48ecfe23e8ccbb2835e938
|
|
BLAKE2b-256 checksum How to use checksums |
ff0b303eb6d42bc4c71a3f0f6af9255dff6348618dbdc81f0519471ca3c00d04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.6
|