Skip to main content

Python SDK for llama-search.com API

Project description

llama-search Python SDK

A Python client library for the llama-search.com API.

Installation

pip install llama-search

Quick Start

from llama_search import LlamaSearchClient

# Initialize the client with your API key
client = LlamaSearchClient(api_key="your-api-key-here")

# Perform a search
results = client.search("python programming")
print(results)

# Check API status
status = client.get_status()
print(status)

Authentication

You'll need an API key from llama-search.com. Sign up for an account and generate your API key from the dashboard.

API Reference

LlamaSearchClient

The main client class for interacting with the llama-search API.

__init__(api_key, base_url="https://api.llama-search.com")

Initialize the client with your API key.

  • api_key (str): Your API key from llama-search.com
  • base_url (str, optional): Base URL for the API

search(query, limit=10, **kwargs)

Perform a search query.

  • query (str): Search query string
  • limit (int): Maximum number of results to return (default: 10)
  • **kwargs: Additional search parameters

Returns a dictionary containing search results.

get_status()

Get API status and health check information.

Error Handling

The SDK includes custom exceptions:

  • LlamaSearchError: Base exception for all SDK errors
  • APIError: Raised for API-related errors
  • AuthenticationError: Raised for authentication failures
from llama_search import LlamaSearchClient, AuthenticationError, APIError

try:
    client = LlamaSearchClient(api_key="invalid-key")
    results = client.search("test query")
except AuthenticationError:
    print("Invalid API key")
except APIError as e:
    print(f"API error: {e}")

Development

See instructions.md for development setup and contribution guidelines.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

llama_search-0.1.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

llama_search-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llama_search-0.1.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for llama_search-0.1.0.tar.gz
Algorithm Hash digest
SHA256 25a75ced8015cc245303d9e8ff32e33affd8dae688cd1bdc89eec4d20a1242d2
MD5 1cdcc1afb61a4b7116aaa22ee1c70de6
BLAKE2b-256 bc1208877e8536519156e721ad6e480cf395177300e75b2b29b3ceaa7fb31988

See more details on using hashes here.

File details

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

File metadata

  • Download URL: llama_search-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for llama_search-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 374b659803dddcd5f13077d42c801eb818505a3cf686d54dfd6bbbd6ff32d2b4
MD5 f9d78b7cc00c22919ab84e7aaad00ee5
BLAKE2b-256 1db2122f07d39c5e8010ec1cb0972e96f5fcca94a9499ffbdfe06ff1f614f1de

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