Skip to main content

Official Haruspex SDK. Stock intelligence scores (0-100) across 16 dimensions.

Project description

haruspex-sdk

Official Python SDK for the Haruspex API. Stock intelligence scores (0–100) across 16 dimensions, with outlook, trading signal, history, search, and news.

pip install haruspex-sdk

Python 3.9+. Built on httpx and pydantic v2. Both sync and async clients ship in the same package.

Quickstart

import os
from haruspex import Haruspex

client = Haruspex(api_key=os.environ.get("HARUSPEX_API_KEY"))

aapl = client.scores.get("AAPL")
print(f"{aapl.symbol}: {aapl.score}/100 ({aapl.outlook})")
print(f"Rate-limit remaining: {aapl.meta.rate_limit.remaining}")

Async:

import asyncio
from haruspex import AsyncHaruspex

async def main():
    async with AsyncHaruspex() as client:
        scores = await client.scores.batch(["AAPL", "NVDA", "MSFT"])
        for s in scores.scores:
            print(s.symbol, s.score, s.outlook)

asyncio.run(main())

Every response carries a .meta accessor with request_id, credits_remaining, and rate_limit, so you can observe credit/rate headroom without a separate request.

API

Haruspex(api_key=None, base_url=..., timeout=10.0, max_retries=2)

If api_key is omitted, reads HARUSPEX_API_KEY from the environment. Throws HaruspexValidationError if neither is present.

AsyncHaruspex exposes the same constructor and methods as async coroutines.

Methods

Method Returns
client.scores.get(symbol) ScoreResponse
client.scores.batch(symbols) BatchResponse
client.scores.history(symbol, from_=, to=, limit=) HistoryResponse
client.search(query, limit=) SearchResponse
client.news(symbol, limit=) NewsResponse

from_ is the keyword for the historical range start (Python keyword from is reserved).

Errors

All exceptions extend HaruspexError:

Class Trigger
HaruspexAuthError 401 / 403
HaruspexNotFoundError 404 — ticker not in the scoring universe
HaruspexRateLimitError 429 — carries retry_after_ms
HaruspexValidationError 400 / client-side bad input
HaruspexServerError 5xx
HaruspexNetworkError timeout, DNS, connection reset

Every error carries status, code, request_id, and body when available.

Retries

Retries automatically on 429, 502, 503, 504, and network errors with exponential backoff (250ms × 2^attempt, capped at 4s, with jitter). Respects Retry-After on 429. Default max_retries=2.

Authentication

Get a free API key at haruspex.guru/developers. For evaluation without signup, use the public demo key (hrspx_live_a7c52f9315a65c377fec9c30b53f266b) documented in the root README.

License

MIT. The SDK source code in this repository is MIT-licensed; the Haruspex scoring algorithm and data are proprietary and access is governed by the Haruspex API Terms of Service.

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

haruspex_sdk-0.1.1.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

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

haruspex_sdk-0.1.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for haruspex_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6d5a4959bb56f68cff20c368689615fb1daf37b22a1ced6fd5f95b7cce41ada8
MD5 c3f0f6ee0bf04b9da0d730494520ffaa
BLAKE2b-256 a01f0ca2150b8ab679d018e735039b31a207a62e7a424e003432e6c285b78933

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on Haruspex-guru/haruspex-sdk

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

File details

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

File metadata

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

File hashes

Hashes for haruspex_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3d20f3fcfcf239c6d30c2f52882ab190357c2f601145aa23984b572cd8c99db9
MD5 b4ede5e3858f180cac6ecd9aed697331
BLAKE2b-256 ac7552a16ad10aacbc7cf6616f0db9ebf3fbc773a99652c9fe102673739f3725

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on Haruspex-guru/haruspex-sdk

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