Python client SDK for VeracityAPI content trust scoring
Project description
veracityapi
Python client SDK for VeracityAPI content trust scoring.
VeracityAPI returns an action contract your app can route on: allow, revise, human_review, or reject.
Install
pip install veracityapi
Quickstart
from veracityapi import VeracityAPI
client = VeracityAPI() # reads VERACITY_API_KEY
result = client.analyze_text(
"Travelers should always be careful in tourist areas because scams can happen anywhere.",
auto_revise=True,
context={"format": "article", "intended_use": "publish", "domain": "travel safety"},
)
if result["recommended_action"] == "human_review":
print(result["evidence"])
Helpers
client.analyze({"type": "text", "content": text, "store_content": False})
client.analyze_text(text, auto_revise=True, context={"intended_use": "publish"})
client.analyze_image("https://cdn.example.com/photo.webp")
client.analyze_audio("https://cdn.example.com/voice.mp3", transcript="optional transcript")
client.analyze_batch(items=[{"id": "one", "text": text}])
client.get_balance()
Image/audio helper methods force store_content=False; VeracityAPI does not retain raw media bytes, base64 payloads, or full media URLs for media analysis.
Local release checks
PYTHONPATH=src python -m unittest discover -s tests -v
python -m build --sdist --wheel
python -m twine check dist/*
Errors
Non-2xx responses raise VeracityAPIError with:
statusbodyrequest_idwhen the API returnsx-request-id- a safe message that does not include your API key
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 veracityapi-0.1.0.tar.gz.
File metadata
- Download URL: veracityapi-0.1.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fb2fdeec0965b30f7d3c3d2e95dcfc3544dbdbe898954ebe386cf5eb9c70a3e
|
|
| MD5 |
2a3f4a538f4626c80365fbb9b55368ed
|
|
| BLAKE2b-256 |
02ac9dbf34bf28cabbd84cdde728b2f235e6cccbb26921174a716f4678a9dbca
|
File details
Details for the file veracityapi-0.1.0-py3-none-any.whl.
File metadata
- Download URL: veracityapi-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c46b77d7a4225bbf60561ec74b0e636847cc25e91b24e2e3b4508db7dd541f03
|
|
| MD5 |
d41d43e43eb1f2cbe1e073c90216f81f
|
|
| BLAKE2b-256 |
574668fdb0f3903b49bfcd07eff2a2c7b25dae50688157db507fdfe5e4342b79
|