Skip to main content

A Python wrapper around the Oceanbolt client API

Project description

Oceanbolt Python SDK

Github CI Netlify Status

The 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 Status

IMPORTANT: The oceanbolt-python-sdk is still undergoing development, and certain features may be changed/removed before the launch of version 1.0.0

Setup

The SDK supports the following python versions: 3.9, 3.10 and 3.11

In order to install, run the following:

pip install oceanbolt.sdk

In order to upgrade an existing installation, run the following:

pip install oceanbolt.sdk --upgrade

Docs

Documentation : https://python-sdk.oceanbolt.com

Quick Example Dry Bulk

from oceanbolt.sdk.client import APIClient
from oceanbolt.sdk.data.port_calls import PortCalls
from datetime import date, 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: PortCalls
port_calls_client = PortCalls(base_client)

# Get a list of Port Hedland exports over the last week
hedland_portcalls = port_calls_client.get(
    start_date=date.today() - timedelta(days=7),
    segment=["capesize"],
    unlocode=["AUPHE"],
)

Quick Example Tanker Data

In order to extract tanker data, you have to specify the platform when instantiating the client: base_client = APIClient("","tank")

from oceanbolt.sdk.client import APIClient
from oceanbolt.sdk.data.port_calls import PortCalls
from datetime import date, 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: PortCalls
port_calls_client = PortCalls(base_client)

# Get a list of Port Hedland exports over the last week
hedland_portcalls = port_calls_client.get(
    start_date=date.today() - timedelta(days=7),
    unlocode=["USHOU"],
)

Quick Example LNG Data

In order to extract lng data, you have to specify the platform when instantiating the client: base_client = APIClient("","lng")

from oceanbolt.sdk.client import APIClient
from oceanbolt.sdk.data.port_calls import PortCalls
from datetime import date, 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: PortCalls
port_calls_client = PortCalls(base_client)

# Get a list of Port Hedland exports over the last week
hedland_portcalls = port_calls_client.get(
    start_date=date.today() - timedelta(days=7),
    unlocode=["USHOU"],
)

Quick Example LPG Data

In order to extract lng data, you have to specify the platform when instantiating the client: base_client = APIClient("","lpg")

from oceanbolt.sdk.client import APIClient
from oceanbolt.sdk.data.port_calls import PortCalls
from datetime import date, 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: PortCalls
port_calls_client = PortCalls(base_client)

# Get a list of Port Hedland exports over the last week
hedland_portcalls = port_calls_client.get(
    start_date=date.today() - timedelta(days=7),
    unlocode=["USHOU"],
)

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

oceanbolt_sdk-0.7.0.tar.gz (349.6 kB view details)

Uploaded Source

Built Distribution

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

oceanbolt.sdk-0.7.0-py3-none-any.whl (640.7 kB view details)

Uploaded Python 3

File details

Details for the file oceanbolt_sdk-0.7.0.tar.gz.

File metadata

  • Download URL: oceanbolt_sdk-0.7.0.tar.gz
  • Upload date:
  • Size: 349.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for oceanbolt_sdk-0.7.0.tar.gz
Algorithm Hash digest
SHA256 59b08916bc2855268dcc86d9a76a08bcc65b24c34c612eeb5610d5958f6d06fd
MD5 ecc9cb91ed0e911d59bd42262565f5cf
BLAKE2b-256 7ba2916e74f066c235d40e29d17b5507698f1f4e27b4a727a60d83ce9fc25cdd

See more details on using hashes here.

File details

Details for the file oceanbolt.sdk-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: oceanbolt.sdk-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 640.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for oceanbolt.sdk-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db92b004531798eba3efae9f95a64d00ae91c9a7472746146c63018593237798
MD5 620c17a13c7b7a5e02232c1d81e15950
BLAKE2b-256 3ca090b2f20c840689babfabfcc0adcf9fd86749b179e1c6302e53178d0c6f61

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