Skip to main content

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 North Gravity 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 North Gravity application

  • a single Jupyter Notebook that is ran thanks to the Jupyter Runner task within a pipeline in the North Gravity 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 North Gravity 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.2

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.2

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:

  • NG_API_ENDPOINT → the URL to the North Gravity platform API (by default, the url is set to https://api.northgravity.com)

  • LOGIN → login received from North Gravity

  • PASSWORD → password to log in,

  • or NG_API_KEY → API key to use instead of LOGIN and PASSWORD combination

Credentials are used to generate the token so that each request is authenticated.

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

northgravity_utils-0.1.2.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

northgravity_utils-0.1.2-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file northgravity_utils-0.1.2.tar.gz.

File metadata

  • Download URL: northgravity_utils-0.1.2.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.11

File hashes

Hashes for northgravity_utils-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9ed16bee0bb333899921f79a79b03689e3b8317882b0be2b4b9fcc63f925f748
MD5 3bcbc5973a63f161e44ebf488286f2b5
BLAKE2b-256 cbe6f4e09811683b702dd60234dae8417d86542e00baf721fc01e5dcd15b902e

See more details on using hashes here.

File details

Details for the file northgravity_utils-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for northgravity_utils-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6407181c9a0ba31ecfb2e7af8fda7ef274382fca415582d448b1ec3051da19f5
MD5 a85e8936f92e1f7c951d3e183f205014
BLAKE2b-256 59843b434d3adf909893114183992faa894646afed0e26cc3603b9091d49542f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page