Metadata-Version: 2.1
Name: kpler.sdk
Version: 1.0.1
Summary: A Python wrapper around the Kpler client API
Home-page: http://github.com/kpler/python-sdk
Author: Kpler
Author-email: engineering@kpler.com
License: MIT
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
Requires-Dist: pandas (>=1.1.4)
Requires-Dist: numpy (>=1.19.4)
Requires-Dist: requests (>=2.24.0)
Provides-Extra: doc
Requires-Dist: Sphinx (==3.2.1) ; extra == 'doc'
Requires-Dist: sphinx-rtd-theme (==0.5.0) ; extra == 'doc'
Requires-Dist: sphinx-autodoc-typehints (==1.6.0) ; extra == 'doc'
Provides-Extra: test
Requires-Dist: black (==18.9b0) ; extra == 'test'
Requires-Dist: mypy-extensions (==0.4.3) ; extra == 'test'
Requires-Dist: mypy (==0.782) ; extra == 'test'
Requires-Dist: pre-commit (==2.6.0) ; extra == 'test'
Requires-Dist: pytest (==4.0.0) ; extra == 'test'

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

````python
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",
    ]
)

````


