Skip to main content

Python library for the DeepSights APIs

Project description

🤖💡 deepsights-api

PyPI Changelog Tests License

This is the official Python client library for the DeepSights API.

The library has been built and tested on Python 3.10 - 3.12. Please channel any feedback or issues via the github page.

Scope

deepsights-api bundles access to various subsystems.

Document Store

The Document Store hosts all customer-owned documents, such as presentations and reports. The documentstore API exposes lifecycle management, search and access to documents.

Content Store

The Content Store holds public and paid 3rd party content, including industry news and secondary sources. The contentstore API exposes search and access to this content.

User Client

The User Client serves to impersonate existing platform users with their access permissions. The userclient API supports obtaining AI-generated answers and reports in reponse to business questions.

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(s) (may require commercial add-on).

API Key Scope
DEEPSIGHTS Required to use deepsights-api and the documentstore functions
CONTENTSTORE Optional key to access the contentstore functions
MIP Optional key to access the userclient functions for customers utilizing the core Market Logic platform

Note that your API key may be authorized to access only a subset of the API endpoints.

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>
MIP_API_KEY = <your MIP API key; optional>

then

import deepsights

# with keys from environment
ds = deepsights.DeepSights()

# OR with explicit key
ds = deepsights.DeepSights(
    ds_api_key="<your DEEPSIGHTS API key>",
    cs_api_key="<your CONTENTSTORE API key>", 
    mip_api_key="<your MIP API key>"
)

Hello, world

To retrieve an answer from DeepSights:

import deepsights

# with API keys from environment
ds = deepsights.DeepSights()

# obtain the user client; you will need an actual user's email here!
uc = ds.get_userclient("john.doe@acme.com")

# obtain an answer
response = uc.answersV2.create_and_wait("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

deepsights_api-1.2.0.tar.gz (31.9 kB view details)

Uploaded Source

Built Distribution

deepsights_api-1.2.0-py3-none-any.whl (67.7 kB view details)

Uploaded Python 3

File details

Details for the file deepsights_api-1.2.0.tar.gz.

File metadata

  • Download URL: deepsights_api-1.2.0.tar.gz
  • Upload date:
  • Size: 31.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for deepsights_api-1.2.0.tar.gz
Algorithm Hash digest
SHA256 8d98946ad1aefc865611c47cb1032445c049fd9a3abee735dbc27988f78bd625
MD5 4fb960a18c8733979867f220cf650867
BLAKE2b-256 fed518cb2c7a166d5ff5a4e2088a09f6a71f34a31e52df05c897e256b58e379f

See more details on using hashes here.

File details

Details for the file deepsights_api-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for deepsights_api-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b413f6a7bde85562b066a66257ca71e856bafacfaabcf9da5fd20856450bb573
MD5 e2e41030b9fb9655b4913d2b83b74926
BLAKE2b-256 58127dbd937b7842758fc68ffbe580d2b8ca121d88f7b7e9bf0044f93a2695ba

See more details on using hashes here.

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