Skip to main content

FactSet Concordance client library for Python

Project description

FactSet

FactSet Concordance client library for Python

PyPi Apache-2 license

The FactSet Concordance API provides the ability to programmatically look up several types of entities by their name and other attributes. It attempts to match attributes that you supply for the entity and returns as many match candidates as it can find. The result is a "concorded" FactSet Entity Permanent identifier. The Entity Identifier can then be used as input throughout FactSet's Content soultions, such as Content APIs and Standard DataFeeds.

There are types of workflows supported in the API. The first workflow type follows traditional API conventions in that a request is accepted and a response is returned synchronously. The second workflow type involves a background task. With this workflow, a task is created for uploading a set of queries, and then the client polls for the task to complete. Once the task has completed, the client retrieves the concordance results throught the decisions endpoint.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 1.1.0
  • Package version: 0.8.4
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements

  • Python >= 3.7

Installation

Poetry

poetry add fds.sdk.utils fds.sdk.FactSetConcordance

pip

pip install fds.sdk.utils fds.sdk.FactSetConcordance

Usage

  1. Generate authentication credentials.
  2. Setup Python environment.
    1. Install and activate python 3.7+. If you're using pyenv:

      pyenv install 3.9.7
      pyenv shell 3.9.7
      
    2. (optional) Install poetry.

  3. Install dependencies.
  4. Run the following:
