Take a look at [`qiime.util.get_qiime_library_version`](https://github.com/qiime/qiime/blob/master/qiime/util.py#L1163).