multipackage.utilities.packages module¶
Utilities for finding python packages.
Summary¶
Functions:
find_toplevel_packages |
Find all top level python packages in the given directory. |
Reference¶
-
multipackage.utilities.packages.
find_toplevel_packages
(path, exclude=('test', ), prefix=None)[source]¶ Find all top level python packages in the given directory.
This will automatically exclude all subpackages and only report the top level package. If you pass a prefix argument, then only the top level packages under that prefix will be reported.
So, if you have a package hierarchy like:
multipackage.core multipackage.plugins other_package.hello
and you pass prefix=”multipackage”, then you will get multipackage.core multipackage.plugins
Otherwise you will get: multipackage other_package
Parameters: Returns: The list of top level packages.
Return type: list of str