Answer the question
In order to leave comments, you need to log in
How to make a plugin architecture with Python batch tools?
I would like to make sure that the functionality of the program can be easily expanded by the community in some standard way.
For example, let's make a simple program like ls, it iterates through the files and calls all the plugins for the file. All our plugins are inherited from our Plugin() class. The bundle only has NamePlugin() which writes the file name.
Then the user does "pip install lsplugins.filesize" installs some package (of another developer) and we also have FileSizePlugin () and our ls also writes the file size. And if you install PluginMD5 (), then it will also write md5 sums.
Is there a way to do this (second-level package, from another developer)?
I would like additional functionality to appear automatically after "pip install ...", so that somehow our code learns about all available plugins.
PS
There are all sorts of plugin frameworks. You can write your own. Throw all plugins into some directory and import them as files. But it's all ugly. Maybe there is a standard python way.
Answer the question
In order to leave comments, you need to log in
https://packaging.python.org/guides/creating-and-d...
There seems to be a standard way after all.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question