Metadata-Version: 2.4
Name: probview
Version: 0.1.1
Summary: Python client for the ProbView Lab API.
Project-URL: Homepage, https://probview.com
Project-URL: Documentation, https://probview.com/docs
Project-URL: Repository, https://github.com/probview/probview-python
Project-URL: Issues, https://github.com/probview/probview-python/issues
Author-email: ProbView <support@probview.com>
License: MIT
License-File: LICENSE
Keywords: api,finance,options,probview,trading,volatility
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Requires-Dist: requests>=2.25.0
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: responses>=0.23; extra == 'dev'
Requires-Dist: twine; extra == 'dev'
Description-Content-Type: text/markdown

# probview

Python client for the [ProbView](https://probview.com) Lab API (v1).

## Installation

```bash
pip install probview
```

## Quick start

```python
from probview import ProbViewClient, SrDirectory, DipStrategy

client = ProbViewClient(api_key="YOUR_API_KEY")

# Preview a directory for a single date
rows = client.preview(
    directory=SrDirectory.OPT_IV_GREEKS,
    date="2025-09-15",
    rows=100,
)

# Pull selected columns over a date range
data = client.select_data(
    directory=SrDirectory.OPT_IV_GREEKS,
    dates=["2025-09-15", "2025-09-16"],
    columns="*",
    rows=500,
)

# Run a SQL-style live query
live = client.get_live_data(
    query="* from srlive.msgOptionNbboQuote where okey_tk = 'SPXW' limit 10",
)

# Compute DIP moments
dip = client.get_dip(
    ticker="SPXW",
    call_put="C",
    trade_date_from="2025-03-03T00:00:00",
    trade_date_to="2025-04-06T00:00:00",
    expiration_from="2025-06-13T00:00:00",
    expiration_to="2025-06-13T00:00:00",
    interval=1,
    strategy=DipStrategy.Historical,
    limit=1000,
)
```

The client can also be used as a context manager so the underlying HTTP session
is closed cleanly:

```python
with ProbViewClient(api_key="YOUR_API_KEY") as client:
    result = client.preview(date="2025-09-15", directory=SrDirectory.OPT_IV_GREEKS)
```

## Supported endpoints

| Method | Path | Client method |
|--------|------|---------------|
| GET    | `/api/v1/Lab/Preview`           | `preview()` |
| GET    | `/api/v1/Lab/SelectData`        | `select_data()` |
| GET    | `/api/v1/Lab/GetLiveData`       | `get_live_data()` |
| POST   | `/api/v1/Lab/GetDip`            | `get_dip()` |
| GET    | `/api/v1/Lab/GetSpecificMoment` | `get_specific_moment()` |
| GET    | `/api/v1/Lab/GetLastDipLive`    | `get_last_dip_live()` |
| POST   | `/api/v1/Lab/CallLab`           | `call_lab()` |

## Error handling

All non-2xx responses raise `ProbViewAPIError`, which carries the HTTP status
code, the response body, and the original `requests.Response` object.

```python
from probview import ProbViewClient, ProbViewAPIError

try:
    client.preview(date="2025-09-15")
except ProbViewAPIError as e:
    print(e.status_code, e.message)
```

## Configuration

```python
client = ProbViewClient(
    api_key="YOUR_API_KEY",
    base_url="https://probview.com",   # override for staging
    language="en",                     # "en" | "es"
    timeout=30.0,                      # per-request seconds
)
```

## License

MIT
