binheat


Namebinheat JSON
Version 0.2.2 PyPI version JSON
download
home_page
SummaryBinary heat map generator
upload_time2023-12-12 20:37:22
maintainer
docs_urlNone
author
requires_python>=3.7
license
keywords binary heat map heat map pdf
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. image:: https://www.repostatus.org/badges/latest/unsupported.svg
    :target: https://www.repostatus.org/#unsupported
    :alt: Project Status: Unsupported – The project has reached a stable,
          usable state but the author(s) have ceased all work on it. A new
          maintainer may be desired.

.. image:: https://img.shields.io/pypi/pyversions/binheat.svg
    :target: https://pypi.org/project/binheat/

.. image:: https://img.shields.io/github/license/jwodder/binheat.svg
    :target: https://opensource.org/licenses/MIT
    :alt: MIT License

`GitHub <https://github.com/jwodder/binheat>`_
| `PyPI <https://pypi.org/project/binheat/>`_
| `Issues <https://github.com/jwodder/binheat/issues>`_
| `Changelog <https://github.com/jwodder/binheat/blob/master/CHANGELOG.md>`_

``binheat`` converts a description of a binary relation into a PDF image of the
relation as a binary heat map (a.k.a. matrix display, adjacency matrix,
comparison chart, and probably a bunch of other names as well; see below for an
example).

Each line of the input (except for blank lines and comments, which are ignored)
must be of the form ``x<TAB>y<TAB>z...``, denoting pairs ``(x, y)``, ``(x,
z)``, etc. in the binary relation.

In the output table, the values from the first column of each input line become
the labels of the table's rows, and the values from the second input column
onwards become the labels of the table's columns.  This can be reversed with
the ``--transpose`` option.


Installation
============
``binheat`` requires Python 3.7 or higher.  Just use `pip
<https://pip.pypa.io>`_ for Python 3 (You have pip, right?) to install
``binheat`` and its dependencies::

    python3 -m pip install binheat


Usage
=====

::

    binheat [<OPTIONS>] [<infile> [<outfile>]]

Input is read from ``<infile>`` (defaulting to standard input), and the
resulting PDF is written to ``<outfile>`` (defaulting to ``<infile>`` with its
file extension changed to ``.pdf``, or to standard output if ``<infile>`` is
standard input).


Options
-------

-C FILE, --column-labels FILE
                        Use the lines in ``FILE`` (after discarding blank lines
                        & comments) in the order they appear as column labels
                        (or row labels if ``--transpose`` is in effect).  Any
                        pairs in the input whose second column does not appear
                        in ``FILE`` are discarded.

-F FONT, --font FONT    Typeset text in the given font.  ``FONT`` must be
                        either the name of a builtin PostScript font or the
                        path to a ``.ttf`` file.  By default, text is typeset
                        in Times-Roman.

-f SIZE, --font-size SIZE
                        Set the text size to ``SIZE`` (default 12).

-R FILE, --row-labels FILE
                        Use the lines in ``FILE`` (after discarding blank lines
                        & comments) in the order they appear as row labels (or
                        column labels if ``--transpose`` is in effect).  Any
                        pairs in the input whose first column does not appear
                        in ``FILE`` are discarded.

--sort, --no-sort       Whether to list labels in the output in lexical order
                        rather than in the order in which they appear in the
                        input file; default: ``--no-sort``

-T, --transpose         The output will be transposed — i.e., the first column
                        of the input will be used for the output table's column
                        labels, and the second input column onwards will be
                        used for the table's row labels.


Example
=======

