Skip to main content

Mashery authentication for requests

Project description

Simple class for making authenticated requests to Mashery APIs using the requests library.

Example

import requests
from requests_auth_mashery import MasheryAuth


def main():
    api_key = 'EXAMPLE'
    api_secret = 'EXAMPLE'

    mashery_auth = MasheryAuth(api_key, api_secret)

    payload = {
        'entitytype': 'artist',
        'query': 'weezer',
        'format': 'json',
    }
    url = 'http://api.rovicorp.com/search/v2.1/music/search'
    r = requests.get(url, auth=mashery_auth, params=payload)

    print r.content


if __name__ == '__main__':
    main()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

requests-auth-mashery-0.0.4.tar.gz (5.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page