richreports


Namerichreports JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
SummaryLibrary that supports the construction of human-readable, interactive static analysis reports that consist of decorated concrete syntax representations of programs.
upload_time2024-03-31 18:27:06
maintainerNone
docs_urlNone
authorAndrei Lapets
requires_python>=3.7
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ===========
richreports
===========

Library that supports the construction of human-readable, interactive static analysis reports that consist of decorated concrete syntax representations of programs.

|pypi| |readthedocs| |actions| |coveralls|

.. |pypi| image:: https://badge.fury.io/py/richreports.svg#
   :target: https://badge.fury.io/py/richreports
   :alt: PyPI version and link.

.. |readthedocs| image:: https://readthedocs.org/projects/richreports/badge/?version=latest
   :target: https://richreports.readthedocs.io/en/latest/?badge=latest
   :alt: Read the Docs documentation status.

.. |actions| image:: https://github.com/reity/richreports-py/workflows/lint-test-cover-docs/badge.svg#
   :target: https://github.com/reity/richreports-py/actions/workflows/lint-test-cover-docs.yml
   :alt: GitHub Actions status.

.. |coveralls| image:: https://coveralls.io/repos/github/reity/richreports-py/badge.svg?branch=main
   :target: https://coveralls.io/github/reity/richreports-py?branch=main
   :alt: Coveralls test coverage summary.

Installation and Usage
----------------------
This library is available as a `package on PyPI <https://pypi.org/project/richreports>`__:

.. code-block:: bash

    python -m pip install richreports

The library can be imported in the usual way:

.. code-block:: python

    from richreports import *

Examples
^^^^^^^^

.. |report| replace:: ``report``
.. _report: https://richreports.readthedocs.io/en/0.2.0/_source/richreports.html#richreports.richreports.report

This library supports the enrichment of concrete syntax strings with delimiters. A |report|_ instance can be created from a concrete string and then enriched:

.. code-block:: python

    >>> r = report(
    ...    'def f(x, y):\n' +
    ...    '    return x + y'
    ... )
    >>> r.enrich((2, 11), (2, 15), '(', ')')
    >>> for line in r.render().split('\n'):
    ...     print(line)
    def f(x, y):
        return (x + y)

This makes it possible to succinctly build up reports that correspond to structured representation formats such as HTML:

.. code-block:: python

    >>> r.enrich((1, 0), (2, 15), '<b>', '</b>', True)
    >>> for line in r.render().split('\n'):
    ...     print(line)
    <b>def f(x, y):</b>
    <b>    return (x + y)</b>
    >>> r.enrich((1, 0), (2, 15), '<div>\n', '\n</div>')
    >>> for line in r.render().split('\n'):
    ...     print(line)
    <div>
    <b>def f(x, y):</b>
    <b>    return (x + y)</b>
    </div>

Development
-----------
All installation and development dependencies are fully specified in ``pyproject.toml``. The ``project.optional-dependencies`` object is used to `specify optional requirements <https://peps.python.org/pep-0621>`__ for various development tasks. This makes it possible to specify additional options (such as ``docs``, ``lint``, and so on) when performing installation using `pip <https://pypi.org/project/pip>`__:

.. code-block:: bash

    python -m pip install .[docs,lint]

Documentation
^^^^^^^^^^^^^
The documentation can be generated automatically from the source files using `Sphinx <https://www.sphinx-doc.org>`__:

.. code-block:: bash

    python -m pip install .[docs]
    cd docs
    sphinx-apidoc -f -E --templatedir=_templates -o _source .. && make html

Testing and Conventions
^^^^^^^^^^^^^^^^^^^^^^^
All unit tests are executed and their coverage is measured when using `pytest <https://docs.pytest.org>`__ (see the ``pyproject.toml`` file for configuration details):

.. code-block:: bash

    python -m pip install .[test]
    python -m pytest

Alternatively, all unit tests are included in the module itself and can be executed using `doctest <https://docs.python.org/3/library/doctest.html>`__:

.. code-block:: bash

    python src/richreports/richreports.py -v

Style conventions are enforced using `Pylint <https://pylint.readthedocs.io>`__:

.. code-block:: bash

    python -m pip install .[lint]
    python -m pylint src/richreports

Contributions
^^^^^^^^^^^^^
In order to contribute to the source code, open an issue or submit a pull request on the `GitHub page <https://github.com/lapets/richreports>`__ for this library.

Versioning
^^^^^^^^^^
Beginning with version 0.1.0, the version number format for this library and the changes to the library associated with version number increments conform with `Semantic Versioning 2.0.0 <https://semver.org/#semantic-versioning-200>`__.

Publishing
^^^^^^^^^^
This library can be published as a `package on PyPI <https://pypi.org/project/richreports>`__ by a package maintainer. First, install the dependencies required for packaging and publishing:

.. code-block:: bash

    python -m pip install .[publish]

