Metadata-Version: 2.4
Name: shakti-framework
Version: 0.1.0
Summary: Shakti — AI-first, async Python web framework. Born in India, built for the world.
Project-URL: Homepage, https://github.com/shaktihq/shakti
Project-URL: Documentation, https://github.com/shaktihq/shakti/tree/main/docs
Project-URL: Repository, https://github.com/shaktihq/shakti
Project-URL: Bug Tracker, https://github.com/shaktihq/shakti/issues
Author-email: Aditya Bhat <contact@adityabhat.in>
Maintainer-email: Aditya Bhat <contact@adityabhat.in>
License: MIT
License-File: LICENSE
Keywords: ai,api,asgi,async,framework,india,python,rest,web
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: pyyaml>=6.0
Provides-Extra: ai
Requires-Dist: anthropic>=0.30; extra == 'ai'
Requires-Dist: openai>=1.0; extra == 'ai'
Provides-Extra: all
Requires-Dist: aiosqlite>=0.20; extra == 'all'
Requires-Dist: alembic>=1.13; extra == 'all'
Requires-Dist: anthropic>=0.30; extra == 'all'
Requires-Dist: bcrypt>=4.0; extra == 'all'
Requires-Dist: openai>=1.0; extra == 'all'
Requires-Dist: pillow>=10.0; extra == 'all'
Requires-Dist: psutil>=5.9; extra == 'all'
Requires-Dist: pyjwt>=2.8; extra == 'all'
Requires-Dist: pypdf>=4.0; extra == 'all'
Requires-Dist: sqlalchemy[asyncio]>=2.0; extra == 'all'
Requires-Dist: uvicorn>=0.30; extra == 'all'
Provides-Extra: auth
Requires-Dist: bcrypt>=4.0; extra == 'auth'
Requires-Dist: pyjwt>=2.8; extra == 'auth'
Provides-Extra: dev
Requires-Dist: aiosqlite>=0.20; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Requires-Dist: uvicorn>=0.30; extra == 'dev'
Provides-Extra: docs-ai
Requires-Dist: pillow>=10.0; extra == 'docs-ai'
Requires-Dist: pypdf>=4.0; extra == 'docs-ai'
Provides-Extra: monitoring
Requires-Dist: psutil>=5.9; extra == 'monitoring'
Provides-Extra: orm
Requires-Dist: aiosqlite>=0.20; extra == 'orm'
Requires-Dist: alembic>=1.13; extra == 'orm'
Requires-Dist: sqlalchemy[asyncio]>=2.0; extra == 'orm'
Provides-Extra: server
Requires-Dist: uvicorn>=0.30; extra == 'server'
Description-Content-Type: text/markdown

# Shakti

**An AI-first, async Python web framework.**

> Born in India. Built for the world.

```bash
pip install "shakti[server]"
```

---

## Why Shakti?

| Feature | Django | FastAPI | **Shakti** |
|---------|--------|---------|------------|
| Async-first | ❌ | ✅ | ✅ |
| Built-in ORM | ✅ | ❌ | ✅ |
| Admin panel | ✅ | ❌ | ✅ |
| JWT Auth | ❌ | ❌ | ✅ |
| **Built-in AI** | ❌ | ❌ | ✅ |
| WebSockets | ❌ | ✅ | ✅ |
| Background Jobs | ❌ | ❌ | ✅ |
| Monitoring | ❌ | ❌ | ✅ |
| Document AI | ❌ | ❌ | ✅ |

---

## Quick Start

```bash
pip install "shakti[all]"
shakti new myapp
cd myapp
shakti run --reload
```

Visit `http://127.0.0.1:8000` — your app is live.

---

## 60-second example

```python
from shakti import Shakti, Depends
from shakti.config import Config
from shakti.orm import Database, Repository
from shakti.auth import Auth
from shakti.auth.models import User
from shakti.ai import AI
from shakti.admin import Admin
from shakti.monitoring import Monitor
from shakti.workflows import WorkflowEngine
from shakti.websocket import WebSocket

config = Config()
app = Shakti(title="My App", config=config)

db = Database(config.require("database.url"))
db.init_app(app)

auth = Auth(db, secret_key=config.require("auth.secret_key"))
auth.init_app(app)

ai = AI(config)
ai.init_app(app)

admin = Admin(db, auth, title="My Admin")
admin.register(User)
admin.init_app(app)

monitor = Monitor()
monitor.init_app(app)

workflows = WorkflowEngine()
workflows.init_app(app)

@app.get("/")
async def index() -> dict:
    return {"framework": "Shakti", "status": "running"}

@app.get("/me")
async def me(user: User = Depends(auth.get_current_user())) -> dict:
    return user.to_dict()

@app.websocket("/ws/chat")
async def chat(ws: WebSocket) -> None:
    await ws.accept()
    async for msg in ws.iter_json():
        reply = await ai.chat(msg["text"])
        await ws.send_json({"reply": reply})
```

**One app. Everything included:**
- ✅ Async REST API
- ✅ JWT authentication
- ✅ AI chat (Claude/OpenAI)
- ✅ WebSocket real-time
- ✅ Admin panel at `/admin/`
- ✅ Monitoring at `/monitor/`
- ✅ Background jobs
- ✅ PDF/OCR document AI

---

## Install

```bash
pip install shakti                    # core only
pip install "shakti[server]"          # + uvicorn
pip install "shakti[orm]"             # + SQLAlchemy
pip install "shakti[auth]"            # + JWT + bcrypt
pip install "shakti[ai]"              # + Claude/OpenAI
pip install "shakti[monitoring]"      # + psutil
pip install "shakti[all]"             # everything
```

---

## CLI

```bash
shakti new myapp                         # scaffold project
shakti run --reload                      # start dev server
shakti generate model Post title:str body:text   # generate model
shakti generate api Comment body:text    # model + full CRUD
shakti makemigrations "add posts"        # create migration
shakti migrate                           # apply migrations
shakti version                           # show version
```

---

## Configuration

```yaml
# config/settings.yaml
app:
  name: myapp
  debug: true

database:
  url: sqlite+aiosqlite:///./myapp.db

auth:
  secret_key: ${SECRET_KEY}

ai:
  provider: anthropic
  model: claude-sonnet-4-6
  api_key: ${ANTHROPIC_API_KEY}
  system_prompt: "You are a helpful assistant."
```

---

## Modules

| Module | Import | What it does |
|--------|--------|-------------|
| Core | `from shakti import Shakti` | Routing, middleware, DI, config |
| ORM | `from shakti.orm import Database` | SQLAlchemy async + migrations |
| Auth | `from shakti.auth import Auth` | JWT, RBAC, API keys |
| AI | `from shakti.ai import AI` | Claude/OpenAI, RAG, agents |
| Admin | `from shakti.admin import Admin` | Auto-generated admin panel |
| WebSocket | `from shakti.websocket import WebSocket` | Real-time connections |
| Document AI | `from shakti.docs import DocumentAI` | PDF, OCR, document Q&A |
| Workflows | `from shakti.workflows import WorkflowEngine` | Background jobs |
| Monitoring | `from shakti.monitoring import Monitor` | Health checks, metrics |

---

## License

MIT © Aditya Bhat — Born in India 🇮🇳
