Products
Note
available on platforms : Platform.Liquids, Platform.LNG, Platform.LPG, Platform.Dry
- class kpler.sdk.resources.products.Products(configuration, column_ids=True, log_level=None)[source]
The
Products
endpoint allows to perform full-text search on products, in order to find names used in Kpler referential.- get(columns=None, size=None, ancestor_family_ids=None, ancestor_family_names=None, ancestor_group_ids=None, ancestor_group_names=None, ancestor_product_ids=None, ancestor_product_names=None, ancestor_grade_ids=None, ancestor_grade_names=None, products=None, product_ids=None)[source]
- Parameters
size – Optional[int]
ancestor_family_ids – Optional[List[int]] IDs of a product Family. Can be separated by a coma
ancestor_family_names – Optional[List[str]] Default to the whole tree if not specified. Possible values are : Light Ends, NPC, DPP, Middle Distillate, Dirty
ancestor_group_ids – Optional[List[int]] IDs of a product Group. Can be separated by a coma
ancestor_group_names – Optional[List[str]] Default to the whole tree if not specified. Possible values are : Kero/Jet, Crude/Co, , Fuel Oils, etc…
ancestor_product_ids – Optional[List[int]] IDs of a product Product. Can be separated by a coma.
ancestor_product_names – Optional[List[str]] Default to the whole tree if not specified. Possible values are : Jet, Crude, Clean Condensate, etc …
ancestor_grade_ids – Optional[List[int]] IDs of a product Grade. Can be separated by a coma.
ancestor_grade_names – Optional[List[str]] Default to the whole tree if not specified. Possible values are : RBOB, Solvent Naphtha, LSHO, 91 Gasoline,…
products – Optional[List[str]] Names of Products of all different tree levels (Family, Group, Product, Grade)
product_ids – Optional[List[int]] Ids of possible products. Can be separated by a coma
columns – Optional[List[str]] Retrieve all available columns when set to “all”
Examples
>>> from kpler.sdk.resources.products import Products ... products_client = Products(config) ... products_client.get(ancestor_group_names=["Fuel Oils"], columns=["id", "family_name", "group_name", "product_name", "grade_name"])
id
family_name
group_name
product_name
grade_name
2715
Dirty
Crude/Co
Crude
EOPL Heavy
2716
Chem/Bio
Vegoils/Biofuels
Biofuels
SAF
2717
Middle Distillates
Gasoil/Diesel
Diesel
Diesel B5
2718
Dirty
Crude/Co
Crude
Suez Blend
2728
Chem/Bio
Vegoils/Biofuels
Animal Fats
…
…
…
…
- Return type
DataFrame
- get_columns()[source]
This endpoint returns a recent and updated list of all columns available for the endpoint products.
Examples
>>> from kpler.sdk.resources.products import Products ... products_client = Products(config) ... products_client.get_columns()
id
name
description
deprecated
type
id
Id (Product)
Identifier in the database of Kpler
False
long
name
Name
Name of the product
False
string
product_type
Type (Product)
Product Type
False
string
family_name
Family
closest Family to the product
False
string
family_id
Family Id
Id of the closest Family to the product
False
long
…
…
…
…
…
- Return type
DataFrame
- search(q)[source]
- Parameters
q – str Argument to search by in products names
Examples
>>> from kpler.sdk.resources.products import Products ... products_client=Products(config) ... products_client.search("Arab")
products
Arab
Arab M
Arab M Abu Safah
Arab SLt.
Arab XLt.
Arab Hy.
Arab Lt.
- Return type
DataFrame