This is a library that helps users interact with the Petro.ai API in python. The motivation behind this package is to allow for a petroclient and allow users to interact freely with against the Petro.ai API.
Clone the package from the Petro.ai scripts repo (you will need to be prepared to enter Microsoft credentials):
git clone "https://firstname.lastname@example.org/ruths/public-projects/_git/petroPyLib" cd petroPyLib
Or you can attempt to clone in Visual Studio Code
In PowerShell, CD into petropylib (the root folder) and type:
pip install .
# A Quick Example
## First we'll import the petroclient from petropylib import petroclient ## Then we'll need the inputs to authenticate our petro-session petrourl = 'petro-url/api' ptoken = "petroai token" petronId = 'petronId' client = petroclient.PetroClient(petrourl, token = ptoken) petrons = client.get_petrons(PID = petronId) ## Grab well forecast data petronOfChoice = petrons wellOfChoice = petronOfChoice.wells wellOfChoiceForecastData = well.get_forecast_data(PID = petronId) ## Close the session client.close()