Asok Logo Asok
esc

Type to search across all documentation

GitHub MIT License Production Ready
Asok v0.4.0 is now live

The Elegance of
Minimalism.

Build production-ready, highly interactive web applications in Python with zero custom JavaScript. Single-package installation. Instant startup. Zero configuration.

Get Started
$ pip install asok
Asok Playground
Examples
1from asok import Request
2
3def render(request: Request):
4    return "<h1>Hello, World!</h1>"
5
6# That's it. No routing config.
7# File path = URL.
8# Just run: asok dev
1from asok import Component
2from asok.component import exposed
3
4class Counter(Component):
5    counter = 0
6
7    @exposed
8    def increment(self):
9        self.counter += 1
10
11    def render(self):
12        return self.html("counter.html")
1<!-- Lightweight client-side reactivity -->
2<div asok-state="{ count: 0 }">
3  <p asok-text="'Count: ' + count"></p>
4  <button asok-on:click="count++">
5    Increment
6  </button>
7</div>
8
9# Zero JS required. Built-in runtime handles state.
1from asok import api, RateLimit
2
3@api(summary="Create Task", input=TaskSchema)
4@RateLimit(limit=10)
5def post(request):
6    data = request.json_body
7    task = Task.create(**data)
8    return request.api(task, status=201)
9
10# Auto-generated OpenAPI 3.0 docs at /docs
0
Dependencies
50+
Features Built-in
< 50ms
Startup Time

Why Choose Asok?

Built on the belief that simplicity and transparency matter more than feature abundance.

πŸ“¦

Standard Library First

Built on Python's standard library. No npm conflicts, reduced security vulnerabilities, and faster updates.

πŸ‘οΈ

Code Transparency

Readable Python codebase. Understand your entire stack without digging through layers of abstractions.

πŸš€

Batteries Included

ORM, Auth, Admin, Forms, API documentation. Focus on your product, not library integration.

Built for Performance.

Fast startup, optimized routing, and production-ready security features.

Ultra-Fast

Optimized routing, compiled template engine, and efficient request handling for maximum performance.

Secure by Default

CSRF protection, template sandbox, automatic sanitization, and security headers configured out of the box.

Live Components

Build reactive, real-time interfaces via native WebSockets with server-side state synchronization.

Built For Everyone

From rapid prototypes to production apps, Asok adapts to your needs.

πŸš€

Startups & MVPs

Ship your idea in hours, not weeks. Zero dependencies means zero installation hassle. Perfect for rapid prototyping and getting to market fast.

πŸ€–

AI & ML Projects

Built-in vector search, HTML streaming for real-time output, and WebSocket components for interactive AI experiences. No external AI database needed.

πŸ“±

Internal Tools

Admin interface, forms, authentication, and RBAC out of the box. Build dashboards, CRMs, and backoffice tools without reinventing the wheel.

πŸŽ“

Learning & Teaching

Clean codebase, zero dependencies, and simple architecture. Perfect for understanding web framework internals or teaching Python web development.

πŸ”Œ

API Backends

Auto-generated OpenAPI docs, built-in rate limiting, and CORS support. Create REST APIs with automatic validation and documentation.

⚑

Real-time Apps

Native WebSockets, reactive components, and HTML streaming. Build dashboards, chat apps, and collaborative tools without complex JavaScript frameworks.

Built-in Superpowers

Everything you need to build professional applications, included in the standard library.

Multi-Engine ORM

Supports SQLite, PostgreSQL, and MySQL. High-performance querying with auto-migrations, eager loading, and soft deletes.

Enterprise API

Build industrial-grade JSON APIs with Rate Limiting, CORS, and auto-generated OpenAPI 3.0 documentation at /docs.

Secure Auth

Native sessions, PBKDF2 hashing, and granular RBAC with request.user.can().

Optional Admin

Django-style admin interfaceβ€”auto-generated from models. Add with --admin flag. Roles, Inlines, CSV Export.

Vector Search

Build AI apps with native semantic search. Store embeddings and query with .nearest() without any AI database.

HTML Streaming

Lightning-fast FCP with chunked delivery. Browser starts rendering your page while the server is still generating content.

Background Workers

Built-in worker and scheduler. Run tasks asynchronously in a local thread pool, or scale with a Redis task queue.

Auto-Prefetch

Instant page transitions. Asok intelligently prefetches links on hover, making your site feel like a local application.

Email / SMTP

Send emails with built-in SMTP support. HTML templates, attachments, and async delivery without external services.

Distributed Caching

Memory, file, or Redis-based caching. Speed up operations with automatic TTL, cache keys, and template fragment caching.

i18n / Locales

Multi-language support with JSON locale files. Auto-detect user language and switch seamlessly between translations.

Asok Directives

Build interactive UIs with zero custom JS. Use asok-state and asok-on for instant reactivity.

Powerful CLI

Generators, migrations, seeders, and dev server. Scaffold routes, models, and components with a single command.

Tailwind v4

Native Tailwind CSS integration with zero npm setup. Watch mode and production minification built-in.

Animations

Svelte-style page transitions and component animations. Add asok-transition attribute for instant polish.

Dual-Core Async

Run under ASGI (Uvicorn) or WSGI (Gunicorn). Supports async page controllers, async middleware, and non-blocking ORM queries.

Cloud Storage

Seamless upload handling. Store uploaded files locally or stream directly to Amazon S3 (or any S3-compatible cloud storage).

Compare. Conquer.

See how Asok eliminates boilerplate and lets you focus on what matters.

01. Routing Paradigm

Traditional (Flask/Django) Declarative
@app.route('/blog/<slug>')
def post(slug):
    return render_template('post.html')
Requires centralized URL config or manual decorators for every route.
Asok Framework File-Based
src/pages/blog/[slug]/page.py
def render(request):
    slug = request.params['slug']
    return request.html('page.html')
File-based routing. The folder structure defines the URL automatically.

02. Fragment Reactivity

Manual AJAX Client-Side JS
fetch('/update').then(r => r.text())
.then(html => {
  document.querySelector('#target')
  .innerHTML = html;
});
Asok Fragment Swap Zero JS
<button data-url="/update"
        data-block="target">
  Update Content
</button>

03. Zero-Config ORM

Flask + SQLAlchemy Config Hell
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy(app)
class Post(db.Model):
  id = db.Column(db.Integer, ...)
  title = db.Column(db.String(100))
db.create_all() # Manual migrations
Requires SQLAlchemy, migration tools, and extensive boilerplate.
Asok Built-in ORM Auto-Migration
from asok import Model, Field
class Post(Model):
  title = Field.String()
  content = Field.Text()
  image = Field.File()
  created_at = Field.CreatedAt()
β†’ Auto-migrates on first run. No makemigrations needed.

04. Auto-Documented APIs

Flask REST Setup Manual Docs
from flask_restx import Api, Resource
api = Api(app, doc='/docs')
@api.route('/users')
class UserAPI(Resource):
  def get(self): ...
Requires Flask-RESTX, manual schema definitions, and boilerplate.
Asok Auto-API OpenAPI 3.0
@api(
  summary="List tasks",
  input=TaskSchema,
  output=TaskSchema
)
def render(request):
  tasks = Task.all()
  data = TaskSchema(many=True)
  return request.api(data.dump(tasks))
β†’ Auto-generates OpenAPI 3.0 docs at /docs

04. Secure-by-Design API

Manual Hardening Extensions Needed
from flask_limiter import Limiter
limiter = Limiter(app)
@limiter.limit("10/minute")
def my_api(): ...
Asok Core Security Batteries Included
@RateLimit(limit=10)
@internal_only
def get(request):
    return request.api({...})

Feature Overview

A side-by-side look at different approaches to Python web development.

Feature Flask Django Asok
Routing Decorators (@route) urls.py config File-based (automatic)
Database ORM SQLAlchemy (external) Built-in (complex) Built-in (SQLite, Postgres, MySQL)
Migrations Alembic (manual) manage.py migrate Automatic
Forms WTForms (external) Built-in (verbose) Built-in (declarative)
Authentication Flask-Login (external) Built-in (complex) Built-in (simple)
Admin Interface Flask-Admin (external) Built-in (required) Built-in (optional flag)
API Documentation Flask-RESTX (manual) DRF (complex setup) OpenAPI (auto-generated)
Reactive Components ❌ Manual JS ❌ Manual JS βœ… Zero JS (WebSocket)
Dependencies 5+ packages Many packages Zero (stdlib only)
Learning Curve Medium Steep Gentle
Deployment Manual WSGI & task runner Complex settings & static files Single-command deploy
Vector Search (AI) ❌ No ❌ No βœ… Native
HTML Streaming Partial (complex) Partial (complex) βœ… Native
Async & Concurrency Flask-Aiohttp (external) ASGI support (complex) βœ… ASGI & WSGI (Unified)
Cloud File Storage ❌ No django-storages (external) βœ… Built-in (Local/S3)
Background Jobs Celery/Redis needed Celery/Redis needed βœ… Built-in (Local/Redis)
Lines of Code ~50-100 (boilerplate) ~100-200 (config) ~10-20 (minimal)

Reactive by Nature.

Two approaches to reactivity, both without writing JavaScript.

Asok Directives

Client-side Reactivity

No WebSocket β€’ Pure HTML

0
Live Component

WebSocket Sync

Real-time β€’ Multi-user

0

Same result, different approach. Both require zero JavaScript from you.

Ready to build the
impossible?

Join developers worldwide building fast, secure, and reactive apps with Asok.