Python client for the Spam Detector API.
Project description
Spam Detector Client
Python library for calling the Spam Detector API.
Install locally
pip install -e .
After publishing to PyPI, users will install it with:
pip install spamdetector-client
Usage
OpenAI-style client usage:
from spamdetector import SpamDetector
client = SpamDetector(api_key="YOUR_API_KEY")
result = client.messages.create(message="Win a free iPhone today!")
print(result.prediction)
print(result.confidence)
Simple function usage:
from spamdetector import predict
result = predict("Win a free iPhone today!", api_key="YOUR_API_KEY")
print(result.to_dict())
You can also keep the API key in an environment variable:
set SPAMDETECTOR_API_KEY=YOUR_API_KEY
from spamdetector import predict
result = predict("Your message here")
print(result.to_dict())
Publish to PyPI
Update pyproject.toml first:
- Change
authors - Confirm the package name is available on PyPI
- Bump
versionwhenever you publish a new release
Then run:
python -m pip install --upgrade build twine
python -m build
python -m twine upload dist/*
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 spamdetector_client-0.1.0.tar.gz.
File metadata
- Download URL: spamdetector_client-0.1.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d30ecd04c304c43c34412f18d6cc9e4974c8b3a8fb29da8858d4f5b88cbda7c9
|
|
| MD5 |
1cb6222faa9624bbf20fae7b8795f557
|
|
| BLAKE2b-256 |
8f64013df79c723ae3ef24921c0b5d98d022f50eff978e5340f4d63c5e1f36ea
|
File details
Details for the file spamdetector_client-0.1.0-py3-none-any.whl.
File metadata
- Download URL: spamdetector_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51cb87587c49f51c3fc0db3ab4828c58520156fb8469ba048156e1c7734b9e03
|
|
| MD5 |
e58c4eeeee25e7405cdb1c3c3b3f69f0
|
|
| BLAKE2b-256 |
af1415632ff5759a551ad77bff11482ae27be7cd853dea6c240be731aa7f9662
|