Ensure that the correct version number appears in ``pyproject.toml``, and that any links in this README document to the Read the Docs documentation of this package (or its dependencies) have appropriate version numbers. Also ensure that the Read the Docs project for this library has an `automation rule <https://docs.readthedocs.io/en/stable/automation-rules.html>`__ that activates and sets as the default all tagged versions. Create and push a tag for this version (replacing ``?.?.?`` with the version number):

.. code-block:: bash

    git tag ?.?.?
    git push origin ?.?.?

Remove any old build/distribution files. Then, package the source into a distribution archive:

.. code-block:: bash

    rm -rf build dist src/*.egg-info
    python -m build --sdist --wheel .

Finally, upload the package distribution archive to `PyPI <https://pypi.org>`__:

.. code-block:: bash

    python -m twine upload dist/*

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "richreports",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": null,
    "author": "Andrei Lapets",
    "author_email": "a@lapets.io",
    "download_url": "https://files.pythonhosted.org/packages/71/9c/d00693f4f14ff9ff6c2cbf5df7e8a27bdecef25d3e70c28fa2eb2a271e0f/richreports-0.2.0.tar.gz",
    "platform": null,
    "description": "===========\r\nrichreports\r\n===========\r\n\r\nLibrary that supports the construction of human-readable, interactive static analysis reports that consist of decorated concrete syntax representations of programs.\r\n\r\n|pypi| |readthedocs| |actions| |coveralls|\r\n\r\n.. |pypi| image:: https://badge.fury.io/py/richreports.svg#\r\n   :target: https://badge.fury.io/py/richreports\r\n   :alt: PyPI version and link.\r\n\r\n.. |readthedocs| image:: https://readthedocs.org/projects/richreports/badge/?version=latest\r\n   :target: https://richreports.readthedocs.io/en/latest/?badge=latest\r\n   :alt: Read the Docs documentation status.\r\n\r\n.. |actions| image:: https://github.com/reity/richreports-py/workflows/lint-test-cover-docs/badge.svg#\r\n   :target: https://github.com/reity/richreports-py/actions/workflows/lint-test-cover-docs.yml\r\n   :alt: GitHub Actions status.\r\n\r\n.. |coveralls| image:: https://coveralls.io/repos/github/reity/richreports-py/badge.svg?branch=main\r\n   :target: https://coveralls.io/github/reity/richreports-py?branch=main\r\n   :alt: Coveralls test coverage summary.\r\n\r\nInstallation and Usage\r\n----------------------\r\nThis library is available as a `package on PyPI <https://pypi.org/project/richreports>`__:\r\n\r\n.. code-block:: bash\r\n\r\n    python -m pip install richreports\r\n\r\nThe library can be imported in the usual way:\r\n\r\n.. code-block:: python\r\n\r\n    from richreports import *\r\n\r\nExamples\r\n^^^^^^^^\r\n\r\n.. |report| replace:: ``report``\r\n.. _report: https://richreports.readthedocs.io/en/0.2.0/_source/richreports.html#richreports.richreports.report\r\n\r\nThis library supports the enrichment of concrete syntax strings with delimiters. A |report|_ instance can be created from a concrete string and then enriched:\r\n\r\n.. code-block:: python\r\n\r\n    >>> r = report(\r\n    ...    'def f(x, y):\\n' +\r\n    ...    '    return x + y'\r\n    ... )\r\n    >>> r.enrich((2, 11), (2, 15), '(', ')')\r\n    >>> for line in r.render().split('\\n'):\r\n    ...     print(line)\r\n    def f(x, y):\r\n        return (x + y)\r\n\r\nThis makes it possible to succinctly build up reports that correspond to structured representation formats such as HTML:\r\n\r\n.. code-block:: python\r\n\r\n    >>> r.enrich((1, 0), (2, 15), '<b>', '</b>', True)\r\n    >>> for line in r.render().split('\\n'):\r\n    ...     print(line)\r\n    <b>def f(x, y):</b>\r\n    <b>    return (x + y)</b>\r\n    >>> r.enrich((1, 0), (2, 15), '<div>\\n', '\\n</div>')\r\n    >>> for line in r.render().split('\\n'):\r\n    ...     print(line)\r\n    <div>\r\n    <b>def f(x, y):</b>\r\n    <b>    return (x + y)</b>\r\n    </div>\r\n\r\nDevelopment\r\n-----------\r\nAll installation and development dependencies are fully specified in ``pyproject.toml``. The ``project.optional-dependencies`` object is used to `specify optional requirements <https://peps.python.org/pep-0621>`__ for various development tasks. This makes it possible to specify additional options (such as ``docs``, ``lint``, and so on) when performing installation using `pip <https://pypi.org/project/pip>`__:\r\n\r\n.. code-block:: bash\r\n\r\n    python -m pip install .[docs,lint]\r\n\r\nDocumentation\r\n^^^^^^^^^^^^^\r\nThe documentation can be generated automatically from the source files using `Sphinx <https://www.sphinx-doc.org>`__:\r\n\r\n.. code-block:: bash\r\n\r\n    python -m pip install .[docs]\r\n    cd docs\r\n    sphinx-apidoc -f -E --templatedir=_templates -o _source .. && make html\r\n\r\nTesting and Conventions\r\n^^^^^^^^^^^^^^^^^^^^^^^\r\nAll unit tests are executed and their coverage is measured when using `pytest <https://docs.pytest.org>`__ (see the ``pyproject.toml`` file for configuration details):\r\n\r\n.. code-block:: bash\r\n\r\n    python -m pip install .[test]\r\n    python -m pytest\r\n\r\nAlternatively, all unit tests are included in the module itself and can be executed using `doctest <https://docs.python.org/3/library/doctest.html>`__:\r\n\r\n.. code-block:: bash\r\n\r\n    python src/richreports/richreports.py -v\r\n\r\nStyle conventions are enforced using `Pylint <https://pylint.readthedocs.io>`__:\r\n\r\n.. code-block:: bash\r\n\r\n    python -m pip install .[lint]\r\n    python -m pylint src/richreports\r\n\r\nContributions\r\n^^^^^^^^^^^^^\r\nIn order to contribute to the source code, open an issue or submit a pull request on the `GitHub page <https://github.com/lapets/richreports>`__ for this library.\r\n\r\nVersioning\r\n^^^^^^^^^^\r\nBeginning with version 0.1.0, the version number format for this library and the changes to the library associated with version number increments conform with `Semantic Versioning 2.0.0 <https://semver.org/#semantic-versioning-200>`__.\r\n\r\nPublishing\r\n^^^^^^^^^^\r\nThis library can be published as a `package on PyPI <https://pypi.org/project/richreports>`__ by a package maintainer. First, install the dependencies required for packaging and publishing:\r\n\r\n.. code-block:: bash\r\n\r\n    python -m pip install .[publish]\r\n\r\nEnsure that the correct version number appears in ``pyproject.toml``, and that any links in this README document to the Read the Docs documentation of this package (or its dependencies) have appropriate version numbers. Also ensure that the Read the Docs project for this library has an `automation rule <https://docs.readthedocs.io/en/stable/automation-rules.html>`__ that activates and sets as the default all tagged versions. Create and push a tag for this version (replacing ``?.?.?`` with the version number):\r\n\r\n.. code-block:: bash\r\n\r\n    git tag ?.?.?\r\n    git push origin ?.?.?\r\n\r\nRemove any old build/distribution files. Then, package the source into a distribution archive:\r\n\r\n.. code-block:: bash\r\n\r\n    rm -rf build dist src/*.egg-info\r\n    python -m build --sdist --wheel .\r\n\r\nFinally, upload the package distribution archive to `PyPI <https://pypi.org>`__:\r\n\r\n.. code-block:: bash\r\n\r\n    python -m twine upload dist/*\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Library that supports the construction of human-readable, interactive static analysis reports that consist of decorated concrete syntax representations of programs.",
    "version": "0.2.0",
    "project_urls": {
        "Documentation": "https://richreports.readthedocs.io",
        "Repository": "https://github.com/reity/richreports-py"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bbe56d9baab97743fab7c168d3ee330ebc1b3d6c90df37469a5ce4e3fa90f811",
                "md5": "c83c72c0690df0962af4a75f8af208ca",
                "sha256": "b99a4a0fb65d53f0d68e577518a89d5e098a9361a72fb1df7f8f0b9d4b6df2ac"
            },
            "downloads": -1,
            "filename": "richreports-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c83c72c0690df0962af4a75f8af208ca",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 7534,
            "upload_time": "2024-03-31T18:27:04",
            "upload_time_iso_8601": "2024-03-31T18:27:04.497487Z",
            "url": "https://files.pythonhosted.org/packages/bb/e5/6d9baab97743fab7c168d3ee330ebc1b3d6c90df37469a5ce4e3fa90f811/richreports-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "719cd00693f4f14ff9ff6c2cbf5df7e8a27bdecef25d3e70c28fa2eb2a271e0f",
                "md5": "2bf1679fa93fd774b0697b90b1891330",
                "sha256": "da06aea8aac6f66101eba7c057644ef002785d755d5001bbf8b9c6f7a2d480a4"
            },
            "downloads": -1,
            "filename": "richreports-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "2bf1679fa93fd774b0697b90b1891330",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 8930,
            "upload_time": "2024-03-31T18:27:06",
            "upload_time_iso_8601": "2024-03-31T18:27:06.143476Z",
            "url": "https://files.pythonhosted.org/packages/71/9c/d00693f4f14ff9ff6c2cbf5df7e8a27bdecef25d3e70c28fa2eb2a271e0f/richreports-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-31 18:27:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "reity",
    "github_project": "richreports-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "richreports"
}
        
Elapsed time: 0.77518s