<commit_before># requests-mauth

requests-mauth is a python requests (http://docs.python-requests.org/en/latest/) Authentication implementation
for Medidata's _MAuth_ authentication system.

## Pre-requisites ##

To use MAuth authentication you will need:

* An MAuth APP ID
* An MAuth private key (with the public key registered with Medidata's MAuth server)


## Using ##

    import requests
    from requests_mauth import MAuth

    APP_UUID = '55dc88ec-c109-11e1-84f6-1231381b7d70'
    private_key = open("private.key","r").read()

    mauth = MAuth(APP_UUID, private_key)

    
    # Call an MAuth protected resource, in this case an iMedidata API 
    # listing the studies for a particular user
    user_uuid = '10ac3b0e-9fe2-11df-a531-12313900d531'
    url = "https://innovate.imedidata.com/api/v2/users/%s/studies.json" % user_uuid

    # Make the requests call, passing the auth client
    result = requests.get(url, auth=mauth)
    
    # Print results
    if result.status_code == 200:
        print([r['uuid'] for r in result.json()['studies']])
    print(result.text)<commit_msg>Added Build status<commit_after># requests-mauth

requests-mauth is a python requests (http://docs.python-requests.org/en/latest/) Authentication implementation
for Medidata's _MAuth_ authentication system.

## Pre-requisites ##

To use MAuth authentication you will need:

* An MAuth APP ID
* An MAuth private key (with the public key registered with Medidata's MAuth server)


## Using ##

    import requests
    from requests_mauth import MAuth

    APP_UUID = '55dc88ec-c109-11e1-84f6-1231381b7d70'
    private_key = open("private.key","r").read()

    mauth = MAuth(APP_UUID, private_key)

    
    # Call an MAuth protected resource, in this case an iMedidata API 
    # listing the studies for a particular user
    user_uuid = '10ac3b0e-9fe2-11df-a531-12313900d531'
    url = "https://innovate.imedidata.com/api/v2/users/%s/studies.json" % user_uuid

    # Make the requests call, passing the auth client
    result = requests.get(url, auth=mauth)
    
    # Print results
    if result.status_code == 200:
        print([r['uuid'] for r in result.json()['studies']])
    print(result.text)
    
Build Status
------------
* master - [![Build Status](https://travis-ci.org/mdsol/requests-mauth.svg?branch=master)](https://travis-ci.org/mdsol/requests-mauth.svg?branch=master)
{'fraction_non_alphanumeric': 0.11485065208245687, 'fraction_numerical': 0.04122843920908709, 'mean_word_length': 3.564299424184261, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5761979', 'n_tokens_mistral': 850, 'n_tokens_neox': 785, 'n_words': 204}