runtime-reporting-utils 0.1.2
Python module for reporting runtime metadata.
Requires Python: >=3.10
Keywords: runtime_reporting_utils

=======================
Runtime Reporting Utils
=======================


Python module for reporting runtime metadata.


Usage
-----

.. code-block:: python

    from runtime_reporting_utils import RuntimeReporter

    rr = RuntimeReporter()

    rr.add_file(file=logfile, name="log file")
    rr.add_file(file=config_file, name="configuration file")
    rr.add_file(file=outfile, name="main output file")

    rr.count(name="gene", desc="Number of genes processed")
    rr.count(name="missing-annotation", desc="Number of genes that do not have annotation")

    # Set the output directory.
    # Default will be /tmp/[USER]/runtime-reporting-utils/[basename of executable]/YYYY-MM-DD-HHMMSS/
    rr.outdir(outdir)

    rr.generate_report()
    # The RuntimeReport will write the runtime report to the output directory.
    # The file will be named report.json.

Invocation:

.. code-block:: shell

    python main.py
    Runtime report written to /tmp/sundaram/runtime-reporting-utils/main.py/2025-02-15-084121/report.json
    Execution completed: '/tmp/runtime-reporting-utils-test/main.py'

Contents of runtime report file:

.. code-block:: json

    {
        "provenance": {
            "executable": "/tmp/runtime-reporting-utils-test/main.py",
            "hostname": "MSI",
            "outdir": "/tmp/sundaram/runtime-reporting-utils/main.py/2025-02-15-084121",
            "username": "sundaram",
            "start_time": "2025-02-15T08:41:21.573171",
            "end_time": "2025-02-15T08:41:21.575894",
            "elapsed_time": "0:00:00.002726"
        },
        "command-line arguments": [],
        "counters": {
            "gene": {
                "count": 3,
                "desc": "Number of genes processed"
            },
            "missing-annotation": {
                "count": 1,
                "desc": "Number of genes that do not have annotation"
            }
        },
        "files": {
            "/tmp/runtime-reporting-utils-test/log.txt": {
                "path": "/tmp/runtime-reporting-utils-test/log.txt",
                "name": "log file",
                "bytesize": 12,
                "is_binary": false,
                "line_count": 1,
                "md5sum": "e59ff97941044f85df5297e1c302d260"
            },
            "/tmp/runtime-reporting-utils-test/conf/config.yaml": {
                "path": "/tmp/runtime-reporting-utils-test/conf/config.yaml",
                "name": "configuration file",
                "bytesize": 64,
                "is_binary": false,
                "line_count": 6,
                "md5sum": "910974117394282bc6997ddfeb2cfa68"
            },
            "/tmp/runtime-reporting-utils-test/output.txt": {
                "path": "/tmp/runtime-reporting-utils-test/output.txt",
                "name": "main output file",
                "bytesize": 37,
                "is_binary": false,
                "line_count": 1,
                "md5sum": "3babe83376c82b909666b064284024d2"
            }
        }
    }


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

0.1.0 (2025-02-08)
------------------

* First release on PyPI.