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.2.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.2-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: haruspex_sdk-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 f6d09ce5837596aaa51d0905e9282dc5ad264e6e152e55f29c8dee0b40584704
MD5 d5c8c8d87109647c83ee8c41e0d095c9
BLAKE2b-256 95c072dc3e641d6f5ee86ba0c1c16d3608b638a45fdc7f42ddf628a913d669f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for haruspex_sdk-0.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: haruspex_sdk-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5267f22ccb9850d1ff24bccdc333f5cea0e5c57f12ea69def6072a419cac66cb
MD5 a953cf00300e9598b1594d77c09c6e69
BLAKE2b-256 2363ab928d997b379e98c7ddcb37920eddd44679271a25427b9a21b7c163f16a

See more details on using hashes here.

Provenance

The following attestation bundles were made for haruspex_sdk-0.1.2-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