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

Uploaded Python 3

File details

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

File metadata

  • Download URL: bitbabble_sdk-1.0.2.tar.gz
  • Upload date:
  • Size: 3.6 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.2.tar.gz
Algorithm Hash digest
SHA256 fd3b102e8f5e6235652054d2c04fcc0008ea7709bfaf6d9ddd04d6d2a4c12b96
MD5 fec669a00df4001d661741fd9fc29efe
BLAKE2b-256 3ddf35d6b72b27a2b76e0b31034a9ec92206d4392a145d14991017ed40cc7396

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bitbabble_sdk-1.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2be33cd481bceab59703ed93789f2edc8f0e312a999a9534e434f9a76b2fcfcf
MD5 d68a00d0d5846790e0daeb829d270a05
BLAKE2b-256 77d4dd48e4ee4dbe125202aa3bd7fc94bdb0580d2794759fe787fd4fbd1d21d6

See more details on using hashes here.

Provenance

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