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

Uploaded Source

Built Distribution

deepsights_api-1.1.0-py3-none-any.whl (67.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: deepsights-api-1.1.0.tar.gz
  • Upload date:
  • Size: 32.9 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.0.tar.gz
Algorithm Hash digest
SHA256 d51c304cb35fbd3ebd9953577976f77d97513a7998fbee362e44c005e31c8771
MD5 3374dcf5a8a64aacc88139905d0dd9db
BLAKE2b-256 8a78f516e4b082976444921b4ba4a39f33a7592f4e0758a8a699cee2c8c58f53

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for deepsights_api-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f43ab7d57e7594de378d9671ff7fd84010bcfc2bf2b6a793b552db4a1a45c738
MD5 b4b18ccac652caadf8539924d33c15eb
BLAKE2b-256 c916286ddcb5bc7710fdd993509b910b6a3b9df43852e762d588a0d55c367fa3

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