Skip to main content

Python SDK for RoxyAPI. Astrology, tarot, numerology, and more.

Project description

roxy-sdk

PyPI Python Docs API Reference License

Python SDK for RoxyAPI. Astrology, tarot, numerology, I Ching, crystals, angel numbers, dream interpretation, biorhythm, and more. One API key, 11 domains, 120+ endpoints.

Install

pip install roxy-sdk

Quickstart

from roxy_sdk import create_roxy

roxy = create_roxy("your-api-key")
horoscope = roxy.astrology.get_daily_horoscope(sign="aries")
print(horoscope)

Get your API key at roxyapi.com/pricing. Free test keys available on the interactive docs.

Recipes

Dating app: zodiac compatibility

person1 = {"date": "1990-01-15", "time": "14:30:00", "latitude": 28.61, "longitude": 77.20}
person2 = {"date": "1992-07-22", "time": "09:00:00", "latitude": 19.07, "longitude": 72.87}

score = roxy.astrology.calculate_compatibility(person1=person1, person2=person2)
print(f"Compatibility: {score}")

Wellness app: daily tarot card

card = roxy.tarot.get_daily_card()
print(f"Today: {card}")

Journaling app: dream interpretation

symbol = roxy.dreams.get_dream_symbol(id="flying")
print(f"Flying in dreams: {symbol}")

Numerology calculator: life path number

result = roxy.numerology.calculate_life_path(year=1990, month=1, day=15)
print(f"Life Path: {result}")

chart = roxy.numerology.generate_numerology_chart(full_name="Jane Smith", year=1990, month=1, day=15)
print(f"Full chart: {chart}")

Crystal healing: zodiac crystals

crystals = roxy.crystals.get_crystals_by_zodiac(sign="scorpio")
print(f"Scorpio crystals: {crystals}")

I Ching: daily reading

reading = roxy.iching.cast_daily_reading()
print(f"I Ching: {reading}")

Domain reference

Domain Property What it covers
Western Astrology roxy.astrology Natal charts, horoscopes, synastry, compatibility, transits, moon phases
Vedic Astrology roxy.vedic_astrology Birth charts, dashas, nakshatras, panchang, KP system, doshas, yogas
Tarot roxy.tarot Spreads, daily pulls, yes/no oracle, Celtic Cross, custom layouts
Numerology roxy.numerology Life path, expression, soul urge, personal year, karmic analysis
I Ching roxy.iching Hexagrams, trigrams, coin casting, daily readings
Crystals roxy.crystals Healing properties, zodiac/chakra pairings, birthstones, search
Angel Numbers roxy.angel_numbers Number meanings, pattern analysis, daily guidance
Dreams roxy.dreams Symbol dictionary, interpretations, daily guidance
Biorhythm roxy.biorhythm Physical, emotional, intellectual cycles, forecasts, compatibility
Location roxy.location City geocoding for birth chart coordinates
Usage roxy.usage API usage stats and subscription info

Async support

Every method has an _async suffix variant for use with asyncio:

import asyncio
from roxy_sdk import create_roxy

async def main():
    roxy = create_roxy("your-api-key")
    horoscope = await roxy.astrology.get_daily_horoscope_async(sign="aries")
    card = await roxy.tarot.get_daily_card_async()
    print(horoscope, card)

asyncio.run(main())

Framework examples

The SDK is framework-agnostic. It works with Django, Flask, FastAPI, or any Python project.

FastAPI

from fastapi import FastAPI
from roxy_sdk import create_roxy

app = FastAPI()
roxy = create_roxy("your-api-key")

@app.get("/horoscope/{sign}")
async def horoscope(sign: str):
    return await roxy.astrology.get_daily_horoscope_async(sign=sign)

Flask

from flask import Flask, jsonify
from roxy_sdk import create_roxy

app = Flask(__name__)
roxy = create_roxy("your-api-key")

@app.route("/horoscope/<sign>")
def horoscope(sign):
    return jsonify(roxy.astrology.get_daily_horoscope(sign=sign))

Django (views.py)

from django.http import JsonResponse
from roxy_sdk import create_roxy

roxy = create_roxy("your-api-key")

def horoscope(request, sign):
    return JsonResponse(roxy.astrology.get_daily_horoscope(sign=sign))

Error handling

All API errors raise RoxyAPIError with error (human-readable message), code (machine-readable, stable), and status_code attributes:

from roxy_sdk import create_roxy, RoxyAPIError

roxy = create_roxy("your-api-key")

try:
    result = roxy.astrology.get_daily_horoscope(sign="invalid")
except RoxyAPIError as e:
    print(f"Error: {e.error}")
    print(f"Code: {e.code}")
    print(f"Status: {e.status_code}")

Error codes:

Status Code When
400 validation_error Missing or invalid parameters
401 api_key_required No API key provided
401 invalid_api_key Key format invalid or tampered
429 rate_limit_exceeded Monthly quota reached
404 not_found Resource not found
500 internal_error Server error

Environment variable

Store your API key in an environment variable for production use:

import os
from roxy_sdk import create_roxy

roxy = create_roxy(os.environ["ROXY_API_KEY"])

Configuration

create_roxy accepts optional parameters for advanced usage:

roxy = create_roxy(
    api_key="your-api-key",
    base_url="https://roxyapi.com/api/v2",  # default, override for local development
    timeout=30.0,                            # request timeout in seconds (default: 30)
)

The client reuses HTTP connections for performance. For explicit cleanup, use the context manager:

with create_roxy("your-api-key") as roxy:
    horoscope = roxy.astrology.get_daily_horoscope(sign="aries")
# connections closed automatically

Links

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

roxy_sdk-0.1.1.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

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

roxy_sdk-0.1.1-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file roxy_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: roxy_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for roxy_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 131ceae74db5cbfb095ed2c3d8befeb8877d70205ebd163205e80bb3ddb9a574
MD5 8555803d6e8e5469e15136044200bbd0
BLAKE2b-256 546a7cddbc2e1a65d693f0e17435714334d39e0d6633f115329a0ce084ccb888

See more details on using hashes here.

Provenance

The following attestation bundles were made for roxy_sdk-0.1.1.tar.gz:

Publisher: release.yml on RoxyAPI/sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file roxy_sdk-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: roxy_sdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for roxy_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eee2f015d8fb9c64d934e0cab57d3c61006258f8512627b2c5d487cac47fd951
MD5 e84e2bea257b6c300235f2f473b1f08e
BLAKE2b-256 4bc267ff6541829969214a4ec46721422a7b7dcfa31bd9246e4712efc3d674a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for roxy_sdk-0.1.1-py3-none-any.whl:

Publisher: release.yml on RoxyAPI/sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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