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.1.1.tar.gz (33.0 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file deepsights-api-1.1.1.tar.gz.

File metadata

  • Download URL: deepsights-api-1.1.1.tar.gz
  • Upload date:
  • Size: 33.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for deepsights-api-1.1.1.tar.gz
Algorithm Hash digest
SHA256 b0f6f208ffd172967b82a7ce1cd0ab0f33d443185cb32cf8108aba1d1d1ef1a7
MD5 00651462e392c9e691d15fbe7084d4cf
BLAKE2b-256 e16e8b58b50b3ae10392f7fdf2b63efe7aedb2b5994ab7d04385ba4468caeccb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for deepsights_api-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1ef02b2a4cfaa7c820c1bf0a18addb9c3739a93aab3f3b26248ad3255b9b8b10
MD5 c1f015636a718b1e9e980622312a0b1d
BLAKE2b-256 a7de2904c46838d98ec50a6c327f0f3e9b2d50c2ffa627b7fcb7112a87267392

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