mirror of
https://github.com/reconurge/flowsint.git
synced 2026-05-07 12:26:24 -05:00
[PR #130] [PROPOSAL] Plugin Discovery and Namespace Code Structure #568
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/reconurge/flowsint/pull/130
Author: @gustavorps
Created: 3/15/2026
Status: 🔄 Open
Base:
main← Head:feat/ns-and-plugin📝 Commits (1)
0a82d24Plugin discovery; Namespace refactor code structure for improved readability and maintainability📊 Changes
25 files changed (+3850 additions, -2 deletions)
View changed files
📝
flowsint-api/app/api/routes/events.py(+2 -1)📝
flowsint-core/src/flowsint_core/core/events.py(+8 -1)➕
python/.python-version(+1 -0)➕
python/packages/flowsint-core/README.md(+0 -0)➕
python/packages/flowsint-core/pyproject.toml(+16 -0)➕
python/packages/flowsint-core/src/flowsint/core/__init__.py(+1 -0)➕
python/packages/flowsint-core/src/flowsint/core/__main__.py(+1 -0)➕
python/packages/flowsint-enrichers/README.md(+0 -0)➕
python/packages/flowsint-enrichers/pyproject.toml(+21 -0)➕
python/packages/flowsint-enrichers/src/flowsint/enricher/__init__.py(+17 -0)➕
python/packages/flowsint-enrichers/src/flowsint/enricher/abc.py(+8 -0)➕
python/packages/flowsint-enrichers/src/flowsint/enricher/util/importlib.py(+185 -0)➕
python/packages/flowsint-example-plugin/README.md(+0 -0)➕
python/packages/flowsint-example-plugin/pyproject.toml(+22 -0)➕
python/packages/flowsint-example-plugin/src/flowsint/example/__init__.py(+0 -0)➕
python/packages/flowsint-example-plugin/src/flowsint/example/enricher/__init__.py(+2 -0)➕
python/packages/flowsint-example-plugin/src/flowsint/example/enricher/mock.py(+38 -0)➕
python/packages/flowsint-types/README.md(+0 -0)➕
python/packages/flowsint-types/pyproject.toml(+19 -0)➕
python/packages/flowsint-types/src/flowsint/types/__init__.py(+1 -0)...and 5 more files
📄 Description
This pull request introduces a new plugin-based architecture for enrichers in the Flowsint project, leveraging Python's entry points and lazy loading to improve modularity and startup performance. It also adds new workspace package configurations and updates Python version requirements. The most important changes are grouped below:
Plugin architecture and lazy loading
flowsint.enricher.util.importlib, enabling modules and entry points to be loaded only when first accessed, which reduces unnecessary imports and speeds up startup.flowsint.enricher.__init__.pyto discover and lazily load plugins via entry points, printing loaded plugins and registry contents for debugging.EnricherABCinflowsint.enricher.abc.py, which automatically registers subclasses with the enricher registry, supporting plugin discovery and registration.Example plugin implementation
flowsint-example-pluginwith entry point configuration and a sampleEnricherclass, demonstrating the new plugin system and type annotations for input/output. [1] [2] [3]Workspace and core package changes
pyproject.tomlfiles forflowsint-core-next,flowsint-enrichers-next, andflowsint-types-next, specifying Python version requirements and editable sources for modular development. [1] [2] [3]__init__.pyfiles to expose relevant symbols and updated the Python version to 3.13 in.python-versionfor compatibility with new features. [1] [2] [3]Redis connection initialization fix
EventEmitterby adding aconnect()method, preventing premature connection during module import and fixing issues when importing enrichers. [1] [2]These changes lay the foundation for a scalable, plugin-based enrichment system with improved dependency management and startup efficiency.
How to test the PR
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.