In the Python console in QGIS you can see what system paths are available to the interpreter:
>>> import sys
Any package or module located on one of those paths will be available to import. Here are some solutions to a shared module library approach:
- Adding packages to
/home/username/.qgis/python, though this requires you to manage your own install/updates to this location from within one of your plugins, if you decide to release them to the public via the plugin repository. Many users expect plugin components to be installed in
/home/username/.qgis/python/plugins, so this may not be a good solution with regards to maintainability.
- Create a library plugin that users have to also install in addition to your other plugins. Some developers have taken this approach as it allows the library plugin to be updated via the Plugin Installer, independent of the other tool plugins. The library plugin does not need to have any GUI, but could offer one if 'global' settings are to be edted by the user. Useful if you intend to build many plugins based off the library, but a bit annoying to users.
- Don't create separate plugins for your tools. Keep all of your tools (would-be plugins) in one plugin, along with the shared module library. This is the approach used by fTools, CadTools, and other multi-tool plugins. Your tools can appear to the user as separate plugins in the GUI, or in your own toolbar or menu.
Regardless of your solution, it's important that your packages use unique names so as to not cause namespace conflicts on import.
/home/username/.qgis/python/includes is a bit too generic. Also, any shared module library folder on a sys.path needs to have Python package structure to be importable (e.g. contain at least an __init__.py file)