Package: fds.sdk.ETFProfileandPrices
ETF Profile and Prices client library for PythonNo description provided (generated by Openapi Generatorhttps://github.com/openapitools/openapi-generator)This Python package is automatically generated by theOpenAPI Generatorproject:API version: v1Package version: 0.10.9Build package: org.openapitools.codegen.languages.PythonClientCodegenRequirementsPython >= 3.7InstallationPoetrypoetryaddfds.sdk.utilsfds.sdk.ETFProfileandPrices==0.10.9pippipinstallfds.sdk.utilsfds.sdk.ETFProfileandPrices==0.10.9UsageGenerate authentication credentials.Setup Python environment.Install and activate python 3.7+. If you're usingpyenv:pyenvinstall3.9.7
pyenvshell3.9.7(optional)Install poetry.Install dependencies.Run the following:fromfds.sdk.utils.authenticationimportConfidentialClientimportfds.sdk.ETFProfileandPricesfromfds.sdk.ETFProfileandPrices.apiimportfactset_apifromfds.sdk.ETFProfileandPrices.modelsimport*fromdateutil.parserimportparseasdateutil_parserfrompprintimportpprint# See configuration.py for a list of all supported configuration parameters.# Examples for each supported authentication method are below,# choose one that satisfies your use case.# (Preferred) OAuth 2.0: FactSetOAuth2# See https://github.com/FactSet/enterprise-sdk#oauth-20# for information on how to create the app-config.json file## The confidential client instance should be reused in production environments.# See https://github.com/FactSet/enterprise-sdk-utils-python#authentication# for more information on using the ConfidentialClient classconfiguration=fds.sdk.ETFProfileandPrices.Configuration(fds_oauth_client=ConfidentialClient('/path/to/app-config.json'))# Basic authentication: FactSetApiKey# See https://github.com/FactSet/enterprise-sdk#api-key# for information how to create an API key# configuration = fds.sdk.ETFProfileandPrices.Configuration(#     username='USERNAME-SERIAL',#     password='API-KEY'# )# Enter a context with an instance of the API clientwithfds.sdk.ETFProfileandPrices.ApiClient(configuration)asapi_client:# Create an instance of the API classapi_instance=factset_api.FactsetApi(api_client)# NOTE: The parameter variable defined below is just an example and may potentially contain non valid values. So please replace this with valid values.symbol="symbol_example"# str | Market symbol of ETP defined by FactSet.# NOTE: The parameter variable defined below is just an example and may potentially contain non valid values. So please replace this with valid values.attributes=["_attributes_example",]# [str] | Limit the attributes returned in the response to the specified set. (optional)# NOTE: The parameter variable defined below is just an example and may potentially contain non valid values. So please replace this with valid values.pagination_offset=0.0# float | Non-negative number of entries to skip, or 0 (default). (optional) if omitted the server will use the default value of 0.0# NOTE: The parameter variable defined below is just an example and may potentially contain non valid values. So please replace this with valid values.pagination_limit=20.0# float | Non-negative maximum number of entries to return. (optional) if omitted the server will use the default value of 20.0try:# This endpoint returns selected ETP's asset allocations.# example passing only required values which don't have defaults set# and optional valuesapi_response=api_instance.get_factset_etf_allocation_asset_list_by_symbol(symbol,attributes=attributes,pagination_offset=pagination_offset,pagination_limit=pagination_limit)pprint(api_response)exceptfds.sdk.ETFProfileandPrices.ApiExceptionase:print("Exception when calling FactsetApi->get_factset_etf_allocation_asset_list_by_symbol:%s\n"%e)# # Get response, http status code and response headers# try:#     # This endpoint returns selected ETP's asset allocations.#     api_response, http_status_code, response_headers = api_instance.get_factset_etf_allocation_asset_list_by_symbol_with_http_info(symbol, attributes=attributes, pagination_offset=pagination_offset, pagination_limit=pagination_limit)#     pprint(api_response)#     pprint(http_status_code)#     pprint(response_headers)# except fds.sdk.ETFProfileandPrices.ApiException as e:#     print("Exception when calling FactsetApi->get_factset_etf_allocation_asset_list_by_symbol: %s\n" % e)# # Get response asynchronous# try:#     # This endpoint returns selected ETP's asset allocations.#     async_result = api_instance.get_factset_etf_allocation_asset_list_by_symbol_async(symbol, attributes=attributes, pagination_offset=pagination_offset, pagination_limit=pagination_limit)#     api_response = async_result.get()#     pprint(api_response)# except fds.sdk.ETFProfileandPrices.ApiException as e:#     print("Exception when calling FactsetApi->get_factset_etf_allocation_asset_list_by_symbol: %s\n" % e)# # Get response, http status code and response headers asynchronous# try:#     # This endpoint returns selected ETP's asset allocations.#     async_result = api_instance.get_factset_etf_allocation_asset_list_by_symbol_with_http_info_async(symbol, attributes=attributes, pagination_offset=pagination_offset, pagination_limit=pagination_limit)#     api_response, http_status_code, response_headers = async_result.get()#     pprint(api_response)#     pprint(http_status_code)#     pprint(response_headers)# except fds.sdk.ETFProfileandPrices.ApiException as e:#     print("Exception when calling FactsetApi->get_factset_etf_allocation_asset_list_by_symbol: %s\n" % e)Using PandasTo convert an API response to a Pandas DataFrame, it is necessary to transform it first to a dictionary.importpandasaspdresponse_dict=api_response.to_dict()['data']simple_json_response=pd.DataFrame(response_dict)nested_json_response=pd.json_normalize(response_dict)DebuggingThe SDK uses the standard libraryloggingmodule.SettingdebugtoTrueon an instance of theConfigurationclass sets the log-level of related packages toDEBUGand enables additional logging in PythonsHTTP Client.Note: This prints out sensitive information (e.g. the full request and response). Use with care.importloggingimportfds.sdk.ETFProfileandPriceslogging.basicConfig(level=logging.DEBUG)configuration=fds.sdk.ETFProfileandPrices.Configuration(...)configuration.debug=TrueConfigure a ProxyYou can pass proxy settings to the Configuration class:proxy: The URL of the proxy to use.proxy_headers: a dictionary to pass additional headers to the proxy (e.g.Proxy-Authorization).importfds.sdk.ETFProfileandPricesconfiguration=fds.sdk.ETFProfileandPrices.Configuration(# ...proxy="http://secret:password@localhost:5050",proxy_headers={"Custom-Proxy-Header":"Custom-Proxy-Header-Value"})Custom SSL CertificateTLS/SSL certificate verification can be configured with the following Configuration parameters:ssl_ca_cert: a path to the certificate to use for verification inPEMformat.verify_ssl: setting this toFalsedisables the verification of certificates.
Disabling the verification is not recommended, but it might be useful during
local development or testing.importfds.sdk.ETFProfileandPricesconfiguration=fds.sdk.ETFProfileandPrices.Configuration(# ...ssl_ca_cert='/path/to/ca.pem')Documentation for API EndpointsAll URIs are relative tohttps://api.factset.com/wealth/v1ClassMethodHTTP requestDescriptionFactsetApiget_factset_etf_allocation_asset_list_by_symbolGET/factset/etf/allocation/asset/listBySymbolThis endpoint returns selected ETP's asset allocations.FactsetApiget_factset_etf_allocation_country_list_by_symbolGET/factset/etf/allocation/country/listBySymbolThis endpoint returns selected ETP's country allocations.FactsetApiget_factset_etf_allocation_currency_list_by_symbolGET/factset/etf/allocation/currency/listBySymbolThis endpoint returns selected ETP's currency allocations.FactsetApiget_factset_etf_allocation_economic_development_list_by_symbolGET/factset/etf/allocation/economicDevelopment/listBySymbolList of allocations classified by a holding's economic development status.FactsetApiget_factset_etf_allocation_exchange_list_by_symbolGET/factset/etf/allocation/exchange/listBySymbolThis endpoint returns selected ETP's exchange allocations.FactsetApiget_factset_etf_allocation_industry_list_by_symbolGET/factset/etf/allocation/industry/listBySymbolThis endpoint returns selected ETP's industry allocations.FactsetApiget_factset_etf_allocation_market_capitalization_list_by_symbolGET/factset/etf/allocation/marketCapitalization/listBySymbolList of allocations classified by a holding's total market capitalization.FactsetApiget_factset_etf_allocation_region_list_by_symbolGET/factset/etf/allocation/region/listBySymbolThis endpoint returns selected ETP's region allocations.FactsetApiget_factset_etf_allocation_sector_list_by_symbolGET/factset/etf/allocation/sector/listBySymbolThis endpoint returns selected ETP's sector allocations.FactsetApiget_factset_etf_analytics_get_by_symbolGET/factset/etf/analytics/getBySymbolFactSet proprietary analytics datapoints for ETPs.FactsetApiget_factset_etf_analytics_holdings_statistics_get_by_symbolGET/factset/etf/analytics/holdings/statistics/getBySymbolFactSet's portfolio statistics for ETPs.FactsetApiget_factset_etf_analytics_score_get_by_symbolGET/factset/etf/analytics/score/getBySymbolFactSet proprietary ETP rankings.FactsetApiget_factset_etf_analytics_trade_get_by_symbolGET/factset/etf/analytics/trade/getBySymbolTrade statistics for specific ETP.FactsetApiget_factset_etf_characteristics_get_by_symbolGET/factset/etf/characteristics/getBySymbolRetrieve basic characteristic information for a specified ETP.FactsetApiget_factset_etf_class_category_broad_listGET/factset/etf/class/category/broad/listList of ETP class broad categories.FactsetApiget_factset_etf_class_category_focus_listGET/factset/etf/class/category/focus/listList of ETP class focus categories.FactsetApiget_factset_etf_class_category_niche_listGET/factset/etf/class/category/niche/listList of ETP class niche categories.FactsetApiget_factset_etf_class_geography_listGET/factset/etf/class/geography/listList of ETP class geographies.FactsetApiget_factset_etf_class_get_by_symbolGET/factset/etf/class/getBySymbolRetrieve an ETP's classification specific to asset class, geography, or investment strategy.FactsetApiget_factset_etf_competitors_list_by_symbolGET/factset/etf/competitors/listBySymbolFactSet's proprietary list of competing companies.FactsetApiget_factset_etf_distribution_get_by_symbolGET/factset/etf/distribution/getBySymbolRetrieve an ETP's current distribution details.FactsetApiget_factset_etf_fund_flows_get_by_symbolGET/factset/etf/fundFlows/getBySymbolRetrieve an ETP's cash inflow/outflows for various time periods.FactsetApiget_factset_etf_get_by_symbolGET/factset/etf/getBySymbolRetrieve basic profile information for a specified ETP.FactsetApiget_factset_etf_growth_of_ten_k_list_by_symbolGET/factset/etf/growthOfTenK/listBySymbolThis endpoint returns selected ETP's Growth of 10K calculated values.FactsetApiget_factset_etf_holdings_list_by_symbolGET/factset/etf/holdings/listBySymbolHoldings details for an individual ETP.FactsetApiget_factset_etf_market_aggregates_get_by_symbolGET/factset/etf/marketAggregates/getBySymbolMarket aggregate data for ETPs.FactsetApiget_factset_etf_premium_discount_summary_list_by_symbolGET/factset/etf/premiumDiscount/summary/listBySymbolSummary of ETP premium discount data.FactsetApiget_factset_etf_price_get_by_symbolGET/factset/etf/price/getBySymbolRetrieve historical ETP NAV values.FactsetApiget_factset_etf_returns_get_by_symbolGET/factset/etf/returns/getBySymbolRetrieve total return data for a specified ETP.FactsetApiget_factset_etf_strategy_get_by_symbolGET/factset/etf/strategy/getBySymbolRetrieve various classification details for a specified ETP.FactsetApiget_factset_etf_strategy_segment_listGET/factset/etf/strategy/segment/listRetrieve a list of ETP strategy segments.FactsetApiget_factset_etf_structure_get_by_symbolGET/factset/etf/structure/getBySymbolRetrieve the basic structure information for a specified ETP.FactsetApiget_factset_etf_taxes_and_fees_us_get_by_symbolGET/factset/etf/taxesAndFees/us/getBySymbolRetrieve the tax and fee related information for a specified ETP.FactsetApiget_factset_etf_time_series_list_by_symbolGET/factset/etf/timeSeries/listBySymbolRetrieve historical NAV data for a specified ETP.Documentation For ModelsAttributesMemberCursorBasedPaginationOutputObjectCursorBasedPaginationOutputObjectWithoutTotalErrorMetaObjectErrorObjectInlineResponse200InlineResponse2001InlineResponse20010InlineResponse20010DataInlineResponse20010DataIndexChangeInlineResponse20010DataRiskInlineResponse20010DataSecurityLendingInlineResponse20011InlineResponse20011DataInlineResponse20012InlineResponse20012DataInlineResponse20012DataBetaInlineResponse20012DataEfficiencyInlineResponse20012DataFitInlineResponse20012DataTradabilityInlineResponse20013InlineResponse20013DataInlineResponse20013DataBlockTradeInlineResponse20013DataImpedimentsToCreationInlineResponse20013DataPremiumDiscountInlineResponse20013DataSpreadInlineResponse20013DataTrackingDifferenceInlineResponse20014InlineResponse20014DataInlineResponse20014DataCounterPartyInlineResponse20014DataGearingInlineResponse20014DataGearingLeverageInlineResponse20014DataHedgeInlineResponse20014DataServiceProviderInlineResponse20015InlineResponse20015DataInlineResponse20015DataCategoryInlineResponse20015DataGeographyInlineResponse20016InlineResponse20016DataInlineResponse20017InlineResponse20017DataInlineResponse20018InlineResponse20018DataInlineResponse20019InlineResponse20019DataInlineResponse2001DataInlineResponse2001DataAssetsInlineResponse2001MetaInlineResponse2002InlineResponse20020InlineResponse20020DataInlineResponse20021InlineResponse20021DataInlineResponse20021DataCapitalGainsInlineResponse20021DataDividendInlineResponse20022InlineResponse20022DataInlineResponse20023InlineResponse20023DataInlineResponse20024InlineResponse20024DataInlineResponse20024ExchangeInlineResponse20025InlineResponse20025DataInlineResponse20025DataAverageLifeInlineResponse20025DataOptionAdjustedSpreadInlineResponse20026InlineResponse20026DataInlineResponse20026DataCountInlineResponse20026DataSummaryInlineResponse20027InlineResponse20027DataInlineResponse20027DataNavInlineResponse20027DataNavLastInlineResponse20027DataSharesOutstandingInlineResponse20028InlineResponse20028DataInlineResponse20029InlineResponse20029DataInlineResponse2002DataInlineResponse2002DataCountriesInlineResponse2003InlineResponse20030InlineResponse20030DataInlineResponse20031InlineResponse20031DataInlineResponse20032InlineResponse20032DataInlineResponse20032DataExpenseRatioInlineResponse20032DataMaxCapitalGainsRateInlineResponse20033InlineResponse20033DataInlineResponse2003DataInlineResponse2003DataCurrenciesInlineResponse2004InlineResponse2004DataInlineResponse2004DataClassificationsInlineResponse2005InlineResponse2005DataInlineResponse2005DataExchangesInlineResponse2006InlineResponse2006DataInlineResponse2006DataIndustriesInlineResponse2007InlineResponse2007DataInlineResponse2007DataClassificationsInlineResponse2008InlineResponse2008DataInlineResponse2008DataRegionsInlineResponse2009InlineResponse2009DataInlineResponse2009DataSectorsInlineResponse200DataInlineResponse200DataBrandInlineResponse200DataCreateRedeemInlineResponse200DataCurrencyInlineResponse200DataDocumentationInlineResponse200DataExchangeInlineResponse200DataFinancialReportInlineResponse200DataFinancialReportAnnualInlineResponse200DataFinancialReportSemiAnnualInlineResponse200DataIndexInlineResponse200DataInsightInlineResponse200DataIssuerInlineResponse200DataTradingInlineResponse200DataTradingAverageInlineResponse200DataTradingMedianInlineResponse200MetaLanguageMemberOffsetBasedPaginationOutputObjectOffsetBasedPaginationOutputObjectWithoutTotalPartialOutputObjectStatusObjectDocumentation For AuthorizationFactSetApiKeyType: HTTP basic authenticationFactSetOAuth2Type: OAuthFlow: applicationAuthorization URL:Scopes: N/ANotes for Large OpenAPI documentsIf the OpenAPI document is large, imports in fds.sdk.ETFProfileandPrices.apis and fds.sdk.ETFProfileandPrices.models may fail with a
RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:Solution 1:
Use specific imports for apis and models like:from fds.sdk.ETFProfileandPrices.api.default_api import DefaultApifrom fds.sdk.ETFProfileandPrices.model.pet import PetSolution 2:
Before importing the package, adjust the maximum recursion limit as shown below:import sys
sys.setrecursionlimit(1500)
import fds.sdk.ETFProfileandPrices
from fds.sdk.ETFProfileandPrices.apis import *
from fds.sdk.ETFProfileandPrices.models import *ContributingPlease refer to thecontributing guide.CopyrightCopyright 2022 FactSet Research Systems IncLicensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.