Skip to main content

A Python client for the UDDR API.

Project description

uddr_client

A Python library for the UltraDDR API

Installation

The package can be installed using pip

pip install uddr_client

Setup

For ease of use, you can store your API key as an environment variable using the client's "setup" method.

import uddr_client
uddr_client.connect.setup('<your API key>')

Alternatively, you can pass the API key directly to the connection.

c = uddr_client.connect('<your API key>')

Usage

import uddr_client

c = uddr_client.connect() # Instantiates a new instance of the client which, by default, uses the API key
						  # stored in your environment

resp = c.reports()        # Call an endpoint
print(response)

Available methods

The client currently supports the following endpoints:

  • aggregates()
  • bar()
  • histogram()
  • summary()
  • report()
  • reports()
  • histogram_artifact()
  • logs()
  • passthrough()

Use Python's help function for more in-depth documentation on each method.

help(c.logs)

Response parsing

Aside from the report() endpoint (which returns an application/pdf), all methods produce a Response object which handles different outputs.

  • Response.xml(): Outputs the response in XML
  • Response.csv(): Outputs the response in CSV

The default is JSON.

Dependencies

  • pandas
  • xmltodict

License

This project is licensed under the terms of the MIT license. See LICENSE.md for more details.

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

uddr_client-0.1.0.tar.gz (8.7 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