Metadata-Version: 2.4
Name: datagoat
Version: 1.3.0
Summary: Ask yesno, score, choice and rank questions about cases, answered from what happened to cases like them. Deterministic, with reasons and signed Verdicts.
License: Apache-2.0
Project-URL: Homepage, https://datagoat.io
Project-URL: Documentation, https://datagoat.io/docs/sdks
Project-URL: Support, https://datagoat.io/support
Keywords: datagoat,prediction,churn,ranking,decision,mcp,verdict,deterministic
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.3; extra == "langchain"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pydantic; extra == "test"

# datagoat

Ask typed questions about cases: `yesno`, `score`, `choice` and `rank`. Datagoat answers from what
happened to cases like them. Every answered case comes back with a chance, the columns that moved
it, and a signed Verdict. When the record can't support an answer, Datagoat refuses rather than
guess.

```bash
pip install datagoat
datagoat signup      # a free test key for the sample records
datagoat sample      # ask about sample:saas_churn and verify the answer
```

Every call sends a **record** (past cases and their outcomes), **questions**, and the **cases**
to answer:

```python
from datagoat import Client, yesno, score

dg = Client()        # DATAGOAT_API_KEY, or the key `datagoat signup` saved
out = dg.ask(
    {"churn": yesno("churned", outcome_is_desirable=False),
     "risk":  score("churned", outcome_is_desirable=False)},
    dataset_id="sample:saas_churn", entity_column="customer_id", subject_kind="org",
    cases={"ids": ["cust_0001"]},
)
a = out["answers"]["churn"]
a["state"]                 # "answered" | "refused" | "not_yet": read it first
a["cases"][0]["p"]         # 0.7005: the chance cust_0001 churns
a["cases"][0]["reasons"]   # the columns that moved it, and which way
dg.verify_all(out)         # True: every Verdict is genuine
```

Records that aren't one row per case take a shape: `events`, `series`, `panel`, `signals` or
`traces`.

At volume: `dg.ask_many(questions, cases={"ids": ids}, ...)` asks about more than 10,000 cases in
chunks on one fit and joins them in order; `export="csv"` on `ask` adds a CSV of every case
(`dg.download(out["export"]["results_url"], "results.csv")`). The client retries rate limits and
safe calls on its own.

- Docs: https://datagoat.io/docs
- SDK reference: https://datagoat.io/docs/sdks
- Quick start: https://datagoat.io/docs/quickstart
