Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

LSEG Analytics SDK for Python

The LSEG Analytics SDK for Python provides access to LSEG Financials Analytics Services.

Getting Started

$ pip install lseg-analytics-pricing

Usage Examples

An example to create a FX Forward Curve.

from lseg_analytics.pricing.common import (
    TenorType
)

from lseg_analytics.pricing.market_data.fx_forward_curves import (
    create_from_fx_forwards,
    IndirectSourcesSwaps
)

create_from_fx_forwards(
            cross_currency="EURGBP",
            reference_currency="USD",
            sources=IndirectSourcesSwaps(base_fx_forwards="RFB"),
            additional_tenor_types=[TenorType.LONG, TenorType.END_OF_MONTH],
)

Modules Structure

  • async_handler - contains models for asynchronous handling
  • common - contains models that can be used in different API modules
  • helpers - utility functions
  • API modules
    • reference_data
      • calendars
      • floating_rate_indices
    • market_data
      • fx_forward_curves
      • commodities_curves
      • credit_curves
      • eq_volatility
      • fx_volatility
      • inflation_curves
      • interest_rate_curves
      • ipa_interest_rate_curves
      • ircaplet_volatility
      • irswaption_volatility
    • instruments
      • fx_spots
      • fx_forwards
      • bond
      • bond_future
      • cap_floor
      • cds
      • forward_rate_agreement
      • ir_swaps
      • loans
      • options
      • repo
      • structured_notes
      • structured_products
      • swaption
      • term_deposit
    • job_manager
    • templates
      • instrument_templates
    • yield_book_rest

Changelog

3.0.0b4

  • Integrated with Structured Note 1.0.12471 with changes below:
    • [BREAKING CHANGE] Property zc_type is renamed to type in CreditRateTypeEnum type and property zc_unit renamed to unit for class CreditCurveInput
    • Added optional property correlation_lists for class MarketData
  • Integrated with Portfolio API and added new modules:
    • lseg_analytics.pricing.portfolio.portfolios
    • lseg_analytics.pricing.portfolio.counterparties
    • lseg_analytics.pricing.portfolio.netting_sets

3.0.0b3

  • Integrate with PriceIt v1.2.0
  • Added to_df() methods to classes below to convert the object to Pandas DataFrame:
    • IrValuationFields and its derived classes
    • FxValuation and its derived classes
    • IrRiskFields and its derived classes
    • FxAnalyticsDescription and its derived classes
    • BaseCashflow and its derived classes
    • OptionValuationFields
    • IrSwapInstrumentDescriptionFields
    • LoanInstrumentDescriptionFields
    • OptionDescriptionFields
    • StructuredNoteInstrumentDescriptionFields
    • VolatilitySurfaceResponseItem
    • InstrumentTemplateInfo
  • Renamed previous Yield Book Rest samples as "Yield Book - Old" and added new Yield Book Rest samples as "Yield Book - New" using new functions like yb_***

3.0.0b2

  • Integrated with IR Swap 1.0.12342 with changes below:
    • [BREAKING CHANGE] Class IrSwapAsCollectionItem in module instruments.ir_swaps is removed and replaced by IrSwapInfo
    • [BREAKING CHANGE] Return type of function search in module instruments.ir_swaps changed from list[IrSwapAsCollectionItem] to list[IrSwapInfo]
    • [BREAKING CHANGE] Existing class Cashflow is renamed to BaseCashflow and added new union type Cashflow for module instruments.ir_swaps and instruments.loans
    • Added new functions risk and risk_result in module instruments.ir_swaps and class IrSwap to support risk calculation
  • Integrated with Financial Contract 1.0.12354 with changes below:
    • [BREAKING CHANGE] Property parRatePercent is removed from class BondValuation in module instruments.bond
    • [BREAKING CHANGE] Property theoreticalStrikes is removed from class VolatilitySurfaceResponseItem in modules below:
      • market_data.eq_volatility
      • market_data.fx_volatility
      • market_data.ircaplet_volatility
      • market_data.irswaption_volatility
    • Added some optional properties to classes BondCashflows, BondPricingAnalysis and BondDescription in module instruments.bond
  • Added a new helper function sp_cashflows_to_df in module helpers to convert structured product cashflows to Pandas DataFrame. Updated the samples to use the helper function
  • Integrate with PriceIt v1.1.0
  • Added new sample Credit Default Swap - Price-It Payoff Builder with Python for Structured Products

3.0.0b1

  • [BREAKING CHANGE] Function yb_calc_scenarioror renamed to yb_calc_scenario in module yield_book_rest
  • [BREAKING CHANGE] Removed job-manager module
  • [BREAKING CHANGE] value(payload=..., request_pattern="asyncPolling") now returns an AsyncOperation instead of AsyncRequestResponse
  • [BREAKING CHANGE] Property body of class BulkJsonInputItem changed type from Optional[str] to Optional[dict[str, Any]]
  • AsyncOperation provides instance methods .polling() and .result() to poll job status and retrieve the final result
  • Added 26 new functions in module yield_book_rest:
    • yb_bond_search
    • yb_bulk_composite
    • yb_bulk_results
    • yb_bulk_template
    • yb_bulk_user_defined_instrument
    • yb_bulk_zip
    • yb_calc_act_vs_proj
    • yb_calc_actual_ror
    • yb_calc_cashflows
    • yb_calc_wal_sensitivity
    • yb_job_abort
    • yb_job_close
    • yb_job_create
    • yb_job_resubmit
    • yb_job_status
    • yb_job_store_csv
    • yb_job_store_json
    • yb_job_store_text
    • yb_retrieve_collateral_details
    • yb_retrieve_curve
    • yb_retrieve_hist_data
    • yb_retrieve_mbs_history
    • yb_retrieve_mortgage_model_info
    • yb_retrieve_result
    • yb_retrieve_tba_pricing
    • yb_retrieve_vol_surface
  • Added optional parameter custom_extractors for functions description_to_df and templates_to_df in module helpers
  • Updated docstring for some Calendar, FxSpot and FxForward classes and functions
  • Integrate with PriceIt v1.0.0

