mirror of
https://github.com/allaunthefox/Research-Stack.git
synced 2026-07-31 03:05:21 +00:00
1.4 KiB
1.4 KiB
Plugin Development
Overview
NoDupeLabs uses a plugin-based architecture. Plugins extend core functionality through standardized interfaces.
Plugin Types
| Type | Purpose |
|---|---|
database |
Data persistence |
similarity |
Content comparison |
time_sync |
Timestamp handling |
commands |
CLI extensions |
ml |
Machine learning |
gpu |
GPU acceleration |
network |
Network operations |
video |
Video processing |
Creating a Plugin
Structure
from nodupe.core.plugins import SimilarityCommandPlugin
class MyPlugin(SimilarityCommandPlugin):
"""Plugin description."""
name: str = "my_plugin"
version: str = "1.0.0"
def execute(self, args):
"""Execute the plugin."""
pass
Plugin Interface
Implement the appropriate interface based on plugin type:
SimilarityCommandPlugin- For similarity detectionDatabasePlugin- For database operationsCommandPlugin- For CLI commands
Registration
Plugins are auto-discovered from the nodupe/plugins/ directory.
Example
See existing plugins in nodupe/plugins/:
database/features.pysimilarity/__init__.pytime_sync/time_sync.py
Testing
pytest tests/plugins/ -v
Best Practices
- Follow existing plugin patterns
- Add comprehensive docstrings
- Include tests in
tests/plugins/ - Use type annotations