report-generation-utils


Namereport-generation-utils JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://github.com/jai-python3/report-generation-utils
SummaryCollection of Python tools for generating reports in various formats.
upload_time2025-02-15 16:09:38
maintainerNone
docs_urlNone
authorJaideep Sundaram
requires_python>=3.10
licenseNone
keywords report_generation_utils
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =======================
Report Generation Utils
=======================

Collection of Python tools for generating reports in various formats.

Usage
-----

.. code-block:: python

    from report-generation-utils import ReportGeneratorManager

    config_file = "conf/config.yaml"
    config = yaml.safe_load(Path(config_file).read_text())

    # Path to your Jinja2 template file
    template_file = "templates/report_template_v1.txt"

    # Alternatively, can provide an HTML template.
    # See templates/report_template_v1.html and templates/report_template_v2.html

    manager = Manager(
        config=config,
        config_file=config_file,
        executable=os.path.abspath(__file__),
        logfile=logfile,
        outdir=outdir,
        outfile=outfile,
        template_file=template_file,
        verbose=verbose
    )

    manager.register_data_file(
        constants.DEFAULT_CONFIG_FILE,
        "The configuration file",
        "The YAML configuration file for this project."
    )

    manager.register_data_file(
        os.path.join(
            os.path.dirname(__file__),
            "constants.py"
        ),
        "The constants file",
        "The Python constants file for this project."
    )

    manager.add_runtime_parameter(
        "--logfile",
        os.path.abspath(logfile),
        "The log file",
        "The Python logging log file."
    )

    manager.add_runtime_parameter(
        "--template_file",
        os.path.abspath(template_file),
        "The template file",
        "The Python Jinja2 template file use to generate this report."
    )

    lookup = [
        {
            "key": "A",
            "val": "The first letter of the alphabet"
        },
        {
            "key": "B",
            "val": "The second letter of the alphabet"
        },
        {
            "key": "C",
            "val": "The third letter of the alphabet"
        }
    ]

    manager.generate_report(lookup)

Contents of the report file:
----------------------------

.. code-block:: text

    ##------------------------------------------------------------
    ## Summary
    ##------------------------------------------------------------

    Report Title: 
    Description: This is the batch analysis report.
    Report date: 2025-02-15-110523

      For research use only.

      Contact lab for patient sample identifier maps.

      For all questions, contact the Chief Medical Officer.


    ##------------------------------------------------------------
    ## Report Section
    ##------------------------------------------------------------


    A: The first letter of the alphabet

    B: The second letter of the alphabet

    C: The third letter of the alphabet


    ##------------------------------------------------------------
    ## Runtime Parameters Section
    ##------------------------------------------------------------


    Name: The log file
    Key: --logfile
    Value: /tmp/demo-report-generation-utils/generate_report.log
    Description: The Python logging log file.


    Name: The template file
    Key: --template_file
    Value: /tmp/demo-report-generation-utils/report_template_v1.txt
    Description: The Python Jinja2 template file use to generate this report.


    ##------------------------------------------------------------
    ## Data Files Section
    ##------------------------------------------------------------


    Name: The configuration file
    File: /tmp/report-generation-utils/venv/lib/python3.10/site-packages/report_generation_utils/conf/config.yaml
    Checksum: 1accb09b91be9ba593fcee7c28620ba0
    Description: The YAML configuration file for this project.


    Name: The constants file
    File: /tmp/report-generation-utils/venv/lib/python3.10/site-packages/report_generation_utils/constants.py
    Checksum: d8aeae3f93d45393681a0f956573a152
    Description: The Python constants file for this project.


    ##------------------------------------------------------------
    ## Miscellaneous
    ##------------------------------------------------------------

    Method Created: /tmp/report-generation-utils/venv/lib/python3.10/site-packages/report_generation_utils/generate_report.py
    Date Created: 2025-02-15-110523
    Created By: sundaram
    Logfile: /tmp/demo-report-generation-utils/generate_report.log
    Template File: /tmp/demo-report-generation-utils/report_template_v1.txt


=======
History
=======

0.1.0 (2024-03-14)
------------------

