See this add-on on the kodi.tv showcase
A micro framework to enable rapid development of Kodi plugins.