I am designing a python library for analysis. I wanted the user to be able to provide a python script containing the functions to be used as metrics for the analysis.
So the library should take the path to the user script so the library can access them and use them for the analysis.
I have already thought of some options to do it, like getting the functions as strings and use exec(), or importing them inside the class namespace.
Ideally I would like to get the functions "saved" in a dictionaty as a class attribute. And I am not sure the options I have are the best, I was wondering if anyone could give me a more pythonic or just clean way to solve this.