Pynsive API Documentation

pynsive Module

common Module

pynsive.common.import_module(module_name)[source]

A nice namespace alias for users.

reflection Module

pynsive.reflection.discover_modules(directory)[source]

Attempts to list all of the modules and submodules found within a given directory tree. This function searches the top-level of the directory tree for potential python modules and returns a list of candidate names.

Note: This function returns a list of strings representing discovered module names, not the actual, loaded modules.

Parameters:directory – the directory to search for modules.
pynsive.reflection.list_classes(mname, cls_filter=None)[source]

Attempts to list all of the classes within a specified module. This function works for modules located in the default path as well as extended paths via the sys.meta_path hooks.

If a class filter is set, it will be called with each class as its parameter. This filter’s return value must be interpretable as a boolean. Results that evaluate as True will include the type in the list of returned classes. Results that evaluate as False will exclude the type in the list of returned classes.

Parameters:
  • mname – of the module to descend into
  • cls_filter – a function to call to determine what classes should be included.
pynsive.reflection.list_modules(mname)[source]

Attempts to list all of the submodules under a module. This function works for modules located in the default path as well as extended paths via the sys.meta_path hooks.

This function carries the expectation that the hidden module variable ‘__path__’ has been set correctly.

Parameters:mname – the module name to descend into
pynsive.reflection.rdiscover_modules(directory)[source]

Attempts to list all of the modules and submodules found within a given directory tree. This function recursively searches the directory tree for potential python modules and returns a list of candidate names.

Note: This function returns a list of strings representing discovered module names, not the actual, loaded modules.

Parameters:directory – the directory to search for modules.
pynsive.reflection.rlist_classes(module, cls_filter=None)[source]

Attempts to list all of the classes within a given module namespace. This method, unlike list_classes, will recurse into discovered submodules.

If a type filter is set, it will be called with each class as its parameter. This filter’s return value must be interpretable as a boolean. Results that evaluate as True will include the type in the list of returned classes. Results that evaluate as False will exclude the type in the list of returned classes.

Parameters:
  • mname – of the module to descend into
  • cls_filter – a function to call to determine what classes should be included.
pynsive.reflection.rlist_modules(mname)[source]

Attempts to the submodules under a module recursively. This function works for modules located in the default path as well as extended paths via the sys.meta_path hooks.

This function carries the expectation that the hidden module variable ‘__path__’ has been set correctly.

Parameters:mname – the module name to descend into
Read the Docs v: latest
Versions
latest
Downloads
PDF
HTML
Epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.