reportree


Namereportree JSON
Version 0.0.9 PyPI version JSON
download
home_pageNone
SummaryReporTree produces nested static HTML reports with buttons to navigate through many optional subpages.
upload_time2024-10-25 21:35:35
maintainerNone
docs_urlNone
authorTomas Protivinsky
requires_python>=3.10
licenseNone
keywords plots matplotlib data science reports
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            |doc-badge|

..  |doc-badge| image:: https://github.com/protivinsky/reportree/actions/workflows/builddoc.yaml/badge.svg
    :alt: doc
    :target: https://protivinsky.github.io/reportree/index.html

ReporTree: Nested HTML reports for Matplotlib
=============================================

ReporTree produces nested static HTML reports with buttons to navigate through many nested pages.

.. warning::
    The old approach that relied on loading local content via javascript was removed and all the nested subpages are
    stored in a single html file, even with charts embedded as base64 in version 0.0.9.

    The documentation has not been fully updated yet. The previous version 0.0.4 fully supports the old approach.
    I will update the package to version 0.1.0 after fixing documentation and cleanup.

Older version
-------------

The package can easily produce reports with many nested levels and hundreds of Matplotlib plots.

.. warning::
    The selection of pages in nested reports works correctly only when served from the webserver (even the Python one
    works fine for local development, `python -m http.server`).

    The selection is done via Javascript and the targets are loaded on the fly. When the reports are
    displayed locally, different files are considered as Cross-Origin access and the loading is blocked
    by the browser. Single page reports (i.e. Leaves) work fine.

    This issue can be solved by using Mozilla Firefox for local browsing with changing
    `security.fileuri.strict_origin_policy` to `false` (in `about:config`).

Basic example
-------------

.. code:: python

    import reportree as rt
    import seaborn as sns
    import matplotlib.pyplot as plt
    import numpy as np


    fig1, ax1 = plt.subplots()
    sns.lineplot(x=np.arange(10), y=np.arange(10), marker='o', ax=ax1, color='red')
    ax1.set_title('Upward')

    fig2, ax2 = plt.subplots()
    sns.lineplot(x=np.arange(10), y=np.arange(10, 0, -1), marker='o', ax=ax2, color='blue')
    ax2.set_title('Downward')

    l1 = rt.Leaf([fig1, fig2], title='Leaf example')
    l1.save('/tmp/example1')

    l2 = rt.Leaf(fig1, title='Only upward')
    l3 = rt.Leaf(fig2, title='Only downward')

    b1 = rt.Branch([l1, l2, l3], title='Branch example')
    b1.save('/tmp/example2')

    b2 = rt.Branch([rt.Branch([b1, l1]), l2, l3, b1], title='Nested example')
    b2.save('/tmp/example3')

The code produces following reports:

Leaf example
............

.. image:: https://raw.githubusercontent.com/protivinsky/reportree/main/doc/images/example1.png
  :width: 1000
  :alt: Example 1

Branch example
..............

.. image:: https://raw.githubusercontent.com/protivinsky/reportree/main/doc/images/example2.png
  :width: 1000
  :alt: Example 2

Nested example
..............

