Metadata-Version: 2.4
Name: cat-session-sdk
Version: 1.2.1
Summary: Python SDK for CAT Session behavioral security API
License: MIT
Project-URL: Homepage, https://session.artrofimov.xyz
Project-URL: Repository, https://gitlab.com/cat-platform/session-sdk.git
Keywords: security,session,anomaly-detection,behavioral-analytics
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# cat-session-sdk

Python SDK for [CAT Session](https://session.artrofimov.xyz) — behavioral
session security with no ML, no training data required.

## Install

```bash
pip install cat-session-sdk
```

## Quick start

```python
from cat_session_sdk import CATClient

cat = CATClient(api_key="your_key")  # get key at session.artrofimov.xyz

# Score events as they happen
score = cat.score(
    entity_id="user_123",
    endpoint="/api/payment",
    status_code=200,
)

if score and score.alert:
    print(f"Alert: {score.which_channel}")
    # "behavioral drift detected" or "population deviation detected"
```

## Plug in your logs

```python
from cat_session_sdk import CATClient
from cat_session_sdk.adapters.okta import stream_okta_log

cat = CATClient(api_key="your_key")

for event in stream_okta_log("okta_system_log.json"):
    score = cat.score_event(event)
    if score and score.alert:
        print(f"{event.entity_id}: {score.which_channel}")
```

## One-command evaluation

```bash
pip install cat-session-sdk[cli]
cat-session-evaluate your_logs.json --format okta --top 20 --html report.html
```

## API key

Get a free key (100k events/month) at https://session.artrofimov.xyz
# cat-session-sdk

Small Python SDK for interacting with `cat-session-api`.

Example

```python
from cat_session_sdk import Client

c = Client(base_url='http://localhost:8000')
resp = c.ingest('alice', {'endpoint':'/api/test','status_code':200,'method':'GET'})
print(resp)
```
cat-session-sdk

Minimal SDK for interacting with the CAT Session API.

Install locally for testing:

```bash
pip install -e cat-session-sdk
```

Example:

```python
from cat_session_sdk import CATClient
c = CATClient("http://127.0.0.1:8001")
print(c.get_score("demo:normal"))
```
