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

Uploaded Source

Built Distribution

deepsights_api-1.2.1-py3-none-any.whl (67.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: deepsights_api-1.2.1.tar.gz
  • Upload date:
  • Size: 32.0 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.1.tar.gz
Algorithm Hash digest
SHA256 68e633f61903e04da4f21aade0383dda74f9f59ef49abf66cca2b141b60ba76b
MD5 b0bd6cb8d0fdb4b59dcc3cf12a3cfeb2
BLAKE2b-256 c8187e1e8a5bb0bd4baf7fe365add4c6d19e13742ae91bff98d472376ba0af0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for deepsights_api-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 852d25fbc090e7d5628b3f1379ca060f9bc647d44c85b41e7d68e8be40288f05
MD5 13feee9969191521ccffb6392aa8c1d9
BLAKE2b-256 5f9461bbfb8cf6ea183ca8350e11ad0262ab30ab889e77b048b1e424ecffdaf7

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