Connect to CxReports API from your application.
Project description
CxReportClientV1 Usage Example
cxreports-api-client
is a Python library that provides a simple and intuitive interface for interacting with the CxReports application’s API. This library allows you to perform various operations on CxReports, such as retrieving reports, sending data, and generating PDFs.
Usage
from cx_report_client import CxReportClientV1
# Initialize the client
client = CxReportClientV1(URL, WORKSPACE, TOKEN)
# Get report types
types = client.get_report_types()
# Get workspaces
workspaces = client.get_workspaces()
# Get reports for a specific type
reports = client.get_reports("other")
# Create an authentication token
token = client.create_auth_token()
# Push temporary data
temp_data = client.push_temporary_data({"title": {'value': '123 123 123 123'}})
# Extract the temporary data ID
temp_data_id = temp_data['tempDataId']
# Generate a PDF report
pdf = client.get_pdf(160)
with open("./test.pdf", 'wb') as pdf_file: pdf_file.write(pdf)
# Generate a PDF report with parameters (e.g., title)
pdf = client.get_pdf(160, {"tempDataId":temp_data_id,"params": {"title": "First page title"}})
with open("./test.pdf", 'wb') as pdf_file: pdf_file.write(pdf)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for cxreports_api_client-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dc602faed8d97233f9df1273d9869a6a18b21aa2aa71da8ac335203fbadbdfb |
|
MD5 | e2bffbd80ec49166ec02b31e80698fb9 |
|
BLAKE2b-256 | f9ce26306a26e61505ae6819d165a685a45537d28fdffc7374771c51ccdf7d57 |
Close
Hashes for cxreports_api_client-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6662bf6dfbd5d19ca9e335a1b1c85ef1e9d85a13b8112c3d5d111484eff37ae |
|
MD5 | efb6fe858b7a7748960db1be97859d55 |
|
BLAKE2b-256 | 84c18b63bba49749a65cec1ed1e761edb0c50d7e9c826572a987e1989e82dde8 |