Metadata-Version: 2.4
Name: pawpado
Version: 0.1.0
Summary: Official Python SDK for Pawpado — single-user AWS GPU gaming portal. Sessions (start/stop/poll/pair/connect), credits, billing, settings, admin. Bearer auth via Huudis OIDC device flow.
Project-URL: Homepage, https://pawpado.com
Project-URL: Source, https://github.com/hachimi-cat/saas-pawpado/tree/main/sdk/python
Project-URL: Issues, https://github.com/hachimi-cat/saas-pawpado/issues
Author-email: Forjio <hello@pawpado.com>
License: MIT
Keywords: aws,forjio,gaming,gpu,huudis,pawpado
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: httpx>=0.27.0
Requires-Dist: pyjwt[crypto]>=2.9.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Description-Content-Type: text/markdown

# pawpado (Python)

Official Python SDK for [Pawpado](https://pawpado.com) — the single-user AWS
GPU gaming portal. Mirrors the Node SDK (`@forjio/pawpado-node`) 1:1.

## Install

```bash
pip install pawpado
```

## Quickstart

### Static API key (simplest)

```python
from pawpado import PawpadoClient

with PawpadoClient(api_key="...") as client:
    print(client.health())               # public, no auth
    print(client.sessions.poll())        # GET /api/v1/sessions/poll
    print(client.sessions.start())       # POST /api/v1/sessions/start
    print(client.credits.me())
    client.sessions.stop({"force": True})
```

### Huudis OIDC device flow (CLI-style)

```python
from pawpado import PawpadoClient, Session

session = Session(brand="pawpado", profile="default")
session.load()  # reads ~/.pawpado/credentials

with PawpadoClient(session=session) as client:
    print(client.account.session())
```

The ``Session`` refresh path is single-flight — concurrent callers share the
same refresh and avoid burning the Huudis refresh-token family (Huudis revokes
the entire family on reuse).

## Surface

| Namespace | Methods |
|---|---|
| ``sessions`` | ``start`` / ``stop`` / ``poll`` / ``pair`` / ``connect`` / ``tailscale_key`` |
| ``credits`` | ``me`` / ``topup`` |
| ``billing`` | ``storage`` |
| ``settings`` | ``get`` / ``update`` |
| ``account`` | ``session`` / ``delete`` |
| ``admin`` | ``reconcile`` / ``orphans`` |
| ``health()`` | top-level, no auth |

Every method takes an optional ``auth_token=`` to override the client-level
bearer for one call.

## Errors

- ``PawpadoError`` (alias: ``ApiError``) — enveloped API errors, carries
  ``.code``, ``.message``, ``.status``, ``.request_id``, ``.details``.
- ``PawpadoAuthError`` — credentials / session lookup failures.
- ``RefreshError`` — OIDC refresh failure.
- ``NetworkError`` — transport failure (DNS, TLS, etc.).

## License

MIT
