Skip to main content

Official TVPulse SDK for Python

Project description

TVPulse Python SDK

The official Python SDK for the TVPulse API.

Installation

pip install tvpulse

Usage

First, you need to initialize the Client with your API key. You can get your API key from the TVPulse UI.

import os
from tvpulse import Client, TVPulseError

# Initialize the SDK
# It's recommended to store your API key in an environment variable.
api_key = os.environ.get("TVPULSE_API_KEY")
if not api_key:
  raise ValueError("TVPULSE_API_KEY environment variable not set.")

client = Client(api_key=api_key)

Get Data

You can use the get_data method to retrieve data from the API. This method takes the following arguments:

  • searchTypes: A list of search types to use. Currently, only one search type is supported at a time. Valid search types are "asr" and "ocr".
  • keyword: The keyword to search for.
  • streams: A list of streams to search.
  • start_date: The start date of the search in YYYY-MM-DD HH:MM:SS format.
  • end_date: The end date of the search in YYYY-MM-DD HH:MM:SS format.
  • frequency: The frequency of the search. Valid values are "hour" and "day".
  • score_threshold: The score threshold for the search. This should be a float between 0 and 1.

Here's an example of how to use the get_data method:

try:
  data = client.get_data(
      searchTypes=["asr"],
      keyword="コーヒー",
      streams=["CX", "EX", "NTV", "TBS", "TX"],
      start_date="2025-01-01 00:00:00",
      end_date="2025-01-02 23:59:59",
      frequency="hour",
      score_threshold=0.95
  )
  print(data)
except TVPulseError as e:
  print(f"An error occurred: {e}")

Error Handling

The SDK raises custom exceptions for different types of errors. You can catch these exceptions to handle errors gracefully.

  • TVPulseError: The base class for all SDK errors.
  • AuthenticationError: Raised when there is an authentication error (e.g., an invalid API key).
  • InvalidRequestError: Raised when the request is invalid (e.g., a missing or invalid parameter).

Local Development

When pushing a new version of this SDK, please bump the __version__ number in __init__.py and tag the commit with the same version.

The build system will use the value of __version__ to publish a new tag to PyPI.

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

tvpulse-0.2.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tvpulse-0.2.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file tvpulse-0.2.0.tar.gz.

File metadata

  • Download URL: tvpulse-0.2.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tvpulse-0.2.0.tar.gz
Algorithm Hash digest
SHA256 49c887991b71cbeb125e0cfb418c16daa35815f759dc436ace4cf031ae53038e
MD5 25d7735c55e72bc40f077a318f3b4cb9
BLAKE2b-256 ce96cb4b46afc4735811e9a64c08b0e35e31723aacdd95c56360c5cb4fdac583

See more details on using hashes here.

Provenance

The following attestation bundles were made for tvpulse-0.2.0.tar.gz:

Publisher: publish.yml on infinimind-inc/tvpulse_python_sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tvpulse-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: tvpulse-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tvpulse-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 799b85a721419a0498961b054293fd26f05b9dfe96fc27a0c26a1c4d562380e1
MD5 e2ec570582dbd3cff31b9e44a3c567d2
BLAKE2b-256 77d70100b39d343660ce02620a22e2dcb7b0d0b2f05fe12496293b01534db97f

See more details on using hashes here.

Provenance

The following attestation bundles were made for tvpulse-0.2.0-py3-none-any.whl:

Publisher: publish.yml on infinimind-inc/tvpulse_python_sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page