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
- Go to bitbabble.net
- Sign up for a new account
- Copy your API key from the dashboard
- 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
- Python 3.8+
- httpx
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd3b102e8f5e6235652054d2c04fcc0008ea7709bfaf6d9ddd04d6d2a4c12b96
|
|
| MD5 |
fec669a00df4001d661741fd9fc29efe
|
|
| BLAKE2b-256 |
3ddf35d6b72b27a2b76e0b31034a9ec92206d4392a145d14991017ed40cc7396
|
Provenance
The following attestation bundles were made for bitbabble_sdk-1.0.2.tar.gz:
Publisher:
publish-pypi.yml on bitbabble/bitbabble-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bitbabble_sdk-1.0.2.tar.gz -
Subject digest:
fd3b102e8f5e6235652054d2c04fcc0008ea7709bfaf6d9ddd04d6d2a4c12b96 - Sigstore transparency entry: 1132424250
- Sigstore integration time:
-
Permalink:
bitbabble/bitbabble-sdk@20f4ae5d142711c50e6be41ae0ea53a76279c5e1 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/bitbabble
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@20f4ae5d142711c50e6be41ae0ea53a76279c5e1 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2be33cd481bceab59703ed93789f2edc8f0e312a999a9534e434f9a76b2fcfcf
|
|
| MD5 |
d68a00d0d5846790e0daeb829d270a05
|
|
| BLAKE2b-256 |
77d4dd48e4ee4dbe125202aa3bd7fc94bdb0580d2794759fe787fd4fbd1d21d6
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bitbabble_sdk-1.0.2-py3-none-any.whl -
Subject digest:
2be33cd481bceab59703ed93789f2edc8f0e312a999a9534e434f9a76b2fcfcf - Sigstore transparency entry: 1132424307
- Sigstore integration time:
-
Permalink:
bitbabble/bitbabble-sdk@20f4ae5d142711c50e6be41ae0ea53a76279c5e1 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/bitbabble
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@20f4ae5d142711c50e6be41ae0ea53a76279c5e1 -
Trigger Event:
push
-
Statement type: