A curated list of awesome extensions, plugins, resources, templates, and tools for the Asok Framework.
Asok is a modern, ultra-lightweight, and lightning-fast web framework for Python.
Tip
Have you developed an Asok extension, tool, or template? Help the community grow! Please share your project here to assist other developers in building with Asok. Read the Contributing section below to submit your project.
- Official Resources
- Extensions & Integration
- Tools & IDE Support
- Examples & Templates
- Tutorial: Building an Asok Extension
- Contributing
- Asok Repository - The core framework codebase.
- Asok Documentation - Official documentation repository.
- Extension System Docs - Official guide on how to integrate third-party extensions.
- Asok Examples - Official template projects and usage examples.
- asok-auth-providers - OAuth2 providers pack (Google, GitHub, Microsoft, Apple, Discord, Facebook, GitLab, LinkedIn, Twitch) for the Asok framework, with drop-in routes, customizable buttons, and preconfigured CSS.
- asok-lucide - Server-side Lucide Icons integration for Asok, rendering clean, customizable SVGs with zero client-side JS.
- asok-vscode - VS Code extension for Asok, providing syntax highlighting, autocomplete, and code snippets.
- asok-examples - Collection of starter templates and reference applications.
Asok features a highly modular architecture. You can easily bundle reusable controllers, views, assets, template helper functions, and CLI commands into standalone Python packages.
An Asok extension package typically has the following layout:
my-extension/
├── pyproject.toml
├── README.md
├── my_extension/
│ ├── __init__.py
│ ├── cli.py
│ ├── templates/
│ │ └── my_component.html
│ └── static/
│ └── my_style.css
└── tests/
└── test_extension.py
Create your core extension by inheriting from AsokExtension. It receives the main Asok app instance inside init_app during registration.
# my_extension/__init__.py
import os
from typing import Any, Optional
from asok.core.extension import AsokExtension
from asok import Asok
class MyExtension(AsokExtension):
def __init__(self, custom_setting: str = "default"):
self.custom_setting = custom_setting
def init_app(self, app: Asok) -> None:
"""Initialize the extension with the Asok application."""
super().init_app(app)
# Share functions or helpers with Jinja templates
def greet_helper(name: str) -> str:
return f"Hello {name}, setting is {self.custom_setting}!"
# Register a template helper (lazy-loaded by Asok)
app.share(greet=lambda request: greet_helper)
def get_templates_path(self) -> Optional[str]:
"""Expose custom layout templates or components to the application."""
return os.path.join(os.path.dirname(__file__), "templates")
def get_static_path(self) -> Optional[str]:
"""Expose static assets (JS, CSS, images)."""
return os.path.join(os.path.dirname(__file__), "static")When using app.share(), Asok wraps the helper dynamically to pass the current request context. To prevent premature evaluation, always wrap your template functions in a factory helper:
# Wrap the function in a helper that receives request and returns the actual function
app.share(my_helper=lambda request: actual_helper_function)In Jinja templates, it can now be called directly:
<div>{{ my_helper("World") }}</div>You can register custom CLI commands using Python's standard entry_points.
Add the entry point to your pyproject.toml:
[project.entry-points."asok.commands"]
my_extension_cmd = "my_extension.cli:register_commands"Implement register_commands in my_extension/cli.py to register custom parsers on Asok's CLI parser:
# my_extension/cli.py
import argparse
def register_commands(subparsers: argparse._SubParsersAction) -> None:
parser = subparsers.add_parser(
"my-cmd",
help="Run custom commands from my extension"
)
parser.add_argument("--name", type=str, default="Guest")
parser.set_defaults(func=handle_command)
def handle_command(args: argparse.Namespace) -> None:
print(f"Executing command for: {args.name}")Once installed, running asok my-cmd --name Alice will execute your handler automatically.
Your users can register the extension in their wsgi.py (or bootstrapper file):
from asok import Asok
from my_extension import MyExtension
app = Asok()
app.register_extension(MyExtension(custom_setting="active"))Contributions are very welcome! If you have built an Asok extension, a boilerplate template, a helper library, or a tool, please share it here to help other developers find it.
Please read the Awesome List Guidelines before submitting a pull request.
- Fork this repository.
- Add your extension or resource to the appropriate category in alphabetical order.
- Provide a short, clear description of what your resource does.
- Submit a Pull Request!