cloudsearch

raw JSON →
0.0.12 verified Fri May 01 auth: no python

A Python SDK for Amazon CloudSearch. Provides a simple interface to search, upload, and manage documents in an AWS CloudSearch domain. Version 0.0.12, with no recent release.

pip install cloudsearch
error ModuleNotFoundError: No module named 'cloudsearch'
cause Package not installed or typo in pip install.
fix
Run 'pip install cloudsearch' and verify spelling.
error AttributeError: module 'cloudsearch' has no attribute 'CloudSearch'
cause Using 'import cloudsearch' then trying 'cloudsearch.CloudSearch()' incorrectly.
fix
Use 'from cloudsearch import CloudSearch'.
gotcha The library does not support IAM roles or STS tokens directly; you must pass literal key/secret. Not suitable for EC2 instance profiles.
fix Use boto3 directly for role-based auth, or implement your own credential chain.
deprecated AWS CloudSearch is not actively developed by AWS; consider using OpenSearch or Elasticsearch for new projects.
fix Migrate to Amazon OpenSearch Service or a self-managed solution.

Initialize CloudSearch client and perform a basic search.

import os
from cloudsearch import CloudSearch

client = CloudSearch(
    domain_name=os.environ.get('CLOUDSEARCH_DOMAIN', 'example-domain'),
    region=os.environ.get('CLOUDSEARCH_REGION', 'us-east-1'),
    access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', ''),
    secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', '')
)
result = client.search(q='test')
print(result)