klawsearch (Python SDK)
pip install klawsearch
Quick start
from klawsearch import KlawSearch
client = KlawSearch(api_key="ks-live-...") # or set KLAWSEARCH_API_KEY env var
r = client.search("latest LLM benchmarks", max_results=5)
print(r.answer)
for hit in r:
print(hit.score, hit.url, hit.title)
Async
import asyncio
from klawsearch import AsyncKlawSearch
async def main():
async with AsyncKlawSearch(api_key="ks-live-...") as client:
r = await client.search("hacker news api")
print(r.answer)
asyncio.run(main())
LangChain integration
A drop-in KlawSearchResults tool with the standard LangChain web-search
interface (string/dict input → list[dict] output):
from klawsearch.langchain_compat import KlawSearchResults
tool = KlawSearchResults(max_results=5, api_key="ks-live-...")
result = tool.invoke("AAPL 10-K risk factors")
# [{"url": ..., "title": ..., "content": ..., "score": ..., "raw_content": ...}, ...]
Self-hosted endpoint
client = KlawSearch(api_key="...", base_url="https://klaw.your-domain.dev")
# or set KLAWSEARCH_BASE_URL env var
Errors
from klawsearch import KlawSearch, AuthError, QuotaExceededError, RateLimitError
try:
client.search("...")
except QuotaExceededError:
... # bump plan
except RateLimitError:
... # back off
except AuthError:
... # bad key
Metadata
Release files for klawsearch 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| klawsearch-0.1.0.tar.gz | 6.3 kB | Without provenance | Details for klawsearch-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| klawsearch-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for klawsearch-0.1.0-py3-none-any.whl |
Total release size: 14.5 kB
Release files / klawsearch-0.1.0.tar.gz
| Download URL | klawsearch-0.1.0.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d4fe98575eab51ac0c6977b53365813e1ec589ad13dc98f15c1f5d483d1e7e2
|
|
BLAKE2b-256 checksum How to use checksums |
d25b67f399d5d363d5f37b6e7fffa867e56a2fde0ef63b4494871f0527b1ac6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|
Release files / klawsearch-0.1.0-py3-none-any.whl
| Download URL | klawsearch-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9d1b652940aa45c10b17fafca537c9cfd723894e2265d942dc868688cf4d4a37
|
|
BLAKE2b-256 checksum How to use checksums |
a95e4e716d9fabffc81705ee3dccb149d921866aa8ca5cf6dc47cecb7dbfbdf6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|
Security for klawsearch 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.