
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
fds.sdk.RealTimeNews
Advanced tools
Consume FactSet’s StreetAccount news and 3rd party content through an API that seamlessly integrates with quotes, time series, watchlists, and other Functional APIs.
Search for news articles from various news distributors and publishers. Incorporate a multitude of search parameters such as region, category, source, article type and provider-specific meta data, to easily filter out the noise.
All search and list endpoints can be subscribed to receive streamed updates.
News providers include:
See the Real-Time Quotes API for access to detailed price and performance information, plus basic support for security identifier cross-reference.
This Python package is automatically generated by the OpenAPI Generator project:
For more information, please visit https://developer.factset.com/contact
poetry add fds.sdk.utils fds.sdk.RealTimeNews==0.20.1
pip install fds.sdk.utils fds.sdk.RealTimeNews==0.20.1
Install and activate python 3.7+. If you're using pyenv:
pyenv install 3.9.7
pyenv shell 3.9.7
(optional) Install poetry.
[!IMPORTANT] The parameter variables defined below are just examples and may potentially contain non valid values. Please replace them with valid values.
from fds.sdk.utils.authentication import ConfidentialClient
import fds.sdk.RealTimeNews
from fds.sdk.RealTimeNews.api import basic_api
from fds.sdk.RealTimeNews.models import *
from dateutil.parser import parse as dateutil_parser
from pprint import pprint
# 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 class
configuration = fds.sdk.RealTimeNews.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.RealTimeNews.Configuration(
# username='USERNAME-SERIAL',
# password='API-KEY'
# )
# Enter a context with an instance of the API client
with fds.sdk.RealTimeNews.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = basic_api.BasicApi(api_client)
attributes = [
"_attributes_example",
] # [str] | Limit the attributes returned in the response to the specified set. (optional)
try:
# List of asset classes.
# example passing only required values which don't have defaults set
# and optional values
api_response = api_instance.get_basic_asset_class_list(attributes=attributes)
pprint(api_response)
except fds.sdk.RealTimeNews.ApiException as e:
print("Exception when calling BasicApi->get_basic_asset_class_list: %s\n" % e)
# # Get response, http status code and response headers
# try:
# # List of asset classes.
# api_response, http_status_code, response_headers = api_instance.get_basic_asset_class_list_with_http_info(attributes=attributes)
# pprint(api_response)
# pprint(http_status_code)
# pprint(response_headers)
# except fds.sdk.RealTimeNews.ApiException as e:
# print("Exception when calling BasicApi->get_basic_asset_class_list: %s\n" % e)
# # Get response asynchronous
# try:
# # List of asset classes.
# async_result = api_instance.get_basic_asset_class_list_async(attributes=attributes)
# api_response = async_result.get()
# pprint(api_response)
# except fds.sdk.RealTimeNews.ApiException as e:
# print("Exception when calling BasicApi->get_basic_asset_class_list: %s\n" % e)
# # Get response, http status code and response headers asynchronous
# try:
# # List of asset classes.
# async_result = api_instance.get_basic_asset_class_list_with_http_info_async(attributes=attributes)
# api_response, http_status_code, response_headers = async_result.get()
# pprint(api_response)
# pprint(http_status_code)
# pprint(response_headers)
# except fds.sdk.RealTimeNews.ApiException as e:
# print("Exception when calling BasicApi->get_basic_asset_class_list: %s\n" % e)
To convert an API response to a Pandas DataFrame, it is necessary to transform it first to a dictionary.
import pandas as pd
response_dict = api_response.to_dict()['data']
simple_json_response = pd.DataFrame(response_dict)
nested_json_response = pd.json_normalize(response_dict)
The SDK uses the standard library logging
module.
Setting debug
to True
on an instance of the Configuration
class sets the log-level of related packages to DEBUG
and enables additional logging in Pythons HTTP Client.
Note: This prints out sensitive information (e.g. the full request and response). Use with care.
import logging
import fds.sdk.RealTimeNews
logging.basicConfig(level=logging.DEBUG)
configuration = fds.sdk.RealTimeNews.Configuration(...)
configuration.debug = True
You 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
).import fds.sdk.RealTimeNews
configuration = fds.sdk.RealTimeNews.Configuration(
# ...
proxy="http://secret:password@localhost:5050",
proxy_headers={
"Custom-Proxy-Header": "Custom-Proxy-Header-Value"
}
)
TLS/SSL certificate verification can be configured with the following Configuration parameters:
ssl_ca_cert
: a path to the certificate to use for verification in PEM
format.verify_ssl
: setting this to False
disables the verification of certificates.
Disabling the verification is not recommended, but it might be useful during
local development or testing.import fds.sdk.RealTimeNews
configuration = fds.sdk.RealTimeNews.Configuration(
# ...
ssl_ca_cert='/path/to/ca.pem'
)
In case the request retry behaviour should be customized, it is possible to pass a urllib3.Retry
object to the retry
property of the Configuration.
from urllib3 import Retry
import fds.sdk.RealTimeNews
configuration = fds.sdk.RealTimeNews.Configuration(
# ...
)
configuration.retries = Retry(total=3, status_forcelist=[500, 502, 503, 504])
All URIs are relative to https://api.factset.com/wealth/v4
Class | Method | HTTP request | Description |
---|---|---|---|
BasicApi | get_basic_asset_class_list | GET /basic/asset-class/list | List of asset classes. |
BasicApi | get_basic_benchmark_type_list | GET /basic/benchmark/type/list | List of benchmark types. |
BasicApi | get_basic_frequency_type_list | GET /basic/frequency/type/list | List of frequency types. |
BasicApi | get_basic_language_get | GET /basic/language/get | Details for a language. |
BasicApi | get_basic_language_get_by_code | GET /basic/language/get-by-code | Details for a language identified by code. |
BasicApi | get_basic_language_list | GET /basic/language/list | List of languages. |
BasicApi | get_basic_market_get | GET /basic/market/get | Details of a market. |
BasicApi | get_basic_market_group_list | GET /basic/market/group/list | List of market groups. |
BasicApi | get_basic_market_type_list | GET /basic/market/type/list | List of market types. |
BasicApi | get_basic_media_kind_list | GET /basic/media/kind/list | List of media kinds. |
BasicApi | get_basic_region_continent_get | GET /basic/region/continent/get | Details for a continent. |
BasicApi | get_basic_region_continent_list | GET /basic/region/continent/list | List of continents. |
BasicApi | get_basic_region_country_get | GET /basic/region/country/get | Details for a country. |
BasicApi | get_basic_region_country_get_by_code | GET /basic/region/country/get-by-code | Details for a country identified by code. |
BasicApi | get_basic_region_country_list | GET /basic/region/country/list | List of countries. |
BasicApi | get_basic_region_get | GET /basic/region/get | Details for a region. |
BasicApi | get_basic_region_list | GET /basic/region/list | List of regions. |
BasicApi | get_basic_timezone_get | GET /basic/timezone/get | Details of a timezone. |
BasicApi | get_basic_timezone_get_by_name | GET /basic/timezone/get-by-name | Details of a timezone identified by name. |
BasicApi | get_basic_value_unit_alternative_list | GET /basic/value-unit/alternative/list | List of alternative units. |
BasicApi | get_basic_value_unit_currency_fractional_get | GET /basic/value-unit/currency/fractional/get | Details of a fractional currency. |
BasicApi | get_basic_value_unit_currency_fractional_list | GET /basic/value-unit/currency/fractional/list | List of fractional currencies. |
BasicApi | get_basic_value_unit_get | GET /basic/value-unit/get | Details of a value unit. |
BasicApi | post_basic_background_text_type_list | POST /basic/background-text/type/list | List of background text types. |
BasicApi | post_basic_delivery_list | POST /basic/delivery/list | List of deliveries. |
BasicApi | post_basic_market_list | POST /basic/market/list | List of markets. |
BasicApi | post_basic_media_type_list | POST /basic/media/type/list | List of Internet media types. |
BasicApi | post_basic_mic_operating_list | POST /basic/mic/operating/list | List of operating market identifier codes (MIC). |
BasicApi | post_basic_timezone_list | POST /basic/timezone/list | List of timezones. |
BasicApi | post_basic_value_unit_currency_list | POST /basic/value-unit/currency/list | List of currencies. |
BasicApi | post_basic_value_unit_currency_main_list | POST /basic/value-unit/currency/main/list | List of main currencies. |
BasicApi | post_basic_value_unit_list | POST /basic/value-unit/list | List of value units. |
CategoryApi | get_category_dataset_list | GET /category/dataset/list | List of entitled category datasets. |
CategoryApi | get_category_get | GET /category/get | Details of a category. |
CategoryApi | get_category_instrument_list | GET /category/instrument/list | List of instruments where a specific dataset has assigned a given category. |
CategoryApi | get_category_level_get | GET /category/level/get | Details of a category level. |
CategoryApi | get_category_list | GET /category/list | List of categories. |
CategoryApi | get_category_list_by_level | GET /category/list-by-level | List of categories assigned to a category level. |
CategoryApi | get_category_list_by_system | GET /category/list-by-system | List of categories assigned to a category system. |
CategoryApi | get_category_path_get | GET /category/path/get | Path from the first level to the level of a specific category. |
CategoryApi | get_category_system_get | GET /category/system/get | Details of an entitled category system. |
CategoryApi | get_category_system_list | GET /category/system/list | List of entitled category systems. |
CategoryApi | get_category_system_type_list | GET /category/system/type/list | List of category system types. |
NewsApi | get_news_article_get | GET /news/article/get | Details for a news article. |
NewsApi | get_news_article_type_get | GET /news/article/type/get | Details for a news article type. |
NewsApi | get_news_article_type_list | GET /news/article/type/list | List of news article types. |
NewsApi | get_news_distributor_get | GET /news/distributor/get | Details of a distributor. |
NewsApi | get_news_distributor_list | GET /news/distributor/list | List of distributors. |
NewsApi | get_news_publisher_get | GET /news/publisher/get | Details of a publisher. |
NewsApi | get_news_publisher_list | GET /news/publisher/list | List of publishers. |
NewsApi | get_news_publisher_list_by_distributor | GET /news/publisher/list-by-distributor | List of publishers provided by the given distributor. |
NewsApi | post_news_article_list | POST /news/article/list | List of news articles. |
NewsApi | post_news_article_list_by_chain | POST /news/article/list-by-chain | List news articles of an article chain. |
NewsApi | post_news_article_list_by_index | POST /news/article/list-by-index | News articles for instruments that are constituents of the given indices. |
NewsApi | post_news_article_list_by_instrument | POST /news/article/list-by-instrument | News articles for instruments. |
NewsApi | post_news_article_list_by_media_kind | POST /news/article/list-by-media-kind | List news articles which contain media of specific media kinds. |
NewsApi | post_news_article_search_by_text | POST /news/article/search-by-text | Search for news articles using a fulltext search. |
NewsApi | post_news_publisher_search_by_name | POST /news/publisher/search-by-name | Search for publishers. |
If the OpenAPI document is large, imports in fds.sdk.RealTimeNews.apis and fds.sdk.RealTimeNews.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.RealTimeNews.api.default_api import DefaultApi
from fds.sdk.RealTimeNews.model.pet import Pet
Solution 2: Before importing the package, adjust the maximum recursion limit as shown below:
import sys
sys.setrecursionlimit(1500)
import fds.sdk.RealTimeNews
from fds.sdk.RealTimeNews.apis import *
from fds.sdk.RealTimeNews.models import *
Please refer to the contributing guide.
Copyright 2022 FactSet Research Systems Inc
Licensed 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 at
http://www.apache.org/licenses/LICENSE-2.0
Unless 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.
FAQs
Real-Time News client library for Python
We found that fds.sdk.RealTimeNews demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.