from fds.sdk.utils.authentication import ConfidentialClient
import fds.sdk.FactSetConcordance
from fds.sdk.FactSetConcordance.api import entity_match_api
from fds.sdk.FactSetConcordance.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
# See https://github.com/FactSet/enterprise-sdk-utils-python#authentication
# for more information on using the ConfidentialClient class
configuration = fds.sdk.FactSetConcordance.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.FactSetConcordance.Configuration(
#     username='USERNAME-SERIAL',
#     password='API-KEY'
# )

# Enter a context with an instance of the API client
with fds.sdk.FactSetConcordance.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = entity_match_api.EntityMatchApi(api_client)
    name = "FactSet" # str | Name of Entity to match.
    client_id = "abc-123" # str | A unique identifer supplied by the user. The clientId is recorded to the user's mapped universe.  (optional)
    country = "US" # str | ISO2 country code corresponding to the entity name that is used when evaluating candidates for a match. For a list of ISO2 Country codes, visit [OA 8754](https://my.apps.factset.com/oa/pages/8754). (optional)
    state = "CT" # str | Two-character state code corresponding to the entity name that is used when evaluating candidates for a match. Currently, only US state codes are supported. (optional)
    url = "url_example" # str | URL corresponding to the entity name that is used when evaluating candidates for a match. (optional)
    include_entity_type = [
        "PUB",
    ] # [str] | Three-character FactSet entity type code used to filter candidates in order to determine the final match result. Only candidates with an entity type specified will be considered for the final match result. Multiple types can be entered separated by commas.   |Entity Type Code|Entity Type Description|Entity Type Code|Entity Type Description|   |---|---|---|---|   |ABS|Asset-Backed||MED|Broadcast Call Sign|   |BAS|Business Association (JP)||MUC|Mutual Fd-Closed End|   |CAC|Consolidated Accounting||MUE|Mutual Fd-ETF|   |CMD|Commodity||MUT|Mutual Fd-Open End|   |COL|College/University||NPO|Non-Profit Organization|   |CUR|Currency||OPD|Operating Division|   |ESP|Emp Stk Ownership Plan||OTH|Other|   |EXT|Extinct||PEF|Pension Fund|   |FAF|Family of Fds (VC/Pvt EQ)||PRO|Real Property|   |FND|Foundation/Endowment||PUB|Public Company|   |FNS|Financing Subsidiary/SPE||PVF|Private Eq Fd/Alt Invt|   |FRX|ForEx||PVT|Private Company|   |GOV|Government||SOV|Sovereign Wealth Fund|   |HED|Hedge Fund||SUB|Subsidiary|   |HOL|Holding Company||TRU|Trust/Trustee|   |IDX|Index||UMB|Umbrella Fund|   |VEN|Venture Capital Fund||JVT|Joint Venture|  (optional)
    exclude_entity_type = [
        "EXT",
    ] # [str] | Three-character FactSet entity type code used to filter candidates in order to determine the final match result. Candidates with an entity type specified will *not* be considered for the final match result. Multiple types can be entered separated by commas.   |Entity Type Code|Entity Type Description|Entity Type Code|Entity Type Description|   |---|---|---|---| |ABS|Asset-Backed||MED|Broadcast Call Sign| |BAS|Business Association (JP)||MUC|Mutual Fd-Closed End| |CAC|Consolidated Accounting||MUE|Mutual Fd-ETF| |CMD|Commodity||MUT|Mutual Fd-Open End| |COL|College/University||NPO|Non-Profit Organization| |CUR|Currency||OPD|Operating Division| |ESP|Emp Stk Ownership Plan||OTH|Other| |EXT|Extinct||PEF|Pension Fund| |FAF|Family of Fds (VC/Pvt EQ)||PRO|Real Property| |FND|Foundation/Endowment||PUB|Public Company| |FNS|Financing Subsidiary/SPE||PVF|Private Eq Fd/Alt Invt| |FRX|ForEx||PVT|Private Company| |GOV|Government||SOV|Sovereign Wealth Fund| |HED|Hedge Fund||SUB|Subsidiary| |HOL|Holding Company||TRU|Trust/Trustee| |IDX|Index||UMB|Umbrella Fund| |VEN|Venture Capital Fund||JVT|Joint Venture|  (optional)
    include_entity_sub_type = [
        "PR",
    ] # [str] | Two-character FactSet entity subtype code used to filter candidates in order to determine the final match result. Only candidates with an entity subtype specified will be considered for the final match result. Multiple types can be entered separated by commas.   |Entity Subtype Code|Entity Subtype Description|Entity Subtype Code|Entity Subtype Description|   |---|---|---|---|   |AR|Arbitrage|IC|Investment Company|   |BM|Bank Investment Division|IN|Insurance Company|   |BR|Broker|MF|Mutual Fund Manager|   |CP|Corporate|ML|Master Ltd Part|   |CU|Custodial|MM|Market Maker|   |FF|Fund of Funds Manager|PB|Private Banking/Wealth Mgmt|   |FH|Fund of Hedge Funds Manager|PF|Pension Fund Manager|   |FO|Foundation/Endowment Manager|PP|Real Estate Manager|   |FS|Fund Distributor|RE|Research Firm|   |FU|Fund|SB|Subsidiary Branch|   |FY|Family Office|ST|Stock Borrowing/Lending|   |GV|Govt (Fed/Local/Agency)|SV|Sovereign Wealth Manager|   |HF|Hedge Fund Manager|VC|Venture Capital/Pvt Equity|   |IA|Investment Adviser|   |IB|Investment Banking|  (optional)
    exclude_entity_sub_type = [
        "HF",
    ] # [str] | Two-character FactSet entity subtype code used to filter candidates in order to determine the final match result. Candidates with an entity subtype specified will not be considered for the final match result. Multiple types can be entered separated by commas. |Entity Subtype Code|Entity Subtype Description|Entity Subtype Code|Entity Subtype Description| |---|---|---|---| |AR|Arbitrage|IC|Investment Company| |BM|Bank Investment Division|IN|Insurance Company| |BR|Broker|MF|Mutual Fund Manager| |CP|Corporate|ML|Master Ltd Part| |CU|Custodial|MM|Market Maker| |FF|Fund of Funds Manager|PB|Private Banking/Wealth Mgmt| |FH|Fund of Hedge Funds Manager|PF|Pension Fund Manager| |FO|Foundation/Endowment Manager|PP|Real Estate Manager| |FS|Fund Distributor|RE|Research Firm| |FU|Fund|SB|Subsidiary Branch| |FY|Family Office|ST|Stock Borrowing/Lending| |GV|Govt (Fed/Local/Agency)|SV|Sovereign Wealth Manager| |HF|Hedge Fund Manager|VC|Venture Capital/Pvt Equity| |IA|Investment Adviser| |IB|Investment Banking|  (optional)
    include_parent = False # bool | Flag to include parent entities in the list of candidates. This parameter does not influence the match result. (optional) if omitted the server will use the default value of False

    try:
        # Get Entity Candidates and Matches for a single name and attributes.
        api_response = api_instance.get_entity_match(name, client_id=client_id, country=country, state=state, url=url, include_entity_type=include_entity_type, exclude_entity_type=exclude_entity_type, include_entity_sub_type=include_entity_sub_type, exclude_entity_sub_type=exclude_entity_sub_type, include_parent=include_parent)
        pprint(api_response)
    except fds.sdk.FactSetConcordance.ApiException as e:
        print("Exception when calling EntityMatchApi->get_entity_match: %s\n" % e)

    # Get response, http status code and response headers
    # try:
    #     # Get Entity Candidates and Matches for a single name and attributes.
    #     api_response, http_status_code, response_headers = api_instance.get_entity_match_with_http_info(name, client_id=client_id, country=country, state=state, url=url, include_entity_type=include_entity_type, exclude_entity_type=exclude_entity_type, include_entity_sub_type=include_entity_sub_type, exclude_entity_sub_type=exclude_entity_sub_type, include_parent=include_parent)
    #     pprint(api_response)
    #     pprint(http_status_code)
    #     pprint(response_headers)
    # except fds.sdk.FactSetConcordance.ApiException as e:
    #     print("Exception when calling EntityMatchApi->get_entity_match: %s\n" % e)

    # Get response asynchronous
    # try:
    #     # Get Entity Candidates and Matches for a single name and attributes.
    #     async_result = api_instance.get_entity_match_async(name, client_id=client_id, country=country, state=state, url=url, include_entity_type=include_entity_type, exclude_entity_type=exclude_entity_type, include_entity_sub_type=include_entity_sub_type, exclude_entity_sub_type=exclude_entity_sub_type, include_parent=include_parent)
    #     api_response = async_result.get()
    #     pprint(api_response)
    # except fds.sdk.FactSetConcordance.ApiException as e:
    #     print("Exception when calling EntityMatchApi->get_entity_match: %s\n" % e)

    # Get response, http status code and response headers asynchronous
    # try:
    #     # Get Entity Candidates and Matches for a single name and attributes.
    #     async_result = api_instance.get_entity_match_with_http_info_async(name, client_id=client_id, country=country, state=state, url=url, include_entity_type=include_entity_type, exclude_entity_type=exclude_entity_type, include_entity_sub_type=include_entity_sub_type, exclude_entity_sub_type=exclude_entity_sub_type, include_parent=include_parent)
    #     api_response, http_status_code, response_headers = async_result.get()
    #     pprint(api_response)
    #     pprint(http_status_code)
    #     pprint(response_headers)
    # except fds.sdk.FactSetConcordance.ApiException as e:
    #     print("Exception when calling EntityMatchApi->get_entity_match: %s\n" % e)

Documentation for API Endpoints

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

Class Method HTTP request Description
EntityMatchApi get_entity_match GET /factset-concordance/v1/entity-match Get Entity Candidates and Matches for a single name and attributes.
EntityMatchApi get_entity_match_for_list POST /factset-concordance/v1/entity-match Get a list of Entity Candidates and Matches for a requested list of up to 25 names and attributes.
EntityMatchBulkApi create_entity_task POST /factset-concordance/v1/entity-task Input a file with names and attributes, creating a taskId.
EntityMatchBulkApi get_entity_decisions GET /factset-concordance/v1/entity-decisions Get the decisions of matches for the requested taskId.
EntityMatchBulkApi get_entity_task_status GET /factset-concordance/v1/entity-task-status Gets the status of the requested taskId or all tasks for a User
ManageMappingsApi get_entity_universe GET /factset-concordance/v1/entity-universe View Universe for the requesting user.
ManageMappingsApi save_entity_mapping POST /factset-concordance/v1/entity-mapping Saves a single-mapping specified by the client.
SnowflakeApi get_snowflake_entity_match GET /factset-concordance/v1/snowflake-entity-match Perform an entity match and return a snowflake-friendly response. 1 Name per request.
SnowflakeApi get_snowflake_entity_match_for_list POST /factset-concordance/v1/snowflake-entity-match Perform an entity search and return a snowflake-friendly response. Up to 25 Names per request.

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.FactSetConcordance.apis and fds.sdk.FactSetConcordance.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.FactSetConcordance.api.default_api import DefaultApi
  • from fds.sdk.FactSetConcordance.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.FactSetConcordance
from fds.sdk.FactSetConcordance.apis import *
from fds.sdk.FactSetConcordance.models import *

Contributing

Please refer to the contributing guide.

Copyright

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

fds.sdk.FactSetConcordance-0.8.4-py3-none-any.whl (122.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page