Metadata-Version: 2.4
Name: pyjev
Version: 0.1.0
Summary: Reusable, confidence-aware Jev decisions for Python and the shell.
Author: holgern
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/ledgerwerk/pyjev
Project-URL: Repository, https://github.com/ledgerwerk/pyjev
Project-URL: Issues, https://github.com/ledgerwerk/pyjev/issues
Project-URL: TypeSafe Jev Documentation, https://docs.typesafe.ai/
Keywords: jev,typesafe,ai,decision,cli
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typesafe-sdk<1,>=0.7.0
Requires-Dist: typer<1,>=0.16
Requires-Dist: keyring<26,>=25
Requires-Dist: tomli>=2; python_version < "3.11"
Provides-Extra: dev
Requires-Dist: pytest<10,>=9; extra == "dev"
Requires-Dist: ruff<1,>=0.16; extra == "dev"
Requires-Dist: build<2,>=1; extra == "dev"
Requires-Dist: twine<7,>=6; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx<9,>=7; extra == "docs"
Requires-Dist: myst-parser<5,>=2; extra == "docs"
Requires-Dist: sphinx-rtd-theme<4,>=2; extra == "docs"
Dynamic: license-file

[![PyPI - Version](https://img.shields.io/pypi/v/pyjev)](https://pypi.org/project/pyjev/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyjev)
![PyPI - Downloads](https://img.shields.io/pypi/dm/pyjev)
[![codecov](https://codecov.io/gh/ledgerwerk/pyjev/graph/badge.svg?token=34W6LDpSJB)](https://codecov.io/gh/ledgerwerk/pyjev)

# pyjev

**Confidence-aware Jev decisions for Python, shell, CI, and automation.**

`pyjev` is a thin operational layer over TypeSafe's official `typesafe-sdk`. It
preserves Jev probabilities, confidence, and response metadata while adding
reusable named decisions, shell-safe output, credential ergonomics, local
validation, request inspection, and confidence gates.

## Install

```bash
pip install pyjev
# or: uv tool install pyjev
```

For a development checkout:

```bash
pip install -e '.[dev,docs]'
```

## A first decision

```bash
pyjev choice "Where should this ticket go?" \
  --state "Stripe checkout fails" \
  --option billing="Payments and refunds" \
  --option engineering="Technical failures" \
  --option sales="Purchasing questions" \
  --json
```

```python
from pyjev import Jev

with Jev() as jev:
    result = jev.choice(
        "Where should this ticket go?",
        state="Stripe checkout fails",
        choices={"billing": "Payments", "engineering": "Technical", "sales": "Purchasing"},
    )
print(result.value, result.confidence, result.probabilities)
```

## What pyjev adds

- direct Noul, Choice, and Score operations with uncertainty preserved;
- reusable `.pyjev.toml` decisions and mixed-question bundles;
- offline validation and request compilation;
- confidence-gated shell automation and stable exit codes;
- keyring, environment, and explicit plaintext-file credential support;
- request IDs, usage, raw metadata, and structured JSON for debugging.

The official `typesafe-sdk` remains responsible for transport, retries, API
models, authentication at the HTTP layer, and API error semantics. pyjev does
not invent probabilities or confidence calculations.

## Learn more

- [Full documentation](docs/index.md)
- [Runnable examples](examples/README.md)
- [TypeSafe Jev documentation](https://docs.typesafe.ai/)
- [Issues](https://github.com/ledgerwerk/pyjev/issues)

## License

Apache-2.0
