Skip to main content

A simple Python client library for the Mashery API

Project description

A simple Python client library for the Mashery API.

Example

Query recently created apps:

from masheryclient.jsonrpc import MasheryJsonRpcApi

json_rpc_api_client = MasheryJsonRpcApi(
    MASHERY_SITE_ID,
    MASHERY_SERVICE_KEY,
    MASHERY_API_KEY,
    MASHERY_API_SECRET
)

mashery_query = 'SELECT * FROM applications ORDER BY created DESC ITEMS 10'
r = json_rpc_api_client.query(mashery_query)['items']

for app in r:
    print app['name']

Top API callers within the specified time period:

reporting_client = MasheryReportingApi(
    MASHERY_SITE_ID,
    MASHERY_SERVICE_KEY,
    MASHERY_API_KEY,
    MASHERY_API_SECRET,
)

r = reporting_client.developer_activity_for_service(start_date_str, end_date_str, limit)

app_list = []
for app in r:
    api_key = app['serviceDevKey']
    call_count_success = app['callStatusSuccessful']
    call_count_blocked = app['callStatusBlocked']
    call_count_other = app['callStatusOther']

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

masheryclient-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

File details

Details for the file masheryclient-0.1.0.tar.gz.

File metadata

  • Download URL: masheryclient-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for masheryclient-0.1.0.tar.gz
Algorithm Hash digest
SHA256 549878771dd36f567ec43b345e26eb4aed1d82582fc9bf106ea3cab5beb617b0
MD5 e40a27534fd9d311f7432a9e5e0f5627
BLAKE2b-256 71f1d92e357911d3cdae06e9779d906c3ee1e8b7086a5392cc3a54d46445c0e7

See more details on using hashes here.

Supported by

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