Skip to main content

Kepler Insights — Python SDK

Official Python SDK for the Kepler Insights API — curated company-scoring intelligence over a 67-signal engine.

Install

pip install kepler-insights

Requires Python 3.10+. Depends on httpx and pydantic v2.

Quickstart

from kepler_insights import Kepler

with Kepler(api_key="ki_live_...") as client:
    score = client.score("stripe.com")
    print(f"{score.domain}: {score.ki_rating} ({score.composite_score:.1f})")
    print(f"  team: {score.buckets.team_structure:.1f}")
    print(f"  market: {score.buckets.market_position:.1f}")

Sandbox keys (ki_test_...) accept only the 4 canned domains — acme.test, unicorn.test, struggling.test, cohort.test. See the Sandbox guide.

API surface

Method Endpoint Returns
client.score(domain) POST /v1/score Score
client.get_score(domain) GET /v1/score/{domain} Score
client.start_score(domain) POST /v1/score?wait=false Job (Growth+)
client.get_job(job_id) GET /v1/jobs/{job_id} JobResponse
client.history(domain, limit=, cursor=) GET /v1/score/{domain}/history HistoryPage
client.iter_history(domain, max_records=) (auto-paginates) iterator of HistoryRecord
client.cohort(domain) GET /v1/company/{domain}/cohort Cohort
client.confidence(domain) GET /v1/company/{domain}/confidence Confidence
client.distribution() GET /v1/distribution Distribution
client.movers(window) GET /v1/movers Movers
client.signals() GET /v1/signals SignalsManifest
client.usage() GET /v1/usage Usage

Async cold scoring

Cold scoring takes 30–60 seconds. On Growth and above, you can start a job and poll without holding an HTTP connection open:

job = client.start_score("stripe.com")    # returns immediately
score = job.wait(timeout=180)             # blocks until complete; raises on timeout

If the API short-circuits to a cached-fresh response (no cold work needed), start_score returns a Job already in the complete state — wait() returns instantly. This mirrors Stripe's payment_intent "no action needed" pattern.

Error handling

Every error inherits from KeplerError. Branch on the specific subclass or the stable error.code string:

from kepler_insights import (
    Kepler,
    AuthError,
    ColdBudgetExhausted,
    FreeTierSandboxOnly,
    NotFound,
    RateLimitError,
    ScoringTimeout,
)

try:
    score = client.score("stripe.com")
except FreeTierSandboxOnly:
    print("Upgrade to Starter for live scoring.")
except ColdBudgetExhausted as e:
    print(f"Monthly cap hit. Resets in {e.retry_after}s. Upgrade for more.")
except RateLimitError as e:
    print(f"Rate limited. Retry in {e.retry_after}s.")
except ScoringTimeout:
    print("Cold scoring exceeded sync budget — use start_score() for async.")
except NotFound:
    print("Never scored. Trigger one with score(domain).")
except AuthError:
    print("Invalid or revoked API key.")

The SDK auto-retries on 5xx and network errors with exponential backoff (3 attempts by default). It never retries 4xx — those are caller errors.

Configuration

client = Kepler(
    api_key="ki_live_...",
    base_url="https://api.keplerinsights.us",   # override only for testing
    timeout=70.0,                                # per-request timeout (s)
    retries=3,                                   # 5xx retry attempts
)

For custom transports (proxies, mTLS, etc.) inject your own httpx.Client:

import httpx
custom = httpx.Client(timeout=120, transport=httpx.HTTPTransport(retries=0))
client = Kepler(api_key="ki_live_...", http_client=custom)

Development

git clone <repo>
cd Ki_dev/sdk-python
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest

License

MIT. The API itself is proprietary; the SDK wrapper is MIT-licensed so you can vendor it freely.

Metadata

Release files for kepler-insights 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kepler-insights 1.1.0
File Size Uploaded Provenance Actions
kepler_insights-1.1.0.tar.gz 18.5 kB Without provenance Details for kepler_insights-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kepler-insights 1.1.0
File Interpreter ABI Platform Actions
kepler_insights-1.1.0-py3-none-any.whl Python 3 none any Details for kepler_insights-1.1.0-py3-none-any.whl

Total release size: 32.7 kB

Release files / kepler_insights-1.1.0.tar.gz

Download URL kepler_insights-1.1.0.tar.gz
Size 18.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0de7d4b4f8d464c8fd7d3c93e196cbeaee9bd629244c63c25c45e623c4529485
BLAKE2b-256 checksum
How to use checksums
c803e4c01e63d92b724005135c889f6fcf76cda57a98381b2f81657e7df21a84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / kepler_insights-1.1.0-py3-none-any.whl

Download URL kepler_insights-1.1.0-py3-none-any.whl
Size 14.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e67d6250a068645bbaa27746ea57fb090ccd43607aa8a54d3229aeccc5363d3f
BLAKE2b-256 checksum
How to use checksums
54a0dc8f318272034ad62769cef9d19430f900ad2b0899632fecf612ac9727c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Security for kepler-insights 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page