import requests
import json
auth = 'username', 'password'
get_url = 'https://account.cloudant.com/database/_all_docs?limit=10'.format(
    auth[0])
r = requests.get(get_url, auth=auth)
print(json.dumps(r.json(), indent=1))
query cloudant with python