Python library for the DeepSights APIs
Project description
🤖💡 deepsights-api
This is the official Python client library for the DeepSights API. The library is considered in beta phase, please channel any feedback or issues via the official github page.
deepsights-api
supports access to the DeepSights API for retrieving answers and reports, as well as searching and managing internal documents. It also supports the ContentStore API for direct searching of news articles and secondary reports.
The library has been built and tested on Python 3.10 - 3.12.
Getting started
Installation
Install this library using pip
; we recommend installing it in a virtualenv.
pip install deepsights-api
API keys
Contact us to obtain your API key (may require commercial add-on). Then, configure your api keys either in your environment, or provide it as an argument to the API constructor.
DEEPSIGHTS_API_KEY = <your DeepSights API key>
CONTENTSTORE_API_KEY = <your ContentStore API key; optional>
then
import deepsights
# with keys from environment
ds = deepsights.DeepSights()
cs = deepsights.ContentStore()
# with explicit key
ds = deepsights.DeepSights(api_key="<your API key>")
cs = deepsights.ContentStore(api_key="<your API key>")
Hello, world
To retrieve an answer from DeepSights:
import deepsights
# with key from environment
ds = deepsights.DeepSights()
# obtain answer
response = deepsights.answer_get(ds, "What are emerging food consumption moments for Gen Z?")
# returned data are pydantic objects
print(response.answer)
# you can retrieve the supported properties via schema_human()
print(response.schema_human())
See main.py for more examples. Note that all non-trivial return value from DeepSights API functions are pydantic objects.
Documentation
Access the documentation on github.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for deepsights_api-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddb0d1e633504f9682897d30a80b2af27da12f6ceb664ebbe19c895725a07b9c |
|
MD5 | e74a237e8864ec9544f682c726fcb1ee |
|
BLAKE2b-256 | 70ee77ba7d3db85eb48df561e775845e841bc00347a8aa0fd70f92e1b744df23 |