Metadata-Version: 2.4
Name: prismiq
Version: 0.2.2
Summary: Open-source embedded analytics platform
Project-URL: Homepage, https://github.com/statisfy-us/prismiq
Project-URL: Documentation, https://prismiq.dev/docs
Project-URL: Repository, https://github.com/statisfy-us/prismiq
Author: Prismiq Contributors
License-Expression: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Database
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: asyncpg>=0.29.0
Requires-Dist: fastapi>=0.109.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: sqlalchemy>=2.0.0
Requires-Dist: sqlglot>=26.0.0
Requires-Dist: uvicorn>=0.27.0
Provides-Extra: dev
Requires-Dist: httpx>=0.27.0; extra == 'dev'
Requires-Dist: pre-commit>=3.7.0; extra == 'dev'
Requires-Dist: pyright>=1.1.350; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.4.0; extra == 'dev'
Provides-Extra: llm
Requires-Dist: google-genai>=1.0.0; extra == 'llm'
Provides-Extra: redis
Requires-Dist: redis>=5.0.0; extra == 'redis'
Description-Content-Type: text/markdown

# Prismiq

Open-source embedded analytics engine for Python.

## Installation

```bash
pip install prismiq
```

## Quick Start

```python
from prismiq import PrismiqEngine

# Connect to your database
engine = await PrismiqEngine.create(
    database_url="postgresql://user:pass@localhost/mydb",
    exposed_tables=["customers", "orders", "products"]
)

# Get schema
schema = await engine.get_schema()

# Execute a query
result = await engine.execute({
    "tables": [{"id": "t1", "name": "orders"}],
    "columns": [
        {"table_id": "t1", "name": "status"},
        {"table_id": "t1", "name": "total", "aggregation": "sum"}
    ],
    "group_by": [{"table_id": "t1", "column": "status"}]
})
```

## Features

- **Schema introspection** - Discover tables, columns, and relationships
- **Visual query building** - Build SQL from JSON query definitions
- **Async execution** - Non-blocking database operations with asyncpg
- **Type safe** - Full type hints with Pydantic models
- **Multi-tenant support** - Schema-based isolation with Alembic integration

## Multi-Tenant Integration

For applications with schema-based multi-tenancy, Prismiq provides SQLAlchemy declarative models and sync table creation:

```python
from sqlalchemy import create_engine
from prismiq import ensure_tables_sync, PrismiqBase

engine = create_engine("postgresql://user:pass@localhost/db")

# Create tables in a tenant-specific schema
with engine.connect() as conn:
    ensure_tables_sync(conn, schema_name="tenant_123")
    conn.commit()

# For Alembic integration, access the metadata:
# PrismiqBase.metadata.tables contains all Prismiq table definitions
```

See [Multi-Tenant Integration Guide](../../docs/multi-tenant-integration.md) for complete documentation.

## Documentation

See the [main repository](https://github.com/prismiq/prismiq) for full documentation.

## License

MIT
