You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

fds.sdk.RealTimeNews

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fds.sdk.RealTimeNews

Real-Time News client library for Python

0.20.1
pipPyPI
Maintainers
1

FactSet

Real-Time News client library for Python

API Version PyPi Apache-2 license

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:

  • APA
  • AWP
  • Businesswire
  • Cercle Finance
  • Direkt News SE
  • Dow Jones News
  • dpa
  • dpa-AFX
  • EUWAX
  • GlobenewsWire
  • Kauppalehti
  • MT Newswires
  • MoneyAM
  • newsaktuell
  • OMX
  • PR Newswire
  • Ritzau Finans
  • StreetAccount News
  • TDN News

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:

  • API version: 4.0.0
  • SDK version: 0.20.1
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

For more information, please visit https://developer.factset.com/contact

Requirements

  • Python >= 3.7

Installation

Poetry

poetry add fds.sdk.utils fds.sdk.RealTimeNews==0.20.1

pip

pip install fds.sdk.utils fds.sdk.RealTimeNews==0.20.1

Usage

[!IMPORTANT] The parameter variables defined below are just examples and may potentially contain non valid values. Please replace them with valid values.

Example Code

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)

Using Pandas

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)

Debugging

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

Configure a Proxy

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"
    }
)

Custom SSL Certificate

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'
)

Request Retries

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])

Documentation for API Endpoints

All URIs are relative to https://api.factset.com/wealth/v4

ClassMethodHTTP requestDescription
BasicApiget_basic_asset_class_listGET /basic/asset-class/listList of asset classes.
BasicApiget_basic_benchmark_type_listGET /basic/benchmark/type/listList of benchmark types.
BasicApiget_basic_frequency_type_listGET /basic/frequency/type/listList of frequency types.
BasicApiget_basic_language_getGET /basic/language/getDetails for a language.
BasicApiget_basic_language_get_by_codeGET /basic/language/get-by-codeDetails for a language identified by code.
BasicApiget_basic_language_listGET /basic/language/listList of languages.
BasicApiget_basic_market_getGET /basic/market/getDetails of a market.
BasicApiget_basic_market_group_listGET /basic/market/group/listList of market groups.
BasicApiget_basic_market_type_listGET /basic/market/type/listList of market types.
BasicApiget_basic_media_kind_listGET /basic/media/kind/listList of media kinds.
BasicApiget_basic_region_continent_getGET /basic/region/continent/getDetails for a continent.
BasicApiget_basic_region_continent_listGET /basic/region/continent/listList of continents.
BasicApiget_basic_region_country_getGET /basic/region/country/getDetails for a country.
BasicApiget_basic_region_country_get_by_codeGET /basic/region/country/get-by-codeDetails for a country identified by code.
BasicApiget_basic_region_country_listGET /basic/region/country/listList of countries.
BasicApiget_basic_region_getGET /basic/region/getDetails for a region.
BasicApiget_basic_region_listGET /basic/region/listList of regions.
BasicApiget_basic_timezone_getGET /basic/timezone/getDetails of a timezone.
BasicApiget_basic_timezone_get_by_nameGET /basic/timezone/get-by-nameDetails of a timezone identified by name.
BasicApiget_basic_value_unit_alternative_listGET /basic/value-unit/alternative/listList of alternative units.
BasicApiget_basic_value_unit_currency_fractional_getGET /basic/value-unit/currency/fractional/getDetails of a fractional currency.
BasicApiget_basic_value_unit_currency_fractional_listGET /basic/value-unit/currency/fractional/listList of fractional currencies.
BasicApiget_basic_value_unit_getGET /basic/value-unit/getDetails of a value unit.
BasicApipost_basic_background_text_type_listPOST /basic/background-text/type/listList of background text types.
BasicApipost_basic_delivery_listPOST /basic/delivery/listList of deliveries.
BasicApipost_basic_market_listPOST /basic/market/listList of markets.
BasicApipost_basic_media_type_listPOST /basic/media/type/listList of Internet media types.
BasicApipost_basic_mic_operating_listPOST /basic/mic/operating/listList of operating market identifier codes (MIC).
BasicApipost_basic_timezone_listPOST /basic/timezone/listList of timezones.
BasicApipost_basic_value_unit_currency_listPOST /basic/value-unit/currency/listList of currencies.
BasicApipost_basic_value_unit_currency_main_listPOST /basic/value-unit/currency/main/listList of main currencies.
BasicApipost_basic_value_unit_listPOST /basic/value-unit/listList of value units.
CategoryApiget_category_dataset_listGET /category/dataset/listList of entitled category datasets.
CategoryApiget_category_getGET /category/getDetails of a category.
CategoryApiget_category_instrument_listGET /category/instrument/listList of instruments where a specific dataset has assigned a given category.
CategoryApiget_category_level_getGET /category/level/getDetails of a category level.
CategoryApiget_category_listGET /category/listList of categories.
CategoryApiget_category_list_by_levelGET /category/list-by-levelList of categories assigned to a category level.
CategoryApiget_category_list_by_systemGET /category/list-by-systemList of categories assigned to a category system.
CategoryApiget_category_path_getGET /category/path/getPath from the first level to the level of a specific category.
CategoryApiget_category_system_getGET /category/system/getDetails of an entitled category system.
CategoryApiget_category_system_listGET /category/system/listList of entitled category systems.
CategoryApiget_category_system_type_listGET /category/system/type/listList of category system types.
NewsApiget_news_article_getGET /news/article/getDetails for a news article.
NewsApiget_news_article_type_getGET /news/article/type/getDetails for a news article type.
NewsApiget_news_article_type_listGET /news/article/type/listList of news article types.
NewsApiget_news_distributor_getGET /news/distributor/getDetails of a distributor.
NewsApiget_news_distributor_listGET /news/distributor/listList of distributors.
NewsApiget_news_publisher_getGET /news/publisher/getDetails of a publisher.
NewsApiget_news_publisher_listGET /news/publisher/listList of publishers.
NewsApiget_news_publisher_list_by_distributorGET /news/publisher/list-by-distributorList of publishers provided by the given distributor.
NewsApipost_news_article_listPOST /news/article/listList of news articles.
NewsApipost_news_article_list_by_chainPOST /news/article/list-by-chainList news articles of an article chain.
NewsApipost_news_article_list_by_indexPOST /news/article/list-by-indexNews articles for instruments that are constituents of the given indices.
NewsApipost_news_article_list_by_instrumentPOST /news/article/list-by-instrumentNews articles for instruments.
NewsApipost_news_article_list_by_media_kindPOST /news/article/list-by-media-kindList news articles which contain media of specific media kinds.
NewsApipost_news_article_search_by_textPOST /news/article/search-by-textSearch for news articles using a fulltext search.
NewsApipost_news_publisher_search_by_namePOST /news/publisher/search-by-nameSearch for publishers.

Documentation For Models

Documentation For Authorization

FactSetApiKey

  • Type: HTTP basic authentication

FactSetOAuth2

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes: N/A

Notes for Large OpenAPI documents

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 *

Contributing

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.

Keywords

FactSet

FAQs

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.