Metadata-Version: 2.4
Name: prismioai
Version: 0.1.0a1
Summary: Official Python SDK for Prism IO - the Brand Identity Operating System for the AI era
Project-URL: Homepage, https://prismio.ai
Project-URL: Documentation, https://developers.prismio.ai
Project-URL: Repository, https://github.com/poptechstudio/prismio
Project-URL: Issues, https://github.com/poptechstudio/prismio/issues
Author-email: Prism IO <hi@prismio.ai>
License: MIT License
        
        Copyright (c) 2026 Prism IO (Pop Tech Studio LLC)
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: ai,bim,brand-governance,compliance,llm,prismio
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
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: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx<1.0,>=0.27.0
Requires-Dist: pydantic<3.0,>=2.5
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Requires-Dist: twine>=5.0; extra == 'dev'
Description-Content-Type: text/markdown

# prismio

[![PyPI version](https://img.shields.io/pypi/v/prismio.svg)](https://pypi.org/project/prismio/)
[![Python versions](https://img.shields.io/pypi/pyversions/prismio.svg)](https://pypi.org/project/prismio/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

Official Python SDK for **Prism IO** - the Brand Identity Operating System for the AI era.

Prism IO is the system of record for brand logic and governance. The platform exposes a stable HTTP API at `https://api.prismio.ai/api/v1/` for programmatic access to your Brand Identity Model, capability profile, multi-tenant organization scope, and governance hooks. This SDK is the Python client.

## Status

Alpha. The current release (`0.1.0a1`) covers a focused 15-endpoint subset of the public API surface. Full surface ships in `0.1.0` stable after the 5-BIM validation harness completes.

The SDK targets `/api/v1/*` exclusively. Legacy `/api/` paths are not used; they are scheduled for removal on 2027-05-22 per the [public deprecation policy](https://developers.prismio.ai/api/deprecation-policy).

## Installation

```bash
pip install prismioai==0.1.0a1
# or, when stable lands:
pip install prismioai
```

Note: the **distribution name on PyPI is `prismioai`** (the defensive namespace claimed 2026-05-20) but the **import name is `prismio`** (cleaner ergonomics in code). This dual-name convention follows `python-dotenv` / `opencv-python` and many others:

```python
import prismio                       # import name
# ...installed via...
# pip install prismioai              # distribution name
```

Python 3.10+. Dependencies: `httpx` and `pydantic` (v2).

## Authentication

Issue an API key at `https://prismio.ai/my-account/api-keys/`. Keys begin with `pio_`.

```python
from prismio import PrismIO

client = PrismIO(api_key="pio_xxxxxxxxxxxxxxxx")
```

Or via environment variable:

```bash
export PRISMIO_API_KEY=pio_xxxxxxxxxxxxxxxx
```

```python
from prismio import PrismIO
client = PrismIO()  # picks up PRISMIO_API_KEY from env
```

## Quickstart

```python
from prismio import PrismIO

client = PrismIO(api_key="pio_...")

# Your tier-gated capabilities
caps = client.capabilities.get()
print(caps.tier_slug)                       # "enterprise"
print(caps.tier_limits.bim_max_models)      # 50
print(caps.features)                        # {"mcp_server_access": True, ...}

# Your Organization (Phase 2A multi-tenant)
org = client.orgs.me()
print(org.name, org.subscription_tier)      # "Acme Corp", "enterprise"

# The Clients (BIOS) you can access within your Organization
clients = client.clients.list()
for c in clients.clients:
    print(c.id, c.display_name, c.effective_tier)
```

## Async usage

```python
import asyncio
from prismio import PrismIOAsync

async def main():
    async with PrismIOAsync(api_key="pio_...") as client:
        org = await client.orgs.me()
        print(org.name)

asyncio.run(main())
```

## Error handling

Every error from the API maps to a typed exception:

```python
from prismio import PrismIO
from prismio import (
    AuthenticationError,   # 401
    PermissionError,       # 403
    NotFoundError,         # 404
    InvalidRequestError,   # 400 / 422
    RateLimitError,        # 429
    GovernanceError,       # a governance hook rejected
    ServerError,           # 5xx
)

client = PrismIO(api_key="pio_...")

try:
    client.clients.get("not-a-uuid")
except InvalidRequestError as exc:
    print(exc.code, exc.message, exc.request_id)
```

Each exception carries `code`, `message`, `param`, `type`, `status_code`, `request_id`, and the raw `error` payload from the canonical error envelope.

## Resources covered in `0.1.0a1`

| Resource | Methods |
|---|---|
| `client.capabilities` | `.get()` |
| `client.orgs` | `.me()` |
| `client.clients` | `.list()`, `.get(client_id)` |
| `client.bim` (next session) | `.get(model_id)`, `.check(...)`, `.export(...)`, `.governance(...)` |
| `client.compliance` (next session) | `.score(...)`, `.history(...)`, `.drift()` |
| `client.governance` (next session) | `.post_validate(...)`, `.parameters_recent()` |
| `client.personas` (next session) | `.list(model_id)` |
| `client.health()` | top-level |

Out of scope for `0.1.x` (deferred to `0.2`): auth (login / refresh), diagnostic session APIs, chat, files, API key management, GDPR endpoints.

## License

MIT. See [LICENSE](LICENSE).
