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 XMLResponse.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
File details
Details for the file uddr_client-0.1.0.tar.gz
.
File metadata
- Download URL: uddr_client-0.1.0.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d10786b38bd1926511531b00749db2521c321d0d94151f495d4ee9e594c12667 |
|
MD5 | 8c2cdac93622037c82949352be818fa3 |
|
BLAKE2b-256 | 3fd91b93251881d367a5ccd63323713ad06df23ba6f89b8467d93a5d070a4b25 |