You would use an API call GetAccountSummaryin IAM, which is available as a method call get_account_summaryin boto.iam.IAMConnection.
import boto.iam
conn = boto.iam.connect_to_region('us-east-1')
summary = conn.get_account_summary()
This returns a Python dictionary containing a lot of information about your account. In particular, to find out if MFA is enabled,
if summary['AccountMFAEnabled']:
else:
source
share