aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/examples/custom_plugin.py
diff options
context:
space:
mode:
authorHsiangNianian <i@jyunko.cn>2025-03-13 01:01:20 +0800
committerHsiangNianian <i@jyunko.cn>2025-03-13 01:01:20 +0800
commit80b74f79dfbfa9afb845172a5ea84110d75f1bc8 (patch)
tree361dcb055de78b50d82619646fde28fa618f9507 /examples/custom_plugin.py
parentdd873e954a92d0e3209fe98b034570b47c859589 (diff)
downloadconventional_role_play-80b74f79dfbfa9afb845172a5ea84110d75f1bc8.tar.gz
conventional_role_play-80b74f79dfbfa9afb845172a5ea84110d75f1bc8.zip
refactor(project)!: first implementation of the Conventional Role Play SDK with core components, renderers, extractors, and example usage.
Diffstat (limited to 'examples/custom_plugin.py')
-rw-r--r--examples/custom_plugin.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/examples/custom_plugin.py b/examples/custom_plugin.py
new file mode 100644
index 0000000..74a0bcc
--- /dev/null
+++ b/examples/custom_plugin.py
@@ -0,0 +1,25 @@
+from trpg_log_processor.plugins.plugin_manager import PluginManager
+
+class CustomPlugin:
+ def __init__(self):
+ self.name = "Custom Plugin"
+
+ def process(self, data):
+ # Custom processing logic
+ processed_data = data.upper() # Example transformation
+ return processed_data
+
+def main():
+ plugin_manager = PluginManager()
+ custom_plugin = CustomPlugin()
+
+ plugin_manager.register_plugin(custom_plugin)
+
+ # Example data to process
+ data = "This is a sample TRPG log."
+ result = custom_plugin.process(data)
+
+ print(f"Processed Data: {result}")
+
+if __name__ == "__main__":
+ main() \ No newline at end of file