Skip to content

Releases: spgi-ci/spgci-python

Updated Outages, Added Assets and Contracts

Choose a tag to compare

@achristie achristie released this 23 Sep 19:25

This release is a breaking change. The previous get_outages within LNGGlobalAnalytics was removed by the API, so therefore stopped working. In this change we have replaced it. The function name is the same, but the parameters and output are slightly different. The same applies for the get_ref_data function. This was removed and now there are individual functions for get_liquefaction_projects and get_liquefaction_trains

In addition, the LNG Assets and Contracts endpoints are now supported.

This includes 18 different functions. all prepended with get_asset_contracts_ - get_assets_contracts_feedstock or get_assets_contracts_monthly_estimated_buildout_liquefaction_capacity so they should be easy to find in intellisense.

LNG - Supply & Demand, Cargos

Choose a tag to compare

@achristie achristie released this 10 Sep 20:02

Added more functions to the LNGGlobalAnalytics class:

Supply and Demand:

  • get_supply_forecast_current - Latest supply forecast (project by project) per month.
  • get_supply_forecast_history - Historical supply forecasts (project by project) per month.
  • get_demand_forecast_current - Latest demand forecast (market by market) per month.
  • get_demand_forecast_history - Historical demand forecast (market by market) per month.

Cargos:
get_cargo_historical_bilateral_trade_flows - Historical monthly aggregated volume data showing country to country flows.
get_cargo_trips - Completed commercial journeys of (LNG) vessel from point A to point B.
get_cargo_events_partial_load - Occurrences involving the loading of a portion of LNG cargo during a Transportation process.
get_cargo_events_partial_unload - Incidents related to the partial unloading of LNG cargo during transportation.
get_cargo_events_partial_reexport - Instances where a fraction of the initially imported LNG is re-exported during the transportation process.
get_cargo_waterborne_trade - LNG cargos by load and arrival date as well as numerous volumetric, geographic, and commercial attributes

v0.0.43

Choose a tag to compare

@achristie achristie released this 19 Aug 15:51
  • Removed dependency on urllib so it will now use whatever version you have installed (assuming it meets other package requirements)
  • Fixed a bug in MarketData where it would sometimes return an error if there was no data.

Chemicals - Outages, Short-term and Long-term Price Forecasts

Choose a tag to compare

@achristie achristie released this 14 Aug 14:48
  • Added short-term (monthly) and long-term (annual) price forecast endpoints to the SDK. By default these will also set isActive=True, which can be overriden.
  • Added outages.

Examples taken from readme:

chem.get_short_term_prices(commodity="Acetone", delivery_region="US Gulf Coast")
# DataFrame of short-term (monthly) price forecasts for Acetone delivered to the US Gulf Coast.

chem.get_outages(
    start_date_gte="2023-01-01",
    capacity_gte=500,
    alert_status=['Confirmed']
)
# DataFrame of chemical plant outages since Jan 1, 2023 where the capacity impacted is >= 500 and the status is `Confirmed`.

Chemicals Analytics

Choose a tag to compare

@achristie achristie released this 07 Aug 18:48

Added 3 chemicals endpoints:

  • Average Annual Capacities
  • Capacity Events
  • Capacity to Consume

usage examples are covered in the readme.md

Note

This library sets isActive to True by default for this dataset. you can override this by setting is_active=[True,False] if you would like to see inactive records.

import spgci as ci

chem = ci.Chemicals()

chem.get_capacity_events(
    event_begin_date_gt="2023-01-01", country="China", event_type=["expand", "startup"]
)
# DataFrame of capacity events in plants in China, that are either "expand" or "startup" since 2023-01-01

chem.get_capacity_to_consume(is_active=[True, False], commodity="Polybutadiene rubber")
# DateFrame of capacities to consume. Setting `is_active` to [True, False] allows you to include records that were corrected or removed which is useful for Point-In-Time analysis.

Structured Heards

Choose a tag to compare

@achristie achristie released this 24 Jun 21:04
  • Bumped minimum Python version to 3.9 (from 3.7)
  • Switched from using distutils to packaging (distutils has been deprecated as of Python 3.10.
  • Added Structured Heards
import spgci as ci

sh = ci.StructuredHeards()

sh.get_markets() # see the list of available markets

sh.get_heards(market="Americas crude oil") # market is a required field

LNG Netbacks

Choose a tag to compare

@achristie achristie released this 06 Feb 20:06

Added support for LNG Netbacks

for example:

import spgci as ci

lng = ci.LNGGlobalAnalytics()

lng.get_netbacks(import_geography="Brazil", date_gte="2024-01-01")

Pandas 2.0

Choose a tag to compare

@achristie achristie released this 06 Feb 18:48

Added Support for Pandas 2.0. By default the library will install pandas 2.x if possible. If not possible it will use Pandas 1.x.

What this typically means is if you have Pandas 2.x installed already this library will not uninstall it and install 1.5.

Weather

Choose a tag to compare

@achristie achristie released this 29 Jan 23:46

Added support for Weather

import spgci as ci

w = ci.Weather()

w.get_forecast(city="Boston")
# DataFrame of forecasts for Boston

w.get_forecast(market="United States", weather_date_gte="2024-01-01", weather_date_lte="2024-01-31")
# DateFrame of forecasts in the United States in January 2024.

w.get_actual(market="Hong Kong", paginate=True)
# DataFrame of actual weather in Hong Kong, paginate=True to get full history.

Also added support for start_date and end_date filtering in get_arbitrage:

import spgci as ci

af = ci.ArbFlow()

af.get_arbitrage(
    base_margin_id=261,
    margin_id=1380,
    frequency_id=1,
    start_date="2024-01-01",
    end_date="2024-01-20",
)

v0.0.33

Choose a tag to compare

@achristie achristie released this 21 Dec 18:42

Small change to add modified_date_{gt | gte | lt | lte} as arguments to ArbFlow().get_margin_data() function.