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.

Get 100 tokens free when you sign up. Create an account at bitbabble.net to receive your API key.

Creating an Account

  1. Go to bitbabble.net
  2. Sign up for a new account
  3. Copy your API key from the dashboard
  4. 100 tokens are credited automatically—no credit card required

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.1.tar.gz (3.5 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.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bitbabble_sdk-1.0.1.tar.gz
  • Upload date:
  • Size: 3.5 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.1.tar.gz
Algorithm Hash digest
SHA256 e1f2ae621988e22ab1c7d7b014a0657f9a6fbcf1faa8d6f2692767ea36d4ee66
MD5 d2eea4e808b21e308cce6263ff629399
BLAKE2b-256 4b6648dac65336e83dc42f01ce5a7f408845995cdd716fcdff3ba8b7e8c94a61

See more details on using hashes here.

Provenance

The following attestation bundles were made for bitbabble_sdk-1.0.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: bitbabble_sdk-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a72bdedb13fa43e259bfe6e7137312fa7f274a71d42ce4c5860b632c87340cb1
MD5 da795b41e9c639eaf3bb9fd7556fb67a
BLAKE2b-256 3994f78def0d479db3acbb5d1d41cb3038e7cc05b62b308cc0b283607067fa52

See more details on using hashes here.

Provenance

The following attestation bundles were made for bitbabble_sdk-1.0.1-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