The following input file::

    NUL (\0, 0x00)<TAB>iscntrl
    0x01..0x06<TAB>iscntrl
    BEL (\a, 0x07)<TAB>iscntrl
    BS (\b, 0x08)<TAB>iscntrl
    TAB (\t, 0x09)<TAB>iscntrl<TAB>isspace<TAB>isblank
    LF (\n, 0x0A)<TAB>iscntrl<TAB>isspace
    VT (\v, 0x0B)<TAB>iscntrl<TAB>isspace
    FF (\f, 0x0C)<TAB>iscntrl<TAB>isspace
    CR (\r, 0x0D)<TAB>iscntrl<TAB>isspace
    0x0E..0x1F<TAB>iscntrl
    SPACE (0x20)<TAB>isprint<TAB>isspace<TAB>isblank
    !"#$%&'()*+,-./<TAB>isprint<TAB>isgraph<TAB>ispunct
    0123456789<TAB>isprint<TAB>isgraph<TAB>isalnum<TAB>isdigit<TAB>isxdigit
    :;<=>?@<TAB>isprint<TAB>isgraph<TAB>ispunct
    ABCDEF<TAB>isprint<TAB>isgraph<TAB>isalnum<TAB>isalpha<TAB>isupper<TAB>isxdigit
    GHIJKLMNOPQRSTUVWXYZ<TAB>isprint<TAB>isgraph<TAB>isalnum<TAB>isalpha<TAB>isupper
    [\]^_`<TAB>isprint<TAB>isgraph<TAB>ispunct
    abcdef<TAB>isprint<TAB>isgraph<TAB>isalnum<TAB>isalpha<TAB>islower<TAB>isxdigit
    ghijklmnopqrstuvwxyz<TAB>isprint<TAB>isgraph<TAB>isalnum<TAB>isalpha<TAB>islower
    {|}~<TAB>isprint<TAB>isgraph<TAB>ispunct
    DEL (0x7F)<TAB>iscntrl

produces (using the default options) an output file that looks like this:

.. image:: https://github.com/jwodder/binheat/raw/master/examples/ctype.png

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "binheat",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "binary heat map,heat map,pdf",
    "author": "",
    "author_email": "John Thorvald Wodder II <binheat@varonathe.org>",
    "download_url": "https://files.pythonhosted.org/packages/4e/c7/23e428e446883ecc912df967c99336bf9040391c5413a24ec909baa334bc/binheat-0.2.2.tar.gz",
    "platform": null,
    "description": ".. image:: https://www.repostatus.org/badges/latest/unsupported.svg\n    :target: https://www.repostatus.org/#unsupported\n    :alt: Project Status: Unsupported \u2013 The project has reached a stable,\n          usable state but the author(s) have ceased all work on it. A new\n          maintainer may be desired.\n\n.. image:: https://img.shields.io/pypi/pyversions/binheat.svg\n    :target: https://pypi.org/project/binheat/\n\n.. image:: https://img.shields.io/github/license/jwodder/binheat.svg\n    :target: https://opensource.org/licenses/MIT\n    :alt: MIT License\n\n`GitHub <https://github.com/jwodder/binheat>`_\n| `PyPI <https://pypi.org/project/binheat/>`_\n| `Issues <https://github.com/jwodder/binheat/issues>`_\n| `Changelog <https://github.com/jwodder/binheat/blob/master/CHANGELOG.md>`_\n\n``binheat`` converts a description of a binary relation into a PDF image of the\nrelation as a binary heat map (a.k.a. matrix display, adjacency matrix,\ncomparison chart, and probably a bunch of other names as well; see below for an\nexample).\n\nEach line of the input (except for blank lines and comments, which are ignored)\nmust be of the form ``x<TAB>y<TAB>z...``, denoting pairs ``(x, y)``, ``(x,\nz)``, etc. in the binary relation.\n\nIn the output table, the values from the first column of each input line become\nthe labels of the table's rows, and the values from the second input column\nonwards become the labels of the table's columns.  This can be reversed with\nthe ``--transpose`` option.\n\n\nInstallation\n============\n``binheat`` requires Python 3.7 or higher.  Just use `pip\n<https://pip.pypa.io>`_ for Python 3 (You have pip, right?) to install\n``binheat`` and its dependencies::\n\n    python3 -m pip install binheat\n\n\nUsage\n=====\n\n::\n\n    binheat [<OPTIONS>] [<infile> [<outfile>]]\n\nInput is read from ``<infile>`` (defaulting to standard input), and the\nresulting PDF is written to ``<outfile>`` (defaulting to ``<infile>`` with its\nfile extension changed to ``.pdf``, or to standard output if ``<infile>`` is\nstandard input).\n\n\nOptions\n-------\n\n-C FILE, --column-labels FILE\n                        Use the lines in ``FILE`` (after discarding blank lines\n                        & comments) in the order they appear as column labels\n                        (or row labels if ``--transpose`` is in effect).  Any\n                        pairs in the input whose second column does not appear\n                        in ``FILE`` are discarded.\n\n-F FONT, --font FONT    Typeset text in the given font.  ``FONT`` must be\n                        either the name of a builtin PostScript font or the\n                        path to a ``.ttf`` file.  By default, text is typeset\n                        in Times-Roman.\n\n-f SIZE, --font-size SIZE\n                        Set the text size to ``SIZE`` (default 12).\n\n-R FILE, --row-labels FILE\n                        Use the lines in ``FILE`` (after discarding blank lines\n                        & comments) in the order they appear as row labels (or\n                        column labels if ``--transpose`` is in effect).  Any\n                        pairs in the input whose first column does not appear\n                        in ``FILE`` are discarded.\n\n--sort, --no-sort       Whether to list labels in the output in lexical order\n                        rather than in the order in which they appear in the\n                        input file; default: ``--no-sort``\n\n-T, --transpose         The output will be transposed \u2014 i.e., the first column\n                        of the input will be used for the output table's column\n                        labels, and the second input column onwards will be\n                        used for the table's row labels.\n\n\nExample\n=======\n\nThe following input file::\n\n    NUL (\\0, 0x00)<TAB>iscntrl\n    0x01..0x06<TAB>iscntrl\n    BEL (\\a, 0x07)<TAB>iscntrl\n    BS (\\b, 0x08)<TAB>iscntrl\n    TAB (\\t, 0x09)<TAB>iscntrl<TAB>isspace<TAB>isblank\n    LF (\\n, 0x0A)<TAB>iscntrl<TAB>isspace\n    VT (\\v, 0x0B)<TAB>iscntrl<TAB>isspace\n    FF (\\f, 0x0C)<TAB>iscntrl<TAB>isspace\n    CR (\\r, 0x0D)<TAB>iscntrl<TAB>isspace\n    0x0E..0x1F<TAB>iscntrl\n    SPACE (0x20)<TAB>isprint<TAB>isspace<TAB>isblank\n    !\"#$%&'()*+,-./<TAB>isprint<TAB>isgraph<TAB>ispunct\n    0123456789<TAB>isprint<TAB>isgraph<TAB>isalnum<TAB>isdigit<TAB>isxdigit\n    :;<=>?@<TAB>isprint<TAB>isgraph<TAB>ispunct\n    ABCDEF<TAB>isprint<TAB>isgraph<TAB>isalnum<TAB>isalpha<TAB>isupper<TAB>isxdigit\n    GHIJKLMNOPQRSTUVWXYZ<TAB>isprint<TAB>isgraph<TAB>isalnum<TAB>isalpha<TAB>isupper\n    [\\]^_`<TAB>isprint<TAB>isgraph<TAB>ispunct\n    abcdef<TAB>isprint<TAB>isgraph<TAB>isalnum<TAB>isalpha<TAB>islower<TAB>isxdigit\n    ghijklmnopqrstuvwxyz<TAB>isprint<TAB>isgraph<TAB>isalnum<TAB>isalpha<TAB>islower\n    {|}~<TAB>isprint<TAB>isgraph<TAB>ispunct\n    DEL (0x7F)<TAB>iscntrl\n\nproduces (using the default options) an output file that looks like this:\n\n.. image:: https://github.com/jwodder/binheat/raw/master/examples/ctype.png\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Binary heat map generator",
    "version": "0.2.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/jwodder/binheat/issues",
        "Source Code": "https://github.com/jwodder/binheat"
    },
    "split_keywords": [
        "binary heat map",
        "heat map",
        "pdf"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a37065305d7cf8408a82acacdee9b6cc8cc494acc031acfa5f3c0b9361f671f1",
                "md5": "9ba608aca3ab7399bfa425a23ee87c5e",
                "sha256": "e4d375b409b1cb784cff786f9b7180928d473496cf018cba1803fa7f5ebdf46c"
            },
            "downloads": -1,
            "filename": "binheat-0.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9ba608aca3ab7399bfa425a23ee87c5e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 7701,
            "upload_time": "2023-12-12T20:37:21",
            "upload_time_iso_8601": "2023-12-12T20:37:21.084329Z",
            "url": "https://files.pythonhosted.org/packages/a3/70/65305d7cf8408a82acacdee9b6cc8cc494acc031acfa5f3c0b9361f671f1/binheat-0.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4ec723e428e446883ecc912df967c99336bf9040391c5413a24ec909baa334bc",
                "md5": "da79d12e331e77376e941df6a6256d78",
                "sha256": "7020bb94871945ec831ce0a242c3c9de11d34d1c0339b95f2efc3f57df40385f"
            },
            "downloads": -1,
            "filename": "binheat-0.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "da79d12e331e77376e941df6a6256d78",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 131081,
            "upload_time": "2023-12-12T20:37:22",
            "upload_time_iso_8601": "2023-12-12T20:37:22.261792Z",
            "url": "https://files.pythonhosted.org/packages/4e/c7/23e428e446883ecc912df967c99336bf9040391c5413a24ec909baa334bc/binheat-0.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-12 20:37:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jwodder",
    "github_project": "binheat",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "tox": true,
    "lcname": "binheat"
}
        
Elapsed time: 0.21751s