.. image:: https://raw.githubusercontent.com/protivinsky/reportree/main/doc/images/example3.png
  :width: 1000
  :alt: Example 3



            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "reportree",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "plots, matplotlib, data science, reports",
    "author": "Tomas Protivinsky",
    "author_email": "tomas.protivinsky@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/40/71/c3996a3f41b227b0f5b8113d3a23423551f79b3521a8dc1e761b3b6a8dc8/reportree-0.0.9.tar.gz",
    "platform": null,
    "description": "|doc-badge|\n\n..  |doc-badge| image:: https://github.com/protivinsky/reportree/actions/workflows/builddoc.yaml/badge.svg\n    :alt: doc\n    :target: https://protivinsky.github.io/reportree/index.html\n\nReporTree: Nested HTML reports for Matplotlib\n=============================================\n\nReporTree produces nested static HTML reports with buttons to navigate through many nested pages.\n\n.. warning::\n    The old approach that relied on loading local content via javascript was removed and all the nested subpages are\n    stored in a single html file, even with charts embedded as base64 in version 0.0.9.\n\n    The documentation has not been fully updated yet. The previous version 0.0.4 fully supports the old approach.\n    I will update the package to version 0.1.0 after fixing documentation and cleanup.\n\nOlder version\n-------------\n\nThe package can easily produce reports with many nested levels and hundreds of Matplotlib plots.\n\n.. warning::\n    The selection of pages in nested reports works correctly only when served from the webserver (even the Python one\n    works fine for local development, `python -m http.server`).\n\n    The selection is done via Javascript and the targets are loaded on the fly. When the reports are\n    displayed locally, different files are considered as Cross-Origin access and the loading is blocked\n    by the browser. Single page reports (i.e. Leaves) work fine.\n\n    This issue can be solved by using Mozilla Firefox for local browsing with changing\n    `security.fileuri.strict_origin_policy` to `false` (in `about:config`).\n\nBasic example\n-------------\n\n.. code:: python\n\n    import reportree as rt\n    import seaborn as sns\n    import matplotlib.pyplot as plt\n    import numpy as np\n\n\n    fig1, ax1 = plt.subplots()\n    sns.lineplot(x=np.arange(10), y=np.arange(10), marker='o', ax=ax1, color='red')\n    ax1.set_title('Upward')\n\n    fig2, ax2 = plt.subplots()\n    sns.lineplot(x=np.arange(10), y=np.arange(10, 0, -1), marker='o', ax=ax2, color='blue')\n    ax2.set_title('Downward')\n\n    l1 = rt.Leaf([fig1, fig2], title='Leaf example')\n    l1.save('/tmp/example1')\n\n    l2 = rt.Leaf(fig1, title='Only upward')\n    l3 = rt.Leaf(fig2, title='Only downward')\n\n    b1 = rt.Branch([l1, l2, l3], title='Branch example')\n    b1.save('/tmp/example2')\n\n    b2 = rt.Branch([rt.Branch([b1, l1]), l2, l3, b1], title='Nested example')\n    b2.save('/tmp/example3')\n\nThe code produces following reports:\n\nLeaf example\n............\n\n.. image:: https://raw.githubusercontent.com/protivinsky/reportree/main/doc/images/example1.png\n  :width: 1000\n  :alt: Example 1\n\nBranch example\n..............\n\n.. image:: https://raw.githubusercontent.com/protivinsky/reportree/main/doc/images/example2.png\n  :width: 1000\n  :alt: Example 2\n\nNested example\n..............\n\n.. image:: https://raw.githubusercontent.com/protivinsky/reportree/main/doc/images/example3.png\n  :width: 1000\n  :alt: Example 3\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "ReporTree produces nested static HTML reports with buttons to navigate through many optional subpages.",
    "version": "0.0.9",
    "project_urls": {
        "Documentation": "https://protivinsky.github.io/reportree",
        "Homepage": "https://github.com/protivinsky/reportree"
    },
    "split_keywords": [
        "plots",
        " matplotlib",
        " data science",
        " reports"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "579456c1ba90dfeaf124fa3d165ef2a43a95e654e0ca098c8d4956c6edff667e",
                "md5": "fb9f1f9cb10165b1928b2866032cefbc",
                "sha256": "0b2aa57389b7ce378ccbef89519af993ecba4d739217c61cb15839e56e6fd880"
            },
            "downloads": -1,
            "filename": "reportree-0.0.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fb9f1f9cb10165b1928b2866032cefbc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 12025,
            "upload_time": "2024-10-25T21:35:33",
            "upload_time_iso_8601": "2024-10-25T21:35:33.081347Z",
            "url": "https://files.pythonhosted.org/packages/57/94/56c1ba90dfeaf124fa3d165ef2a43a95e654e0ca098c8d4956c6edff667e/reportree-0.0.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4071c3996a3f41b227b0f5b8113d3a23423551f79b3521a8dc1e761b3b6a8dc8",
                "md5": "7f13f9eae3c79e12ab55f6ec2aa36f21",
                "sha256": "65ca4ea5b7550a334db0923cc476bf5d38b18b44c18ff29a10bfe808034bfad5"
            },
            "downloads": -1,
            "filename": "reportree-0.0.9.tar.gz",
            "has_sig": false,
            "md5_digest": "7f13f9eae3c79e12ab55f6ec2aa36f21",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 10893,
            "upload_time": "2024-10-25T21:35:35",
            "upload_time_iso_8601": "2024-10-25T21:35:35.091263Z",
            "url": "https://files.pythonhosted.org/packages/40/71/c3996a3f41b227b0f5b8113d3a23423551f79b3521a8dc1e761b3b6a8dc8/reportree-0.0.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-25 21:35:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "protivinsky",
    "github_project": "reportree",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "reportree"
}
        
Elapsed time: 0.34964s