Skip to main content

Official Python SDK for the BitBabble sentiment analysis API

Project description

bitbabble-sdk

Official Python SDK for the BitBabble sentiment analysis API.

Installation

pip install bitbabble-sdk

Quick Start

from bitbabble import BitBabbleClient

client = BitBabbleClient(api_key="bb_your_api_key")
result = client.sentiment("I love this product!")

print(result)
# {
#     "sentiment": "positive",
#     "score": 0.82,
#     "confidence": "high",
#     "cached": False,
# }

API

BitBabbleClient(api_key, *, base_url=...)

Parameter Type Description
api_key str Your BitBabble API key
base_url str Override the API base URL (optional)

client.sentiment(text)

Analyze the sentiment of a text string (1–140 characters).

Returns a SentimentResult (TypedDict):

Field Type Description
sentiment "negative" | "neutral" | "positive" Predicted sentiment label
score float Score from -1 (bearish) to +1 (bullish)
confidence "low" | "medium" | "high" Confidence of the prediction
cached bool Whether the result was served from cache

Error Handling

from bitbabble import (
    BitBabbleClient,
    AuthenticationError,
    InsufficientCreditsError,
    RateLimitError,
)

try:
    result = client.sentiment("some text")
except AuthenticationError:
    # 401 — invalid or missing API key
    ...
except InsufficientCreditsError:
    # 402 — out of credits
    ...
except RateLimitError:
    # 429 — too many requests
    ...

Requirements

License

MIT

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

bitbabble_sdk-1.0.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

bitbabble_sdk-1.0.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file bitbabble_sdk-1.0.0.tar.gz.

File metadata

  • Download URL: bitbabble_sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bitbabble_sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5858a085e3bbfd0287dd8537053a5dfc847e1b27106584d5e2601162b68529d2
MD5 8276f3b30fe8e2d1ebef6ee8b6e043d2
BLAKE2b-256 782c9533b3357ce7b17380c18a2fab80a19435a54f5c6d1179800b91bfc7c0fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for bitbabble_sdk-1.0.0.tar.gz:

Publisher: publish-pypi.yml on bitbabble/bitbabble-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 bitbabble_sdk-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: bitbabble_sdk-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bitbabble_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2793b1a2e9e96febc7e8476b0acc1bf7529d2a6561de9c7396d40705df27da4e
MD5 92e073ba27e833226cc493cd50fefbd7
BLAKE2b-256 cea690b45be9844763f85cfda7895092336a0b87df59505a0ff10b61f4815fa3

See more details on using hashes here.

Provenance

The following attestation bundles were made for bitbabble_sdk-1.0.0-py3-none-any.whl:

Publisher: publish-pypi.yml on bitbabble/bitbabble-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