LSEG Data Library for Python

financial_contracts.Definitions object

Definition allows you to retrieve data regarding financial instruments within a specific session.

Module

refinitiv.data.content.ipa.financial_contracts

Syntax

financial_contracts.Definitions(definitions)

Parameters

Value Description Data type Optional Default value
definitions An array of single definitions from the FinancialContracts group (See FinancialContractsDefinitions below). array No -
fields A list of fields to return with the response. string[] Yes -
outputs An array of outputs (see FinancialContracts.Outputs). enum[] Yes -
extendedParams Additional parameters to apply to the request. object Yes -

Returned value

financial_contracts.Definitions instance

Methods

get_data(session)

Parameters

Value Description Data type Optional Default value
session Session object. If session parameters are not defined, the default session will be used. Session object Yes None

Returned value

Response

Usage

The following example demonstrates how to create a definition for financial contracts:

import refinitiv.data.content.ipa.financial_contracts as fin_contracts
option_definition = fin_contracts.option.Definition(
    instrument_code="FCHI560000L1.p",
    underlying_type=fin_contracts.option.UnderlyingType.ETI,
    fields=["MarketValueInDealCcy", "DeltaPercent", "GammaPercent", "RhoPercent", "ThetaPercent", "VegaPercent", "ErrorCode", "ErrorMessage"]
)
bond_definition = fin_contracts.bond.Definition(
    issue_date="2002-02-28",
    end_date="2032-02-28",
    notional_ccy="USD",
    interest_payment_frequency="Annual",
    fixed_rate_percent=7,
    interest_calculation_method=fin_contracts.bond.DayCountBasis.DCB_ACTUAL_ACTUAL
)
definitions = fin_contracts.Definitions(universe=[bond_definition, option_definition])
response = definitions.get_data()
115 words (0:36 mins)