Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to explore a python file from commandline

I have a python file with no argparse implementation in its __main__, yet, I’m interested in having a look at the functions and modules implemented in it from the commandline. I’m tempted to write a function to perform such exploration but I wanted to find out first whether this is already available.

EDIT 1: to make it more concrete, I’m interested in names of functions and classes + their docs.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You may be looking for a tool like python-fire.

From the repository:

Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object. […] Python Fire helps with exploring existing code or turning other people’s code into a CLI.

It is available as a package on pip.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading