2025-11-08 15:34:25 +08:00
2025-11-05 16:21:05 +08:00
2025-11-08 01:24:50 +08:00
2025-11-08 15:34:25 +08:00
2025-11-05 17:27:15 +08:00
2025-11-05 16:21:05 +08:00
2025-11-05 16:21:05 +08:00
2025-11-05 16:21:05 +08:00
2025-11-05 16:21:05 +08:00
2025-11-07 22:13:57 +08:00
2025-11-05 16:21:05 +08:00
2025-11-06 10:55:39 +08:00

PWF

Plugin-based Web Framework

Clone

add as submodule

git init
git submodule add <repository_url> PWF

or

git clone <repository_url> PWF
cd PWF/Convention
git submodule update --init --recursive

First Start

use

python app.py
# from PWF.Application.app import main
# main()

to start and generate Assets Folder(generate by ProjectConfig)

Assets

Every default argument define in Assets/config.json, properties in find is define the arguments value where you not setting

Sometimes some property not exists in config, just because program not running to the place where argument been referenced

Arguments

Commandline and Config

  • --host default: 0.0.0.0
  • --port default: 8000
  • --verbose default: false

Only Config

  • max_concurrent_requests default: 100
  • database_path file on Assets, default: db.db
  • plugin_dir where plugins load, default: Plugins
  • always_return_ok default: true

Plugins

First import interface and define class

from CoreModules.plugin_interface import PluginInterface, DatabaseModel

class MyPlugin(PluginInterface):
    def generate_router_callback(self):
        async def callback():
            return {"message": "Hello from MyPlugin"}
        return callback
    
    def register_db_model(self):
        return DatabaseModel(
            table_name="my_plugin_table",
            column_names=["id", "data", "created_at"],
            column_defs={
                "id": "INTEGER PRIMARY KEY",
                "data": "TEXT",
                "created_at": "INTEGER"
            }
        )
    
    def dependencies(self):
        return []  
    
    def wake_up(self):
        pass
Description
Plugin-based Webhook Framework
Readme MIT 625 KiB
Languages
JavaScript 97.2%
Python 2.8%