I believe you can use python-hglib:
import hglib
client = hglib.open('.')
bookmarks, active = client.bookmarks()
if active == -1:
print 'no active bookmark'
else:
print 'active bookmark:', bookmarks[active][0]
The confusion might be that the API documented on the MercurialAPI wiki page is the internal API. The API provided by python-hglib is apparently not really documented anywhere except in the code of the library. The bookmarks
method is documented, for example.