2.2.0b4

  • Added following two helper functions in module helpers for plotting line/bar chart and updated samples to use them:
    • plot_line_chart
    • plot_bar_chart

2.2.0b3

  • Added 3 new functions in module yield_book_rest:
    • yb_retrieve_indic
    • yb_calc_py
    • yb_calc_scenarioror
  • Integrate with following new versions of QPS APIs:
    • FxForwardCurve 2.0.11112
    • FxForward 2.0.11453
    • FxSpot 2.0.11453
    • Option 1.0.11441
    • Structured Note 1.0.12193
    • IrSwap 1.0.11926
    • Loan 1.0.11926
  • Added following two helper functions in module helpers for plotting volatility surface and smiles and updated samples to use them:
    • plot_volatility_surface_3d
    • plot_volatility_smiles
  • Integrate with PriceIt v0.4.0
  • Added new LFA AI Assistant samples

2.2.0b2

  • Added more workflow samples for Structured Products.
  • Added/updated below helper functions for Pandas DataFrame conversion in module helpers. Updated the samples to use the helper functions.
    • valuation_to_df
    • risk_to_df
    • cashflows_to_df
    • get_nested_attr
    • sort_by_tenor
    • surface_to_df
    • templates_to_df
  • Integrate with PriceIt v0.2.1
  • Added x-ap-sdk-operation and changed User Agent in request headers to support Telemetry

2.2.0b1

  • Support Telemetry in request headers.
  • Added new module priceit for structured product payoff definitions.

2.1.0

  • Added samples Inflation Swaps Valuation and Capped Floored Swaps Valuation for instruments.ir_swaps.
  • Added sample Structured Notes for instruments.structured_notes.

2.0.0

  • [Breaking Change] Removed Python 3.8 support.
  • [BREAKING CHANGE] Integrate with QPS API IrSwap and Loan 1.0.11810 with following changes:
    • Removed functions solve_polling and value_polling from module instruments.ir_swaps and class IrSwap, added new functions solve_result and value_result
    • Removed functions price_polling and value_polling from module instruments.loans and class Loan, added new functions price_result and value_result
  • Added new module async_handler with the new async classes AsyncRequestResponse and AsyncPollingResponse that originally in the lseg-analytics-core package
  • Integrate with QPS API Job Manager 1.0.11816, added new module job_manager for polling async request status
  • Integrate with QPS API Floating Rate Index 1.0.11469
  • Integrate with QPS API Structured Note 1.0.11162, added new module instruments.structured_notes

1.1.0

  • [BREAKING CHANGE] Integrate with QPS API Instrument Templates 1.0.11376 with following breaking changes:
    • Added new mandatory property underlying_spot_date to class StirFutureDefinition in module instrument_templates
  • Integrate with QPS API IrSwap and Loan 1.0.11406 to support async. The async return model will change in next release
  • Added authentication examples in HTML documentation for service account, user account, user provided token and proxy server
  • Added more API fundamental and workflows examples
  • Added helper functions for Pandas DataFrame conversion in module helpers
    • description_to_df
    • valuation_to_df
    • risk_to_df
    • cashflows_to_df
  • Fixed duplicated structured products examples in HTML documentation
  • Removed unnecessary libraries from dependencies

1.0.0

  • Added 4 new functions request_bond_search_async_get, request_bond_search_async_post, request_bond_search_sync_get and request_bond_search_sync_post in module yield_book_rest for Yield Book Rest APIs
  • Supported sorted samples categories and sorted samples of each category for samples meta json file
  • Integrated with QPS API FinancialContract 1.0.11382
  • Added more fundamental and workflows samples and updated existing samples
  • Package created to support QPS and Yield Book Rest only APIs based on Python SDK 2.1.0b5

Metadata

Release files for lseg-analytics-pricing 3.0.0b4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lseg-analytics-pricing 3.0.0b4
File Size Uploaded Provenance Actions
lseg_analytics_pricing-3.0.0b4.tar.gz 4.4 MB Without provenance Details for lseg_analytics_pricing-3.0.0b4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lseg-analytics-pricing 3.0.0b4
File Interpreter ABI Platform Actions
lseg_analytics_pricing-3.0.0b4-py3-none-any.whl Python 3 none any Details for lseg_analytics_pricing-3.0.0b4-py3-none-any.whl

Total release size: 9.3 MB

Release files / lseg_analytics_pricing-3.0.0b4.tar.gz

Download URL lseg_analytics_pricing-3.0.0b4.tar.gz
Size 4.4 MB
Tags Source
SHA-256 checksum
How to use checksums
606b9548967bb5a998976e75685b8ab118bd517d6d41391c04c7ac5ff5829957
BLAKE2b-256 checksum
How to use checksums
3e54d387e8336ca04dd243589eaedee8d087f478c652b373104b6d0042ac0e0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / lseg_analytics_pricing-3.0.0b4-py3-none-any.whl

Download URL lseg_analytics_pricing-3.0.0b4-py3-none-any.whl
Size 4.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
3700dc7e6bf75c5a143eb4da8a3794e8a934ed44f32b03333b94408431e410e6
BLAKE2b-256 checksum
How to use checksums
cc58d95611a67010b6307cdb763bbd2d802fbb8f0db2fbbfcabfcbd33e822b2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Security for lseg-analytics-pricing 3.0.0b4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page