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 handlingcommon- contains models that can be used in different API moduleshelpers- utility functions- API modules
reference_datacalendarsfloating_rate_indices
market_datafx_forward_curvescommodities_curvescredit_curveseq_volatilityfx_volatilityinflation_curvesinterest_rate_curvesipa_interest_rate_curvesircaplet_volatilityirswaption_volatility
instrumentsfx_spotsfx_forwardsbondbond_futurecap_floorcdsforward_rate_agreementir_swapsloansoptionsrepostructured_notesstructured_productsswaptionterm_deposit
job_managertemplatesinstrument_templates
yield_book_rest
Changelog
3.0.0b5
- [BREAKING CHANGE] Integrated with new version of Portfolio API for
changed endpoint urls and removed parameters
amc,additional_market_data_input,curve_config_overrideandscenario_generator_urifor functionsubmit_portfolio_xva_request - Integrated with PriceIt v1.3.0
- Updated structured products samples
3.0.0b4
- Integrated with Structured Note 1.0.12471 with changes below:
- [BREAKING CHANGE] Property
zc_typeis renamed totypeinCreditRateTypeEnumtype and propertyzc_unitrenamed tounitfor classCreditCurveInput - Added optional property
correlation_listsfor classMarketData
- [BREAKING CHANGE] Property
- Integrated with Portfolio API and added new modules:
lseg_analytics.pricing.portfolio.portfolioslseg_analytics.pricing.portfolio.counterpartieslseg_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:
IrValuationFieldsand its derived classesFxValuationand its derived classesIrRiskFieldsand its derived classesFxAnalyticsDescriptionand its derived classesBaseCashflowand its derived classesOptionValuationFieldsIrSwapInstrumentDescriptionFieldsLoanInstrumentDescriptionFieldsOptionDescriptionFieldsStructuredNoteInstrumentDescriptionFieldsVolatilitySurfaceResponseItemInstrumentTemplateInfo
- 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
IrSwapAsCollectionItemin moduleinstruments.ir_swapsis removed and replaced byIrSwapInfo - [BREAKING CHANGE] Return type of function
searchin moduleinstruments.ir_swapschanged fromlist[IrSwapAsCollectionItem]tolist[IrSwapInfo] - [BREAKING CHANGE] Existing class
Cashflowis renamed toBaseCashflowand added new union typeCashflowfor moduleinstruments.ir_swapsandinstruments.loans - Added new functions
riskandrisk_resultin moduleinstruments.ir_swapsand classIrSwapto support risk calculation
- [BREAKING CHANGE] Class
- Integrated with Financial Contract 1.0.12354 with changes below:
- [BREAKING CHANGE] Property
parRatePercentis removed from classBondValuationin moduleinstruments.bond - [BREAKING CHANGE] Property
theoreticalStrikesis removed from classVolatilitySurfaceResponseItemin modules below:market_data.eq_volatilitymarket_data.fx_volatilitymarket_data.ircaplet_volatilitymarket_data.irswaption_volatility
- Added some optional properties to classes
BondCashflows,BondPricingAnalysisandBondDescriptionin moduleinstruments.bond
- [BREAKING CHANGE] Property
- Added a new helper function
sp_cashflows_to_dfin modulehelpersto 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 Pythonfor Structured Products
3.0.0b1
- [BREAKING CHANGE] Function
yb_calc_scenariororrenamed toyb_calc_scenarioin moduleyield_book_rest - [BREAKING CHANGE] Removed
job-managermodule - [BREAKING CHANGE]
value(payload=..., request_pattern="asyncPolling")now returns anAsyncOperationinstead ofAsyncRequestResponse - [BREAKING CHANGE] Property
bodyof classBulkJsonInputItemchanged type fromOptional[str]toOptional[dict[str, Any]] AsyncOperationprovides 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_searchyb_bulk_compositeyb_bulk_resultsyb_bulk_templateyb_bulk_user_defined_instrumentyb_bulk_zipyb_calc_act_vs_projyb_calc_actual_roryb_calc_cashflowsyb_calc_wal_sensitivityyb_job_abortyb_job_closeyb_job_createyb_job_resubmityb_job_statusyb_job_store_csvyb_job_store_jsonyb_job_store_textyb_retrieve_collateral_detailsyb_retrieve_curveyb_retrieve_hist_datayb_retrieve_mbs_historyyb_retrieve_mortgage_model_infoyb_retrieve_resultyb_retrieve_tba_pricingyb_retrieve_vol_surface
- Added optional parameter
custom_extractorsfor functionsdescription_to_dfandtemplates_to_dfin modulehelpers - 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
helpersfor plotting line/bar chart and updated samples to use them:plot_line_chartplot_bar_chart
2.2.0b3
- Added 3 new functions in module
yield_book_rest:yb_retrieve_indicyb_calc_pyyb_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
helpersfor plotting volatility surface and smiles and updated samples to use them:plot_volatility_surface_3dplot_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_dfrisk_to_dfcashflows_to_dfget_nested_attrsort_by_tenorsurface_to_dftemplates_to_df
- Integrate with PriceIt v0.2.1
- Added
x-ap-sdk-operationand changed User Agent in request headers to support Telemetry
2.2.0b1
- Support Telemetry in request headers.
- Added new module
priceitfor structured product payoff definitions.
2.1.0
- Added samples
Inflation Swaps ValuationandCapped Floored Swaps Valuationforinstruments.ir_swaps. - Added sample
Structured Notesforinstruments.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_pollingandvalue_pollingfrom moduleinstruments.ir_swapsand classIrSwap, added new functionssolve_resultandvalue_result - Removed functions
price_pollingandvalue_pollingfrom moduleinstruments.loansand classLoan, added new functionsprice_resultandvalue_result
- Removed functions
- Added new module
async_handlerwith the new async classesAsyncRequestResponseandAsyncPollingResponsethat originally in thelseg-analytics-corepackage - Integrate with QPS API Job Manager 1.0.11816, added new module
job_managerfor 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_dateto classStirFutureDefinitionin moduleinstrument_templates
- Added new mandatory property
- 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
helpersdescription_to_dfvaluation_to_dfrisk_to_dfcashflows_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_getandrequest_bond_search_sync_postin moduleyield_book_restfor 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.0b5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lseg_analytics_pricing-3.0.0b5.tar.gz | 4.5 MB | Without provenance | Details for lseg_analytics_pricing-3.0.0b5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lseg_analytics_pricing-3.0.0b5-py3-none-any.whl | Python 3 | none | any | Details for lseg_analytics_pricing-3.0.0b5-py3-none-any.whl |
Total release size: 9.4 MB
Release files / lseg_analytics_pricing-3.0.0b5.tar.gz
| Download URL | lseg_analytics_pricing-3.0.0b5.tar.gz |
|---|---|
| Size | 4.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a791cf9e49ddca17e8f7018fc8b56f8b97ba8844d31fcd60560a7c414d5bd19d
|
|
BLAKE2b-256 checksum How to use checksums |
b85a77445117d265678f6e860ffe4f0a5af2e6e79442c11e3cb1569eb532c408
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.16
|
Release files / lseg_analytics_pricing-3.0.0b5-py3-none-any.whl
| Download URL | lseg_analytics_pricing-3.0.0b5-py3-none-any.whl |
|---|---|
| Size | 4.9 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
11094263651f5203ca3467f9a796c323c7181bc4dfd89ab20ac4af8805b98f96
|
|
BLAKE2b-256 checksum How to use checksums |
2548e8ab68f7e2d2f184f94a3376313d9d8e5af29956972124416537eb7e67d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.16
|
Security for lseg-analytics-pricing 3.0.0b5
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.