Package: fds.sdk.utils
FactSet SDK Utilities for PythonThis repository contains a collection of utilities that supports FactSet's SDK in Python and facilitate usage of FactSet APIs.InstallationPoetrypoetryaddfds.sdk.utilspippipinstallfds.sdk.utilsUsageThis library contains multiple modules, sample usage of each module is below.AuthenticationFirst, you need to create the OAuth 2.0 client configuration that will be used to authenticate against FactSet's APIs:Create anew applicationon FactSet's Developer Portal.When prompted, download the configuration file and move it to your development environment.fromfds.sdk.utils.authenticationimportConfidentialClientimportrequestsclient=ConfidentialClient('/path/to/config.json')res=requests.get('https://api.factset.com/analytics/lookups/v3/currencies',headers={'Authorization':'Bearer '+client.get_access_token()})print(res.text)ModulesInformation about the various utility modules contained in this library can be found below.AuthenticationTheauthentication moduleprovides helper classes that facilitateOAuth 2.0authentication and authorization with FactSet's APIs. Currently the module has support for theclient credentials flow.Each helper class in the module has the following features:Accepts a configuration file ordictthat contains information about the OAuth 2.0 client, including the client ID and private key.Performs authentication with FactSet's OAuth 2.0 authorization server and retrieves an access token.Caches the access token for reuse and requests a new access token as needed when one expires.ConfigurationClasses in the authentication module require OAuth 2.0 client configuration information to be passed to constructors through a JSON-formatted file or adict. In either case the format is the same:{"name":"Application name registered with FactSet's Developer Portal","clientId":"OAuth 2.0 Client ID registered with FactSet's Developer Portal","clientAuthType":"Confidential","owners":["USERNAME-SERIAL"],"jwk":{"kty":"RSA","use":"sig","alg":"RS256","kid":"Key ID","d":"ECC Private Key","n":"Modulus","e":"Exponent","p":"First Prime Factor","q":"Second Prime Factor","dp":"First Factor CRT Exponent","dq":"Second Factor CRT Exponent","qi":"First CRT Coefficient",}}If you're just starting out, you can visit FactSet's Developer Portal tocreate a new applicationand download a configuration file in this format.If you're creating and managing your signing key pair yourself, see the requiredJWK parametersfor public-private key pairs.DebuggingThis library uses thelogging moduleto log various messages that will help you understand what it's doing. You can increase the log level to see additional debug information using standard conventions. For example:logging.getLogger('fds.sdk.utils').setLevel(logging.DEBUG)orlogging.getLogger('fds.sdk.utils.authentication').setLevel(logging.DEBUG)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.