0

I've made a bunch of helper functions for some data analysis work, but overtime that "bunch" has grown to quite a lot of functions. To use them, I have a huge ugly if-else branching logic for various command line arguments, but it gets tedious to maintain, as well as being annoying to have to add to the branching everytime I add a new function.

As such, I'd like to be able to make all functions that follow a certain naming schema, namely not starting with an underscore, callable via command line. To do so, I need to be able to dynamically know what functions exist, as well as what arguments they require.

Is there an easy way to do so? I saw some post on stackoverflow using an inspect module, but that required the functions to be in a different module, which is not my case.

Thanks!

NewJob
  • 39
  • 2
  • Seems like you can [get all functions in the current module](https://stackoverflow.com/a/18922800/6273251) and then [get the signature of them](https://stackoverflow.com/questions/218616/how-to-get-method-parameter-names). Have you tried this? – Random Davis Jan 10 '22 at 19:44

0 Answers0