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.4.tar.gz (3.9 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.4-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cxreports_api_client-0.0.4.tar.gz
  • Upload date:
  • Size: 3.9 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.4.tar.gz
Algorithm Hash digest
SHA256 a872c8e77408cf581c3a5b89e8b15122040d0028abdbb581463a230eadcbba51
MD5 d65c98ac69c5b26d8df10a6f77911f1f
BLAKE2b-256 90af161dff86bfa8ac95739fcedcd329c2e6b58372d0b33d214679c4b00ee0a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cxreports_api_client-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2223e565e138a07f26fc2fd86f90f078116caa1292064cdd62ac1c24712af2de
MD5 260554a49c22dd33ce4e7e65592def16
BLAKE2b-256 c3ff823379dc4b27f857558fb7c0ebb7489dc9f0629b45554b425e524cc74d2e

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