Introduction¶
Overview¶
To install this package you will first need access to the Cubed Code Artifact repo. Depending on the project you are working on, you should already have read-only access.
If you are struggling to install, make sure you have the following sorted:
1 2 3 |
|
/.aws/config¶
[default]
region = eu-west-1
output = json
[profile-user2]
region = eu-west-1
output = json
/.aws/credentials¶
[default]
aws_access_key_id = {IAM access key}
aws_secret_access_key = {IAM secret key}
[user2]
aws_access_key_id = {IAM access key}
aws_secret_access_key = {IAM secret key}
Installation¶
Cubed Projects¶
In the main attrib-backend
project you should be able to provision and get latest installation. If you have to run it manually, there is the bash script: cubed-packages/install-visit-generator.sh
.
Manually¶
This package can be installed by first adding the Cubed AWS Artifact repo to your local pip. Then running the normal pip
install command.
get-aws-creds.sh¶
domain="cubed-package"
repo="CubedPackages"
# This will give the token to access the repo
echo "Get auth token"
export CODEARTIFACT_AUTH_TOKEN=`aws codeartifact get-authorization-token --domain ${domain} --query authorizationToken --output text --profile <profile-name>`
echo "Set pip3 extra-index-url "
pip3 config set global.extra-index-url https://aws:$CODEARTIFACT_AUTH_TOKEN@$domain-757826747841.d.codeartifact.eu-west-1.amazonaws.com/pypi/CubedPackages/simple/
Note
You must add a specific profile if that's how it is configured in the /.aws/credentials file (see above), otherwise it will use default
pip3 command:
pip3 install visit-generator
Usage¶
To use the Visit Generator review below Modle,s Utils, Generators and the Connections.
Models¶
The Visit Generator package is built on the idea of having a Visitor with many Visits - which can each have Page(s), Event(s), Impression(s), and Detail(s).
See more at models/visitor
Utils¶
The Visit Generator will use constant data declared in the enums provided. These include default Channels, Patterns, Events, Label Types, Products, and other bits of visit information.
See more at models/visitor
Generators¶
Helper functions to generate blocks of visit information.
See more at: visit details - generator/details journeys - generator/journeys
Connections¶
Class to handle mysql DB connection.
See more at models/visitor