Skip to main content

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, DEFAULT_WORKSPACE, TOKEN)

types = client.get_report_types()
print(types)

types_from_another_ws = client.get_report_types(26)
print(types_from_another_ws)

workspaces = client.get_workspaces()
print(workspaces)

reports = client.get_reports("other")
print(reports)

reports_from_another_ws = client.get_reports("showcase", 26)
print(reports_from_another_ws)

token = client.create_auth_token()
print(token)

temp_data = client.push_temporary_data({"title": {'value': '123 123 123 123'}})
print(temp_data)

# get tempDataId from temp_data
temp_data_id = temp_data['tempDataId']

# Generate a PDF report
pdf = client.get_pdf(160)
with open("./test1.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("./test2.pdf", 'wb') as pdf_file: pdf_file.write(pdf)

# Generate a PDF report from another WS
pdf = client.get_pdf(149, None, 26)
with open("./signature.pdf", 'wb') as pdf_file: pdf_file.write(pdf)

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

cxreports_api_client-0.0.3.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cxreports_api_client-0.0.3-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file cxreports_api_client-0.0.3.tar.gz.

File metadata

  • Download URL: cxreports_api_client-0.0.3.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for cxreports_api_client-0.0.3.tar.gz
Algorithm Hash digest
SHA256 7f2c12774e3ad3cb8b6ed3fd8a95f478dc1f1e9dae685832280cc81d2687948e
MD5 562b5baa3232aa7098348612d1aa5f57
BLAKE2b-256 f54df6ae1f9aa32e005bd0866eb5ff05ff7b0743eab1778747c59f4702025860

See more details on using hashes here.

File details

Details for the file cxreports_api_client-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for cxreports_api_client-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 84d0695d939df60611798b13c730906d7caa15197db934bde37e71ed47936934
MD5 61a0c13d327c0b082e70a019bfab2587
BLAKE2b-256 90058c6d5d128d9ae88186d23451361ce5fa7769a3068c388fafb7327dab7275

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