Official Python SDK for ARASE - AI-powered search engine API
Project description
ARASE Python SDK
المكتبة الرسمية لـ ARASE - محرك البحث الذكي بالذكاء الاصطناعي.
Official Python SDK for ARASE - AI-powered search engine API.
Installation | التثبيت
pip install arase-sdk
Quick Start | البداية السريعة
Option 1: Environment Variable (Recommended) | الخيار 1: متغير البيئة (مستحسن)
# .env file | ملف .env
ARASE_API_KEY=arase_YOUR_API_KEY
from arase import AraseClient
# Automatically reads from ARASE_API_KEY environment variable
# يقرأ تلقائياً من متغير البيئة ARASE_API_KEY
client = AraseClient()
results = client.search("ما هي رؤية السعودية 2030؟")
print(results.answer)
Option 2: Direct API Key | الخيار 2: مفتاح API مباشر
from arase import AraseClient
client = AraseClient(api_key="arase_YOUR_API_KEY")
results = client.search("What is Saudi Vision 2030?")
print(results.answer)
Environment Variables | متغيرات البيئة
| Variable | Description | الوصف |
|---|---|---|
ARASE_API_KEY |
Your API key (required) | مفتاح API الخاص بك (مطلوب) |
ARASE_BASE_URL |
Custom API URL (optional) | رابط API مخصص (اختياري) |
Features | الميزات
Web Search | بحث الويب
results = client.search("أفضل المطاعم في الرياض", include_answer=True)
print(results.answer) # AI-generated answer | إجابة AI
print(results.results) # Web results | نتائج الويب
Image Search | بحث الصور
results = client.search_images("برج المملكة الرياض")
for image in results.images:
print(image.image_url)
News Search | بحث الأخبار
results = client.search_news("أخبار السعودية اليوم")
for article in results.news:
print(f"{article.title} - {article.source}")
Places Search | بحث الأماكن
# Search near Riyadh | البحث قرب الرياض
results = client.search_places(
"مقاهي قريبة",
user_location={"lat": 24.7136, "lng": 46.6753}
)
for place in results.places:
print(f"{place.title} - {place.rating}⭐")
Academic Search | بحث أكاديمي
results = client.search_scholar("artificial intelligence")
for paper in results.scholar:
print(f"{paper.title} ({paper.year}) - {paper.citations} citations")
Content Extraction | استخراج المحتوى
content = client.extract(
"https://example.com/article",
include_summary=True
)
print(content.content)
print(content.summary)
Advanced Options | خيارات متقدمة
from arase import AraseClient, SearchOptions
client = AraseClient()
# Using SearchOptions | استخدام SearchOptions
options = SearchOptions(
search_depth="deep", # basic | advanced | deep
max_results=20,
include_answer=True,
include_images=True,
include_videos=True,
include_news=True,
include_places=True,
include_shopping=True,
include_scholar=True,
topic="general", # general | news | academic
max_steps=3, # For deep search | للبحث العميق
)
results = client.search("query", options=options)
# Or use keyword arguments | أو استخدم الكلمات المفتاحية
results = client.search(
"query",
include_answer=True,
max_results=10,
)
Async Support | دعم Async
import asyncio
from arase import AsyncAraseClient
async def main():
async with AsyncAraseClient() as client:
results = await client.search("query", include_answer=True)
print(results.answer)
asyncio.run(main())
Error Handling | معالجة الأخطاء
from arase import AraseClient, AraseAPIError
client = AraseClient()
try:
results = client.search("query")
except AraseAPIError as e:
print(f"Error {e.code}: {e.message}")
print(f"Status: {e.status}")
Context Manager | مدير السياق
from arase import AraseClient
# Automatically closes connection | يغلق الاتصال تلقائياً
with AraseClient() as client:
results = client.search("query")
print(results.answer)
Type Hints | تلميحات الأنواع
Full type hints support for better IDE experience:
from arase import (
AraseClient,
SearchOptions,
SearchResponse,
SearchResult,
ImageResult,
# ... etc
)
Links | روابط
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
arase_sdk-1.2.1.tar.gz
(11.3 kB
view details)
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
arase_sdk-1.2.1-py3-none-any.whl
(12.6 kB
view details)
File details
Details for the file arase_sdk-1.2.1.tar.gz.
File metadata
- Download URL: arase_sdk-1.2.1.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e2513fceaf27aeadb40ecd25debb642dacf69a5a6568015d8b5acba25e21e18
|
|
| MD5 |
329529561f64893916487551f69a19b7
|
|
| BLAKE2b-256 |
b23d6aa5f2820fc95bb12040f4eb516a478af8e5862965e444403fb8829b739a
|
File details
Details for the file arase_sdk-1.2.1-py3-none-any.whl.
File metadata
- Download URL: arase_sdk-1.2.1-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06eb9dc281d0e7efe34e6e5eeb846dc3d97c763714acbc348da29c92305f96e4
|
|
| MD5 |
5a9e7c742ef5804d61c3c9a94921101c
|
|
| BLAKE2b-256 |
21da4f5b96637bb03427d760b13535629f90b7cb0b662ad1fa088bbafd991128
|