Skip to main content

Official Python SDK for the Raily search API.

Reason this release was yanked:

wanted diffrent name

Project description

Raily Python SDK

Official Python client for the Raily search API — search your own sources from your app with a typed, one-call client.

Documentation · Source

Install

pip install raily

Quickstart

from raily import Raily

client = Raily(api_key="rly_...", endpoint="https://<your-endpoint-url>")

for hit in client.search("anti-aging serum", limit=5):
    print(hit.id, hit.score, hit.fields, hit.text)

Async

from raily import AsyncRaily

client = AsyncRaily(api_key="rly_...", endpoint="https://<your-endpoint-url>")
hits = await client.search("anti-aging serum", limit=5)

Authentication

Create an API key in your Raily workspace (Identities → API keys) and pass it as api_key. The endpoint is your endpoint's URL. A key is scoped to one workspace and to the endpoint it was issued for — using it elsewhere is rejected.

import os
client = Raily(api_key=os.environ["RAILY_API_KEY"], endpoint=os.environ["RAILY_ENDPOINT"])

Results

search() returns a list of SearchHit:

field type meaning
id str | None stable result id
score float | None relevance score
source_collection str | None the source the hit came from
fields list rendered display fields (when the source's display is configured)
text str | None rendered text
raw dict the full result dict (forward-compatible)

Errors

from raily import RailyError, RailyAuthError

try:
    client.search("query")
except RailyAuthError:
    ...  # key missing / invalid / expired / not authorized for this endpoint
except RailyError:
    ...  # everything else (network, server, protocol)

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

raily_sdk-0.1.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

raily_sdk-0.1.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file raily_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: raily_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for raily_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4b19c8457233ca64f8bc04e28315e63e8cee50e35254f324dec742cb80a0d364
MD5 c2b7d687533dc70e9c2d654c0d9aed78
BLAKE2b-256 4b673b5768c83b5bd4b5964e4b43372a571f54b039f4d55142e31bbe3cc900ed

See more details on using hashes here.

File details

Details for the file raily_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: raily_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for raily_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef6902d27510e6ae5fa2a8c5b2aa8766418029b030a46daee8cbfc03bd5a12e0
MD5 750d04fb3c2c08062a9c861356191a64
BLAKE2b-256 1d7a46f95ac20ae561a21e74ba3504bc2559c038df7a1f7a0550b496bdf372c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page