* First release on PyPI.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jai-python3/report-generation-utils",
    "name": "report-generation-utils",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "report_generation_utils",
    "author": "Jaideep Sundaram",
    "author_email": "jai.python3@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/16/c2/f1940c5d8dab617c475c2630b9186ac7845f23e357e7b938b45589d7b825/report_generation_utils-0.1.2.tar.gz",
    "platform": null,
    "description": "=======================\nReport Generation Utils\n=======================\n\nCollection of Python tools for generating reports in various formats.\n\nUsage\n-----\n\n.. code-block:: python\n\n    from report-generation-utils import ReportGeneratorManager\n\n    config_file = \"conf/config.yaml\"\n    config = yaml.safe_load(Path(config_file).read_text())\n\n    # Path to your Jinja2 template file\n    template_file = \"templates/report_template_v1.txt\"\n\n    # Alternatively, can provide an HTML template.\n    # See templates/report_template_v1.html and templates/report_template_v2.html\n\n    manager = Manager(\n        config=config,\n        config_file=config_file,\n        executable=os.path.abspath(__file__),\n        logfile=logfile,\n        outdir=outdir,\n        outfile=outfile,\n        template_file=template_file,\n        verbose=verbose\n    )\n\n    manager.register_data_file(\n        constants.DEFAULT_CONFIG_FILE,\n        \"The configuration file\",\n        \"The YAML configuration file for this project.\"\n    )\n\n    manager.register_data_file(\n        os.path.join(\n            os.path.dirname(__file__),\n            \"constants.py\"\n        ),\n        \"The constants file\",\n        \"The Python constants file for this project.\"\n    )\n\n    manager.add_runtime_parameter(\n        \"--logfile\",\n        os.path.abspath(logfile),\n        \"The log file\",\n        \"The Python logging log file.\"\n    )\n\n    manager.add_runtime_parameter(\n        \"--template_file\",\n        os.path.abspath(template_file),\n        \"The template file\",\n        \"The Python Jinja2 template file use to generate this report.\"\n    )\n\n    lookup = [\n        {\n            \"key\": \"A\",\n            \"val\": \"The first letter of the alphabet\"\n        },\n        {\n            \"key\": \"B\",\n            \"val\": \"The second letter of the alphabet\"\n        },\n        {\n            \"key\": \"C\",\n            \"val\": \"The third letter of the alphabet\"\n        }\n    ]\n\n    manager.generate_report(lookup)\n\nContents of the report file:\n----------------------------\n\n.. code-block:: text\n\n    ##------------------------------------------------------------\n    ## Summary\n    ##------------------------------------------------------------\n\n    Report Title: \n    Description: This is the batch analysis report.\n    Report date: 2025-02-15-110523\n\n      For research use only.\n\n      Contact lab for patient sample identifier maps.\n\n      For all questions, contact the Chief Medical Officer.\n\n\n    ##------------------------------------------------------------\n    ## Report Section\n    ##------------------------------------------------------------\n\n\n    A: The first letter of the alphabet\n\n    B: The second letter of the alphabet\n\n    C: The third letter of the alphabet\n\n\n    ##------------------------------------------------------------\n    ## Runtime Parameters Section\n    ##------------------------------------------------------------\n\n\n    Name: The log file\n    Key: --logfile\n    Value: /tmp/demo-report-generation-utils/generate_report.log\n    Description: The Python logging log file.\n\n\n    Name: The template file\n    Key: --template_file\n    Value: /tmp/demo-report-generation-utils/report_template_v1.txt\n    Description: The Python Jinja2 template file use to generate this report.\n\n\n    ##------------------------------------------------------------\n    ## Data Files Section\n    ##------------------------------------------------------------\n\n\n    Name: The configuration file\n    File: /tmp/report-generation-utils/venv/lib/python3.10/site-packages/report_generation_utils/conf/config.yaml\n    Checksum: 1accb09b91be9ba593fcee7c28620ba0\n    Description: The YAML configuration file for this project.\n\n\n    Name: The constants file\n    File: /tmp/report-generation-utils/venv/lib/python3.10/site-packages/report_generation_utils/constants.py\n    Checksum: d8aeae3f93d45393681a0f956573a152\n    Description: The Python constants file for this project.\n\n\n    ##------------------------------------------------------------\n    ## Miscellaneous\n    ##------------------------------------------------------------\n\n    Method Created: /tmp/report-generation-utils/venv/lib/python3.10/site-packages/report_generation_utils/generate_report.py\n    Date Created: 2025-02-15-110523\n    Created By: sundaram\n    Logfile: /tmp/demo-report-generation-utils/generate_report.log\n    Template File: /tmp/demo-report-generation-utils/report_template_v1.txt\n\n\n=======\nHistory\n=======\n\n0.1.0 (2024-03-14)\n------------------\n\n* First release on PyPI.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Collection of Python tools for generating reports in various formats.",
    "version": "0.1.2",
    "project_urls": {
        "Homepage": "https://github.com/jai-python3/report-generation-utils"
    },
    "split_keywords": [
        "report_generation_utils"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "490747bc5e836cb631083ad177912eafb967a49635ad30dca56444358ae8a960",
                "md5": "c3ea17338f4054e16d3392cd2112ca18",
                "sha256": "fff2521471ecfcaa12ce5b9fb05ea91f6551a84bf37af89f25e63d87a7cad152"
            },
            "downloads": -1,
            "filename": "report_generation_utils-0.1.2-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c3ea17338f4054e16d3392cd2112ca18",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.10",
            "size": 15020,
            "upload_time": "2025-02-15T16:09:36",
            "upload_time_iso_8601": "2025-02-15T16:09:36.619406Z",
            "url": "https://files.pythonhosted.org/packages/49/07/47bc5e836cb631083ad177912eafb967a49635ad30dca56444358ae8a960/report_generation_utils-0.1.2-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "16c2f1940c5d8dab617c475c2630b9186ac7845f23e357e7b938b45589d7b825",
                "md5": "d1e28c5e618a5c08de4266473ed124ea",
                "sha256": "06700a629243d8f1295c88f78b7abbca3a0a42a9f64d6a52d18e90176f92200e"
            },
            "downloads": -1,
            "filename": "report_generation_utils-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "d1e28c5e618a5c08de4266473ed124ea",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 18303,
            "upload_time": "2025-02-15T16:09:38",
            "upload_time_iso_8601": "2025-02-15T16:09:38.394496Z",
            "url": "https://files.pythonhosted.org/packages/16/c2/f1940c5d8dab617c475c2630b9186ac7845f23e357e7b938b45589d7b825/report_generation_utils-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-15 16:09:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jai-python3",
    "github_project": "report-generation-utils",
    "github_not_found": true,
    "lcname": "report-generation-utils"
}
        
Elapsed time: 2.10660s