This project contains sample scripts for data ingestion of sample data to the Exabel platform.
All files will have documentation on how to run them. You will need
to install exabel-data-sdk
in your Python environment.
PyPi: https://pypi.org/project/exabel-data-sdk/
The data model implemented in this project can be visualized as follows:
For easy installation of all dependencies, run the following commands in the root directory of the project:
# Install pipenv
pip install pipenv
# Install dependencies to virtual environment
pipenv install
# Start virtual environment
pipenv shell
Documentation on how to run the scripts is found below. Before running any of the scripts, replace the values
of EXABEL_API_KEY
and EXABEL_NAMESPACE
in the .env
file with the API key and namespace you have been provided by Exabel.
In a production environment, you will want to store the API key in a secure location and load it to the environment variables before execution.
The sample scripts are provided in the scripts
directory in two versions. scripts/sh
and scripts/ps1
.
On Linux and MacOS use the .sh
files, and on Windows, use the .ps1
files.
On windows, you can run the scripts with the following command:
powershell.exe .\scripts\ps1\<script>.ps1
And on Linux and MacOS:
./scripts/sh/<script>.sh
This script uploads the following to the Exabel platform:
- the brands in
resources/data/entities/brands.csv
- the relationships in
resources/data/relationships/HAS_BRAND.csv
- the time series data points in
resources/data/time_series/brand_time_series.csv
The script can also be run "line by line" by running each line in the root directory of the project.
To delete the resources created, run this script.
This script creates geometric brownian movement sample data for the brands in resources/data/entities/brands.csv
.
Usage:
# In the root directory of the project
python scripts/py/create_data.py