Querit Python SDK
Project description
Querit Content Retrieval Platform — Python SDK
The Querit Python SDK provides a convenient way to interact with the Querit Content Retrieval Platform. It offers:
- Simple search interface for content retrieval
- Type-annotated request/response models
- Error handling for API responses
- Support for various search parameters and filters
For the Querit Content Retrieval Platform, we provide a Python SDK (Querit SDK) that allows developers to easily integrate and use Querit's content search capabilities programmatically.
Installation
Requirements
- Python 3.7+
- pip package manager
Install from PyPI
pip install querit
Install from source
git clone https://github.com/querit-ai/querit-python.git
pip install -e .
Verify Installation
python3 -c "import querit; print(querit.__version__)"
Quick Start
Authentication
First, obtain your API key from the Querit platform.
Basic Usage
from querit import QueritClient
from querit.models.request import SearchRequest
from querit.errors import QueritError
# Initialize client
client = QueritClient(
api_key="Bearer your_api_key_here",
timeout=30 # Optional timeout in seconds
)
# Create search request
request = SearchRequest(
query="chat",
count=5,
# Add more parameters as needed
)
try:
# Execute search
response = client.search(request)
# Process results
for item in response.results:
print(f"Title: {item.title}")
print(f"URL: {item.url}")
print("-" * 50)
except QueritError as e:
print(f"Search failed: {e}")
## Advanced Usage
### Customizing Search Requests
```python
from querit.models.request import SearchRequest
# Advanced search with filters
request = SearchRequest(
query="machine learning",
count=10,
filters={
"language": "english",
"date_range": "d1"
}
)
Error Handling
The SDK provides specific error classes:
QueritAPIError: API request failuresQueritAuthError: Authentication failuresQueritValidationError: Invalid request parameters
Best Practices
- Reuse client instances rather than creating new ones for each request
- Set appropriate timeout values for your use case
- Handle rate limiting by implementing retry logic
- Cache frequently used search results when possible
For more examples, see the examples/ directory in this repository.
Contact
If you experience any problems while using Querit, please feel free to reach out to us at support@querit.ai. Our team is ready to assist you.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file querit-0.1.2.tar.gz.
File metadata
- Download URL: querit-0.1.2.tar.gz
- Upload date:
- Size: 18.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4df722dfc2158846be076e9e98545cfef0f222ecdd97018b3c0ad0a44e91ab43
|
|
| MD5 |
636b6ede484be130cf17752b67f56d2d
|
|
| BLAKE2b-256 |
0074537cc767caaf69c2d7a98ea27f331d225ddbf91d6328f96b01f847b76701
|
File details
Details for the file querit-0.1.2-py3-none-any.whl.
File metadata
- Download URL: querit-0.1.2-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf0f713f967e82d23d95ab43f3d360572f4a68c6d4e3c0d970d23c347afd4a1d
|
|
| MD5 |
7a1e5e3e2d72d822481983c3fc1068bf
|
|
| BLAKE2b-256 |
27b8f1387956507bbc35675d2382599d2b007db770a94cb09d1443bb9bde4ba6
|