I would like to get a list of names of built-in modules in python such that I can test the popularity of function's naming conventions (underline, CamelCase or mixedCase).
I know there is a Global Module Index but I am wondering if there is a list of strings, which is easier to use :)
Update:
len(dir(__builtins__)) = 145 len(stdlib_list("2.7")) = 430 help('modules') = 508 # counting manually the output
The compiled-in module names are in sys. builtin_module_names . For all importable modules, see pkgutil. iter_modules .
In the standard Python interpreter, you can type " help('modules') ". At the command-line, you can use pydoc modules .
To see all modules installed on the system, use the Get-Module -ListAvailable command.
The compiled-in module names are in sys.builtin_module_names
. For all importable modules, see pkgutil.iter_modules
.
Run these in a clean virtualenv
to get (almost) only the modules that come with Python itself.
Note that a “popularity poll” will necessarily include modules that use old, discouraged naming conventions because they were written before today's guidelines were put in place, and can't change because need to be backwards compatible. It might be useful for something, but not for answering best-practice questions such as “How should I name my functions?”. For that, see the PEP8, the Python style guide, especially the “Naming Conventions” section.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With