Metadata-Version: 2.4
Name: sourcetruth
Version: 0.1.0
Summary: Python client for the SourceTruth canonical text API
Author-email: SourceTruth <api@sourcetruth.io>
License: MIT
Project-URL: Homepage, https://sourcetruth.io
Project-URL: Documentation, https://docs.sourcetruth.io
Project-URL: Repository, https://github.com/williamchongdlinkup/sourcetruth-api
Project-URL: Bug Tracker, https://github.com/williamchongdlinkup/sourcetruth-api/issues
Keywords: api,canonical-texts,buddhist,islamic,rag,semantic-search
Classifier: Development Status :: 1 - Planning
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Text Processing :: Linguistic
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# sourcetruth

Python client for the [SourceTruth](https://sourcetruth.io) canonical text API.

SourceTruth provides semantic search and grounded Q&A over pre-indexed canonical corpora — Buddhist scriptures, Islamic texts, Jewish texts, classical philosophy, and more.

## Install

```bash
pip install sourcetruth
```

## Quick start

```python
import requests

API_KEY = "st_..."  # get yours at https://sourcetruth.io

# Semantic search across all corpora
r = requests.post(
    "https://api.sourcetruth.io/v1/search",
    headers={"X-API-Key": API_KEY},
    json={"query": "what is the nature of suffering?", "top_k": 5},
)
for passage in r.json()["passages"]:
    print(passage["reference"], passage["text"][:120])

# Grounded Q&A with citations (paid tiers)
r = requests.post(
    "https://api.sourcetruth.io/v1/answer",
    headers={"X-API-Key": API_KEY},
    json={"question": "What does the Quran say about patience?"},
)
print(r.json()["answer"])
```

## Full SDK

A full Python client with typed models, pagination, and async support is coming in v0.2.0.

In the meantime, the REST API is fully documented at [docs.sourcetruth.io](https://docs.sourcetruth.io).

## Links

- API: [api.sourcetruth.io](https://api.sourcetruth.io)
- Docs: [docs.sourcetruth.io](https://docs.sourcetruth.io)
- RapidAPI: [rapidapi.com/sourcetruth](https://rapidapi.com/sourcetruth)
