The __version__ module is accessible via the sqlobject module.
2
'beta'
(2, 0, 0, 'beta', 1)
None
0
'2.0.0b1'
1
See the source for more information.