Hello and welcome to the Sales Analytics repository! 🚀🚀🚀
If you want replicate the whole analytics from the article, you can easily do that by the following command. Before you run it, please do the steps described in the following sections:
$ python ./src/store_and_load_analytics.py load <workspace-id>
Important note: You should create a workspace in GoodData Trial before you run the store_and_load_analytics.py
script, see Create a Workspace.
# Create virtual env
python -m virtualenv venv
# Activate virtual env
source venv/bin/activate
#You should see a `(venv)` appear at the beginning of your terminal prompt indicating that you are working inside the `virtualenv`.
# Deactivate virtual env once you are done
deactivate
$ pip install -r requirements.txt
If you want to replicate the Airtable Sales CRM from the article, visit this link and click Copy base. Once you have it, you can setup environment variables:
export EXTRACT_AIRTABLE_API_KEY='<AIRTABLE-API-KEY>'
You can create Airtable API KEY here.
export EXTRACT_AIRTABLE_BASE_ID='<AIRTABLE-BASE-ID>'
Example: export EXTRACT_AIRTABLE_BASE_ID='appZj5ydFeMfC8f7p'
.
export EXTRACT_AIRTABLE_TABLES='["<AIRTABLE-TABLE>", "<AIRTABLE-TABLE>"]'
Example: export EXTRACT_AIRTABLE_TABLES='["tblwMVmNNV3HhJtww", "tblwIZrCQ0bJmFtBB", "tblvM4lMGVdBqAFLH"]'
.
Important note: you should define EXTRACT_AIRTABLE_TABLES
in the order you see it in the UI: deals
, companies
, contacts
.
If you do not have database, please create one on bit.io (or somewhere else) and setup the following environment variables:
export LOAD_DATABASE_HOST='<DATABASE_HOST>'
export LOAD_DATABASE_PORT='<DATABASE_PORT>'
export LOAD_DATABASE_USERNAME='<DATABASE_USERNAME>'
export LOAD_DATABASE_PASSWORD='<DATABASE_PASSWORD>'
export LOAD_DATABASE_NAME='<DATABASE_NAME>'
export LOAD_DATABASE_SCHEMA='input_stage'
Please use this exact variable; otherwise, it will not work.
export LOAD_DATABASE_SCHEMA='["airtable_crm_deals", "airtable_crm_companies", "airtable_crm_contacts"]'
Please use this exact variable; otherwise, it will not work.
export ANALYTICS_GOODDATA_HOST='<GOODDATA_HOST>'
You can register here.
export ANALYTICS_GOODDATA_TOKEN='<GOODDATA_TOKEN>'
You can create GoodData token on the following URL: <your-gooddata-account>/settings
.
export ANALYTICS_GOODDATA_DATASOURCE_ID='<GOODDATA_DATASOURCE_ID>'
You can connect a data source (in this case PostgreSQL from the previous step) on the following URL: <your-gooddata-account>/data-sources
.
If you jumped into an issue, please feel free to report it. Also, you can write me on GoodData Community Slack.
$ python ./src/main.py
$ cd transform
$ dbt deps
$ dbt run
$ dbt test
$ python ./src/extract_load.py