Metadata-Version: 2.1
Name: fds.sdk.FactSetSearchAnswers
Version: 0.9.1
Summary: FactSet Search Answers client library for Python
Home-page: https://github.com/FactSet/enterprise-sdk/tree/main/code/python/FactSetSearchAnswers/v1
Author: FactSet Research Systems
License: Apache-2.0
Keywords: FactSet,API,SDK
Platform: UNKNOWN
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: urllib3 (>=1.25.3)
Requires-Dist: python-dateutil
Requires-Dist: fds.sdk.utils (>=0.10.0)

<img alt="FactSet" src="https://www.factset.com/hubfs/Assets/images/factset-logo.svg" height="56" width="290">

# FactSet Search Answers client library for Python

[![PyPi](https://img.shields.io/pypi/v/fds.sdk.FactSetSearchAnswers)](https://pypi.org/project/fds.sdk.FactSetSearchAnswers/)
[![Apache-2 license](https://img.shields.io/badge/license-Apache2-brightgreen.svg)](https://www.apache.org/licenses/LICENSE-2.0)

The FactSet Search Answers API provides answers to search queries, reflecting the data shown within FactSet Search Answers, and allowing you to easily add financial data to your widgets, lookups, bots, and assistants. The API understands a fixed amount of search terms and returns structured data from FactSet’s many data sources. Possible answers include Price of a Company, Top 10 Year-to-Date Gainers, Revenue per Passenger Mile, and many more.

This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 1.0.0
- Package version: 0.9.1
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

## Requirements

* Python >= 3.6

## Installation

### Poetry

```python
poetry add fds.sdk.utils fds.sdk.FactSetSearchAnswers
```

### pip

```python
pip install fds.sdk.utils fds.sdk.FactSetSearchAnswers
```

## Usage

1. [Generate authentication credentials](../../../../README.md#authentication).
2. Setup Python environment.
   1. Install and activate python 3.6+. If you're using [pyenv](https://github.com/pyenv/pyenv):

      ```sh
      pyenv install 3.9.7
      pyenv shell 3.9.7
      ```

   2. (optional) [Install poetry](https://python-poetry.org/docs/#installation).
3. [Install dependencies](#installation).
4. Run the following:

```python

from fds.sdk.utils.authentication import ConfidentialClient
import fds.sdk.FactSetSearchAnswers
from fds.sdk.FactSetSearchAnswers.api import answers_api
from fds.sdk.FactSetSearchAnswers.model.adaptive_card_answer_success_response import AdaptiveCardAnswerSuccessResponse
from fds.sdk.FactSetSearchAnswers.model.answer_failure_response import AnswerFailureResponse
from fds.sdk.FactSetSearchAnswers.model.data_answer_success_response import DataAnswerSuccessResponse
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.FactSetSearchAnswers.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.FactSetSearchAnswers.Configuration(
#     username = 'USERNAME-SERIAL',
#     password = 'API-KEY'
# )

# Enter a context with an instance of the API client
with fds.sdk.FactSetSearchAnswers.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = answers_api.AnswersApi(api_client)
    query = "query_example" # str | Query for desired answer (e.g., \"fds price\")
include_thumbnail = False # bool | Includes thumbnail of Adaptive Card in response (optional) (default to False)
disable_no_answer_responses = True # bool | Disables no-result answer responses (no-results and answer without data) (optional) (default to True)

    try:
        # Fetch FactSet answer in Adaptive Card format
        api_response = api_instance.search_for_adaptive_card_answer(query, include_thumbnail=include_thumbnail, disable_no_answer_responses=disable_no_answer_responses)
        pprint(api_response)
    except fds.sdk.FactSetSearchAnswers.ApiException as e:
        print("Exception when calling AnswersApi->search_for_adaptive_card_answer: %s\n" % e)
```

## Documentation for API Endpoints

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

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AnswersApi* | [**search_for_adaptive_card_answer**](docs/AnswersApi.md#search_for_adaptive_card_answer) | **GET** /search/answers/v1/adaptive-card | Fetch FactSet answer in Adaptive Card format
*AnswersApi* | [**search_for_data_answer**](docs/AnswersApi.md#search_for_data_answer) | **GET** /search/answers/v1/data | Fetch FactSet answer in data format


## Documentation For Models

 - [AdaptiveCardAnswerSuccessResponse](docs/AdaptiveCardAnswerSuccessResponse.md)
 - [AdaptiveCardDataItem](docs/AdaptiveCardDataItem.md)
 - [AdaptiveCardWithThumbnail](docs/AdaptiveCardWithThumbnail.md)
 - [Answer](docs/Answer.md)
 - [AnswerAllOf](docs/AnswerAllOf.md)
 - [AnswerFailureResponse](docs/AnswerFailureResponse.md)
 - [AnswerWithoutData](docs/AnswerWithoutData.md)
 - [AnswerWithoutDataAllOf](docs/AnswerWithoutDataAllOf.md)
 - [AnswerWithoutDataAllOfTemplateData](docs/AnswerWithoutDataAllOfTemplateData.md)
 - [ApplicationLink](docs/ApplicationLink.md)
 - [ChangeColor](docs/ChangeColor.md)
 - [ColoredValue](docs/ColoredValue.md)
 - [ColoredValueLabelDateTemplate](docs/ColoredValueLabelDateTemplate.md)
 - [ColoredValueLabelDateTemplateAllOf](docs/ColoredValueLabelDateTemplateAllOf.md)
 - [CountryID](docs/CountryID.md)
 - [DataAnswer](docs/DataAnswer.md)
 - [DataAnswerData](docs/DataAnswerData.md)
 - [DataAnswerSuccessResponse](docs/DataAnswerSuccessResponse.md)
 - [DataPair](docs/DataPair.md)
 - [Error](docs/Error.md)
 - [ErrorLink](docs/ErrorLink.md)
 - [ErrorSource](docs/ErrorSource.md)
 - [Fdc3Context](docs/Fdc3Context.md)
 - [Fdc3Country](docs/Fdc3Country.md)
 - [Fdc3Instrument](docs/Fdc3Instrument.md)
 - [InstrumentID](docs/InstrumentID.md)
 - [LabelValueChangeLabelValueChangeTemplate](docs/LabelValueChangeLabelValueChangeTemplate.md)
 - [LabelValueChangeLabelValueChangeTemplateAllOf](docs/LabelValueChangeLabelValueChangeTemplateAllOf.md)
 - [LinkTextBlockTemplate](docs/LinkTextBlockTemplate.md)
 - [LinkTextBlockTemplateAllOf](docs/LinkTextBlockTemplateAllOf.md)
 - [NoAnswersFound](docs/NoAnswersFound.md)
 - [NoAnswersFoundAllOf](docs/NoAnswersFoundAllOf.md)
 - [PercentChange](docs/PercentChange.md)
 - [PercentChangeLabelTemplate](docs/PercentChangeLabelTemplate.md)
 - [PercentChangeLabelTemplateAllOf](docs/PercentChangeLabelTemplateAllOf.md)
 - [RankedTable](docs/RankedTable.md)
 - [RankedTableEntity](docs/RankedTableEntity.md)
 - [RankedTableRow](docs/RankedTableRow.md)
 - [RankedTableTemplate](docs/RankedTableTemplate.md)
 - [RankedTableTemplateAllOf](docs/RankedTableTemplateAllOf.md)
 - [Table](docs/Table.md)
 - [TableTableTemplate](docs/TableTableTemplate.md)
 - [TableTableTemplateAllOf](docs/TableTableTemplateAllOf.md)
 - [TableTemplate](docs/TableTemplate.md)
 - [TableTemplateAllOf](docs/TableTemplateAllOf.md)
 - [Template](docs/Template.md)
 - [TemplateData](docs/TemplateData.md)
 - [TemplateWithLinks](docs/TemplateWithLinks.md)
 - [TemplateWithLinksAllOf](docs/TemplateWithLinksAllOf.md)
 - [TextBlockFootingTemplate](docs/TextBlockFootingTemplate.md)
 - [TextBlockFootingTemplateAllOf](docs/TextBlockFootingTemplateAllOf.md)
 - [TitledTextBlock](docs/TitledTextBlock.md)
 - [ValueChange](docs/ValueChange.md)
 - [ValueChangeDateLabelTemplate](docs/ValueChangeDateLabelTemplate.md)
 - [ValueChangeDateLabelTemplateAllOf](docs/ValueChangeDateLabelTemplateAllOf.md)
 - [ValueColor](docs/ValueColor.md)
 - [ValueLabelDateDataPairListTemplate](docs/ValueLabelDateDataPairListTemplate.md)
 - [ValueLabelDateDataPairListTemplateAllOf](docs/ValueLabelDateDataPairListTemplateAllOf.md)
 - [ValueLabelDateTemplate](docs/ValueLabelDateTemplate.md)
 - [ValueLabelDateTemplateAllOf](docs/ValueLabelDateTemplateAllOf.md)
 - [ValueLabelDateTextBlockTemplate](docs/ValueLabelDateTextBlockTemplate.md)
 - [ValueLabelDateTextBlockTemplateAllOf](docs/ValueLabelDateTextBlockTemplateAllOf.md)
 - [ValueLabelTemplate](docs/ValueLabelTemplate.md)
 - [ValueLabelTemplateAllOf](docs/ValueLabelTemplateAllOf.md)


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

## Contributing

Please refer to the [contributing guide](../../../../CONTRIBUTING.md).

## 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.



