Skip to main content

Shakti — AI-first, async Python web framework. Born in India, built for the world.

Project description

Shakti

An AI-first, async Python web framework.

Born in India. Built for the world.

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

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

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

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

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

# 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 🇮🇳

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shakti_framework-0.2.0.tar.gz (100.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shakti_framework-0.2.0-py3-none-any.whl (103.7 kB view details)

Uploaded Python 3

File details

Details for the file shakti_framework-0.2.0.tar.gz.

File metadata

  • Download URL: shakti_framework-0.2.0.tar.gz
  • Upload date:
  • Size: 100.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for shakti_framework-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8db5b4818987fc91bacf8a18a2b92225d93ec146e26e8d531e639a0fe6b2a099
MD5 b9825bef95ba5598211c199f45bf1a61
BLAKE2b-256 8f3472f9e45da2e6a44097fc4a790e8b329357858a6e4541e073b07fa2b0c96d

See more details on using hashes here.

File details

Details for the file shakti_framework-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for shakti_framework-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ff137b2552a6ae6ce09e10844c65337991c04de6bf62a2fb77b6cb047dce27b
MD5 583f473215d2129ded4ff000de21c79f
BLAKE2b-256 a503199c4d6a4640c199adefa25bf2308cbf8b8eeec7af976cd0aab05e48d4dd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page