Skip to main content

A Python wrapper around the Kpler client API

Project description

The Kpler Python SDK provides access to Kpler data.

It can be easily integrated into notebooks, scripts, and applications.

It is available to all Kpler API clients (credentials required)

Documentation : https://python-sdk.dev.kpler.com

from kpler.sdk import Platform
from kpler.sdk.configuration import Configuration
from kpler.sdk.resources.trades import Trades
from datetime import date, timedelta

# Create configuration object
configuration = Configuration(Platform.Liquids, "<your email>", "<your password>")

# To change the platform use _change_platform method of Configuration class
configuration._change_platform(Platform.Liquids)

# Connect to one of the Kpler's client using your configuration object, ie: Trades
trades_client = Trades(configuration)

# Get all possible columns returned by the get_trades query
trades_columns = trades_client.get_columns()

# Do a get trades with default columns and with a maximum size of 5 for the dataframe
trades_df = trades_client.get(size=5)

# Get US imports over last week
us_imports = trades_client.get(
    to_zones=["United States"],
    products=["crude"],
    with_forecast=False,
    with_intra_country=True,
    start_date=date.today() - timedelta(days=7),
    columns=[
        "vessel_name",
        "closest_ancestor_product",
        "closest_ancestor_grade",
        "start",
        "end",
        "origin_location_name",
        "destination_location_name",
    ]
)

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

kpler_sdk-1.0.63.tar.gz (66.3 kB view details)

Uploaded Source

File details

Details for the file kpler_sdk-1.0.63.tar.gz.

File metadata

  • Download URL: kpler_sdk-1.0.63.tar.gz
  • Upload date:
  • Size: 66.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for kpler_sdk-1.0.63.tar.gz
Algorithm Hash digest
SHA256 a870e050a9d7df3262425a7aa02e4478fa2fe2fc9752e24686105026205a832e
MD5 46b1626d8a87ac3ad4e60f38d3ff3081
BLAKE2b-256 181b223d8317183618b2a3a267a1ba1ea814ca97a2e0fff49564e1c6620bb1ee

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