Skip to main content

AgateReports

Pure Python engine to generate reports from JasperReports jrxml file.

Introduction

AgateReports is a pure Python tool to generate reports without extensive coding. It currently relies on Jaspersoft Studio https://sourceforge.net/projects/jasperstudio/ to graphically position reporting elements on a report layout.

overview

This package aims to be a solution to following users:

  • Python developers who want to create a report using GUI tool.

  • Users who want to modify existing reports without programming.

Differences with JasperReports

  • AgateReports use different components than JasperReports and there are minor differences. AgateReports components are based on modules such as ReportLab that are available in Python

  • AgateReports ia able to use .ttc fonts

  • Additional components available in Python are added. Currently, jrxml file must manually be edited to use these components. Furthermore, since JasperReports do not support these components, edited jrxml file can no longer be edited with Jaspersoft Studio. There is a plan to fork Jaspersoft Studio to support Python language syntax and these components.

Current Restrictions

  • AgateReports is still in initial development phase and does not provide all of JasperReports features.

  • Patterns, format, and Java classes specified in jrxml file need to be changed to Python equivalent. For example, “Current Date” needs to be converted from “new java.util.Date()” to “datatime.datetime.now()”

  • Currently, only MySQL, Postgresql, and csv file are supported as a datasource

  • Performance is slow for large data source.

Requirements

Python3.6 or above ReportLab Pillow MySQL Connector/Python psycopg2

Installation

AgateReports requires Pillow. If Pillow is not already installed, please install it with the following command.

pip install Pillow

AgateReports can be installed by the following command:

pip install agatereports

Getting Started

Please refer to the following github project for full documentation. https://github.com/ozawa-hi/agatereports

demos directory contains samples of jrxml files and Python scripts on how to use AgateReports.

Usage Sample

from agatereports.adapters import MysqlAdapter
from agatereports.basic_report import BasicReport

import logging
logger = logging.getLogger(__name__)


def datasource_mysql_sample():
    """
    MySQL data source sample.

    WARNING: Before running this sample, schema 'agatereports' must be create and populated.
    Run scripts in directory 'agatereports/tests/database/mysql' to create and populated database tables.

    CAUTION: Edit values of 'host' and 'port' to those in your environment.
     """
    logger.info('running datasource mysql sample')
    jrxml_filename = '../demos/jrxml/datasource_mysql.jrxml'  # input jrxml filename
    output_filename = '../demos/output/datasource_mysql.pdf'  # output pdf filename

    # MySQL datasource
    config = {'host': 'localhost', 'port': '3306', 'user': 'python', 'password': 'python', 'database': 'agatereports'}
    data_source = MysqlAdapter(**config)

    pdf_page = BasicReport(jrxml_filename=jrxml_filename, output_filename=output_filename, data_source=data_source)
    pdf_page.generate_report()


if __name__ == '__main__':
    datasource_mysql_sample()

END

Metadata

Release files for agatereports 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agatereports 0.0.1
File Size Uploaded Provenance Actions
agatereports-0.0.1.tar.gz 28.3 kB Without provenance Details for agatereports-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agatereports 0.0.1
File Interpreter ABI Platform Actions
agatereports-0.0.1-py3-none-any.whl Python 3 none any Details for agatereports-0.0.1-py3-none-any.whl

Total release size: 76.2 kB

Release files / agatereports-0.0.1.tar.gz

Download URL agatereports-0.0.1.tar.gz
Size 28.3 kB
Tags Source
SHA-256 checksum
How to use checksums
37dc9857cf9c3fb97017f722b0f8a1093cfd68d79d6c1701f8892eb9e65ee101
BLAKE2b-256 checksum
How to use checksums
4add77db481c6a26956641876d63dc339d5c6b02e13129d23bc0544b9d7f1ef6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

Release files / agatereports-0.0.1-py3-none-any.whl

Download URL agatereports-0.0.1-py3-none-any.whl
Size 47.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c07a5967cc5eb3d9c330f259eb254289c653e5850fc104fb282143aeb455598
BLAKE2b-256 checksum
How to use checksums
0dcc20dd4686538f2b5893addc9f7c7c68e0b251a0168b11120ac66f7eaf3cbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

Security for agatereports 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page