Package: oceanbolt.sdk
Oceanbolt Python SDKThe Oceanbolt Python SDK provides access to Oceanbolt data. It is a python wrapper around the Oceanbolt Data API.It can be easily integrated existing tools such as jupyter notebooks, scripts, and applications.Data is returned in the form of pandas.DataFrame, which allows for easy manipulation and further data processing.The python SDK is available to all Oceanbolt API clients (API authentication token required in order to get access). API tokens can be generated in the Oceanbolt App (app.oceanbolt.com)Project StatusIMPORTANT: The oceanbolt-python-sdk is still undergoing development, and certain features may be changed/removed before the launch of version 1.0.0SetupThe SDK supports the following python versions: 3.9, 3.10 and 3.11In order to install, run the following:pip install oceanbolt.sdkIn order to upgrade an existing installation, run the following:pip install oceanbolt.sdk --upgradeDocsDocumentation :https://python-sdk.oceanbolt.comQuick Example Dry Bulkfromoceanbolt.sdk.clientimportAPIClientfromoceanbolt.sdk.data.port_callsimportPortCallsfromdatetimeimportdate,timedelta# Create the base API client using your token. Tokens can be created in the Oceanbolt App (app.oceanbolt.com)base_client=APIClient("<your API access token>","dry")# Connect to one of the Oceanbolt's data endpoints using the base client object, ie: PortCallsport_calls_client=PortCalls(base_client)# Get a list of Port Hedland exports over the last weekhedland_portcalls=port_calls_client.get(start_date=date.today()-timedelta(days=7),segment=["capesize"],unlocode=["AUPHE"],)Quick Example Tanker DataIn order to extract tanker data, you have to specify the platform when instantiating the client:
base_client = APIClient("","tank")fromoceanbolt.sdk.clientimportAPIClientfromoceanbolt.sdk.data.port_callsimportPortCallsfromdatetimeimportdate,timedelta# Create the base API client using your token. Tokens can be created in the Oceanbolt App (app.oceanbolt.com)base_client=APIClient("<your API access token>","tank")# Connect to one of the Oceanbolt's data endpoints using the base client object, ie: PortCallsport_calls_client=PortCalls(base_client)# Get a list of Port Hedland exports over the last weekhedland_portcalls=port_calls_client.get(start_date=date.today()-timedelta(days=7),unlocode=["USHOU"],)Quick Example LNG DataIn order to extract lng data, you have to specify the platform when instantiating the client:
base_client = APIClient("","lng")fromoceanbolt.sdk.clientimportAPIClientfromoceanbolt.sdk.data.port_callsimportPortCallsfromdatetimeimportdate,timedelta# Create the base API client using your token. Tokens can be created in the Oceanbolt App (app.oceanbolt.com)base_client=APIClient("<your API access token>","tank")# Connect to one of the Oceanbolt's data endpoints using the base client object, ie: PortCallsport_calls_client=PortCalls(base_client)# Get a list of Port Hedland exports over the last weekhedland_portcalls=port_calls_client.get(start_date=date.today()-timedelta(days=7),unlocode=["USHOU"],)Quick Example LPG DataIn order to extract lng data, you have to specify the platform when instantiating the client:
base_client = APIClient("","lpg")fromoceanbolt.sdk.clientimportAPIClientfromoceanbolt.sdk.data.port_callsimportPortCallsfromdatetimeimportdate,timedelta# Create the base API client using your token. Tokens can be created in the Oceanbolt App (app.oceanbolt.com)base_client=APIClient("<your API access token>","lpg")# Connect to one of the Oceanbolt's data endpoints using the base client object, ie: PortCallsport_calls_client=PortCalls(base_client)# Get a list of Port Hedland exports over the last weekhedland_portcalls=port_calls_client.get(start_date=date.today()-timedelta(days=7),unlocode=["USHOU"],)