This script will extract the dependencies of a python file, or a directory that contains python files. This will be useful in either using third-party package that doesn't come with a "requirement.txt", or creating your own "requirement.txt" when porting to server.
./extract-dependencies.py [-r] > requirement.txt
Currently this script only supports python 2.7. If you want support for other versions of python, just extract the builtin modules list from http://docs.python.org/2.7/py-modindex.html and assign the list to the builtin_modules in the DependencyExtractor class. Or even easier, simply uncomment the get_builtin_packages method.
- Avoid comment area (Done)
- Eliminate project modules (Done)