Skip to main content

Python SDK for Rairos API

Project description

Rairos Python SDK

PyPI version Python versions License

Python SDK for the Rairos API platform.

Installation

# From PyPI (coming soon)
pip install rairos

# From source
cd sdks/python && pip install -e . && cd ../..

Quick Start

from rairos import RairosClient

# Initialize client
client = RairosClient(api_key="your_api_key_here")

# Search papers
results = client.search_papers(query="machine learning", page=1, per_page=20)
print(results)

# Detect research gaps (requires Pro tier)
gaps = client.detect_gap(query="neural network architecture")
print(gaps)

# Get usage statistics
usage = client.get_usage()
print(usage)

Authentication

You can provide your API key in three ways:

  1. Environment variable (recommended):

    export RAIROS_API_KEY=your_api_key_here
    
  2. Constructor parameter:

    client = RairosClient(api_key="your_api_key_here")
    
  3. Register/Login to get a new API key:

    # Register
    auth = client.register(email="user@example.com", password="secure_password")
    
    # Login
    auth = client.login(email="user@example.com", password="secure_password")
    print(auth["api_key"])  # Use this key
    

API Reference

Papers

# Search papers
results = client.search_papers(query="quantum computing")

# Get specific paper
paper = client.get_paper(paper_id="uuid-here")

Gap Detection (Pro tier)

# Detect research gaps
gaps = client.detect_gap(
    query="What are the gaps in transformer architecture research?",
    categories=["cs.AI", "cs.LG"]
)

Research (Team tier)

# Run automated research
results = client.run_research(
    query="Analyze the state of AI safety research in 2025"
)

Subscriptions

# Get available tiers
tiers = client.get_tiers()

# Create checkout session
checkout = client.create_checkout(
    price_id="price_pro_monthly",
    success_url="https://yourapp.com/success",
    cancel_url="https://yourapp.com/pricing"
)
print(checkout["checkout_url"])  # Redirect user to this URL

# Get subscription status
status = client.get_subscription_status()

Error Handling

from rairos import (
    RairosClient,
    RairosError,
    AuthenticationError,
    RateLimitError
)

try:
    client = RairosClient(api_key="invalid_key")
    results = client.search_papers(query="test")
except AuthenticationError:
    print("Invalid API key")
except RateLimitError:
    print("Rate limit exceeded - wait and retry")
except RairosError as e:
    print(f"API error: {e.message}")

License

MIT License

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

rairos-0.2.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

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

rairos-0.2.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file rairos-0.2.0.tar.gz.

File metadata

  • Download URL: rairos-0.2.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for rairos-0.2.0.tar.gz
Algorithm Hash digest
SHA256 efa0af5a01e9614637b5ed1c1a8b10c28783daeb39764dfb4871fa311868d789
MD5 1a25ba9e20e7c3e2b061dc276935942d
BLAKE2b-256 6477884ae566ee086b7cea6a39b07e858c510a9e50ee22aedaecbb5b5f00b72d

See more details on using hashes here.

File details

Details for the file rairos-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: rairos-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for rairos-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 908a542324f9687a7cc70774dd5266a3d3e38b8c53af07facad89ab4d8c8e35d
MD5 1d9e1fa245226d8eb482a29e227a971d
BLAKE2b-256 70ced80412eb8aa690486b2c9cb249cc39f8deb9fc45c2fc9de7937848b77ba3

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