Python Utils for NorthGravity platform tasks
Project description
NORTH GRAVITY PYTHON UTILS
This document describes the North Gravity Python Utils package which enables users to use the NG platform tools and most common functions within their python scripts / tasks repositories.
The Python Utils can be used within:
-
a single python script that is ran thanks to the Python Runner task within a pipeline in the NG application
-
a single Jupyter Notebook that is ran thanks to the Jupyter Runner task within a pipeline in the NG application
-
an ensemble of python scripts that are part of a container, for a Task created by the user, used in a pipeline in the NG application
NG_Utils cover most frequently used functions for data/files handling purposes.
The scope of the NG_Utils:
-
DataHandler - splitting data based on train/test labels, handling dates in datasets
-
FileHandler - downloading/uploading model-specific datasets from/to the data lake, handling datasets formats
-
BackTest - preparing short or extended backtest based on models results
-
StatTest - preparing report and running statistical tests for stationarity, autocorrelation and volatitity clustering
-TaskExecUtils - auxiliary functions used in executing tasks
How to install and set the package:
Install
pip3 install northgravity_utils==0.1.1
As the library is available from pip, it can be installed as a specific version within a Python Task from within requirements.txt just by adding:
northgravity_utils==0.1.1
The package relies on the requests library so, in the project, the user must install this library in the requirements.txt file.
pip3 install requests==2.27.1
Environment Variables
The package uses information from the environment variables. They are necessery for functionality of Nortygravity SDK package, used in Northgravity Utils Environment variables are automatically provided when running a script within a pipeline (as a Task or within the Python/Jupyter Runners). If running locally the script, users must set them in the project to be able to run the project locally.
Mandatory environment variables to set:
-
LOGIN → login received from NG
-
PASSWORD → password to log in. Credentials are used to generate the token so that each request is authenticated.
-
NG_API_ENDPOINT → the URL to the NG platform API (by default, the url is set to https://api.northgravity.com)
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
Built Distribution
Hashes for northgravity_utils-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06258f38f8aaa364a0d5d7981d052024516ae1ff6bc54be4198f4a1ee5f87f55 |
|
MD5 | 4a7373f2b07d887e352799219b3dcd63 |
|
BLAKE2b-256 | 98156dea59e5236307b98e5b97481e0d66c765fdc181fbcc6e95666051505939 |