hpp2plantuml


Namehpp2plantuml JSON
Version 0.8.6 PyPI version JSON
download
home_pagehttps://github.com/thibaultmarin/hpp2plantuml
SummaryConvert C++ header files to PlantUML
upload_time2024-12-01 23:46:54
maintainerThibault Marin
docs_urlNone
authorThibault Marin
requires_pythonNone
licenseMIT
keywords class
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            hpp2plantuml - Convert C++ header files to PlantUML
===================================================

.. _sec-intro:

Motivation
----------

The purpose of this tool is to convert C++ header files to a UML representation
in `PlantUML <https://plantuml.com>`_ syntax that can be used to generate diagrams with PlantUML.

`PlantUML <https://plantuml.com>`_ is a program rendering UML diagrams from plain text inputs using an
expressive language.

This package generates the text input to PlantUML from C++ header files.  Its
ambition is limited but it should produce reasonable conversion for simple class
hierarchies.  It aims at supporting:

- class members with properties (``private``, ``method``, ``protected``), methods with
  basic qualifiers (``static``, abstract),

- inheritance relationships,

- aggregation relationships (very basic support).

- dependency relationships

The package relies on the `CppHeaderParser <https://pypi.org/project/robotpy-cppheaderparser/>`_ package for parsing of C++ header
files.


.. _sec-module-usage:

Usage
-----

The ``hpp2plantuml`` package can be used from the command line or as a module in
other applications.

Command line
~~~~~~~~~~~~

The command line usage is (``hpp2plantuml --help``):


::

    usage: hpp2plantuml [-h] -i HEADER-FILE [-o FILE] [-d] [-t JINJA-FILE]
                        [--version]

    hpp2plantuml tool.

    optional arguments:
      -h, --help            show this help message and exit
      -i HEADER-FILE, --input-file HEADER-FILE
                            input file (must be quoted when using wildcards)
      -o FILE, --output-file FILE
                            output file
      -d, --enable-dependency
                            Extract dependency relationships from method arguments
      -t JINJA-FILE, --template-file JINJA-FILE
                            path to jinja2 template file
      --version             show program's version number and exit


Input files are added using the ``-i`` option.  Inputs can be full file paths or
include wildcards.  Note that double quotes are required when using wildcards.
The output file is selected with the ``-o`` option.  The output is a text file
following the PlantUML syntax.

For instance, the following command will generate an input file for PlantUML
(``output.puml``) from several header files.

.. code:: sh
    :name: usage-sh

    hpp2plantuml -i File_1.hpp -i "include/Helper_*.hpp" -o output.puml

To customize the output PlantUML file, templates can be used (using the ``-t``
parameter):

.. code:: sh
    :name: usage-sh-template

    hpp2plantuml -i File_1.hpp -i "include/Helper_*.hpp" -o output.puml -t template.puml

This will use the ``template.puml`` file as template.  Templates follow the `jinja <http://jinja.pocoo.org/>`_
syntax.  For instance, to add a preamble to the PlantUML output, the template
file may contain:

::

    {% extends 'default.puml' %}

    {% block preamble %}
    title "This is a title"
    skinparam backgroundColor #EEEBDC
    skinparam handwritten true
    {% endblock %}

This will inherit from the default template and override the preamble only.

Module
~~~~~~

To use as a module, simply ``import hpp2plantuml``.  The ``CreatePlantUMLFile``
function can then be used to create a PlantUML file from a set of input files.
Alternatively, the ``Diagram`` object can be used directly to build internal
objects (from files or strings).  The ``Diagram.render()`` method can be used to
produce a string output instead of writing to a text file.  See the API
documentation for more details.


.. _sec-module-install:

Installation
------------

Using ``pip``
~~~~~~~~~~~~~

The package is available on `PyPi <https://pypi.python.org/>`_ and can be installed using pip:

::

    pip install hpp2plantuml

From source
~~~~~~~~~~~

The code uses ``setuptools``, so it can be built using:

::

    python setup.py install

To build the documentation, run:

::

    python setup.py sphinx

To run the tests, run:

::

    python setup.py test


The full documentation is available via:

- `This org-mode post <https://thibaultmarin.github.io/blog/posts/2016-11-30-hpp2plantuml_-_Convert_C++_header_files_to_PlantUML.html>`_
- `Read the docs <http://hpp2plantuml.readthedocs.io/en/latest/>`_

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/thibaultmarin/hpp2plantuml",
    "name": "hpp2plantuml",
    "maintainer": "Thibault Marin",
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": "thibault.marin@gmx.com",
    "keywords": "class",
    "author": "Thibault Marin",
    "author_email": "thibault.marin@gmx.com",
    "download_url": null,
    "platform": null,
    "description": "hpp2plantuml - Convert C++ header files to PlantUML\n===================================================\n\n.. _sec-intro:\n\nMotivation\n----------\n\nThe purpose of this tool is to convert C++ header files to a UML representation\nin `PlantUML <https://plantuml.com>`_ syntax that can be used to generate diagrams with PlantUML.\n\n`PlantUML <https://plantuml.com>`_ is a program rendering UML diagrams from plain text inputs using an\nexpressive language.\n\nThis package generates the text input to PlantUML from C++ header files.  Its\nambition is limited but it should produce reasonable conversion for simple class\nhierarchies.  It aims at supporting:\n\n- class members with properties (``private``, ``method``, ``protected``), methods with\n  basic qualifiers (``static``, abstract),\n\n- inheritance relationships,\n\n- aggregation relationships (very basic support).\n\n- dependency relationships\n\nThe package relies on the `CppHeaderParser <https://pypi.org/project/robotpy-cppheaderparser/>`_ package for parsing of C++ header\nfiles.\n\n\n.. _sec-module-usage:\n\nUsage\n-----\n\nThe ``hpp2plantuml`` package can be used from the command line or as a module in\nother applications.\n\nCommand line\n~~~~~~~~~~~~\n\nThe command line usage is (``hpp2plantuml --help``):\n\n\n::\n\n    usage: hpp2plantuml [-h] -i HEADER-FILE [-o FILE] [-d] [-t JINJA-FILE]\n                        [--version]\n\n    hpp2plantuml tool.\n\n    optional arguments:\n      -h, --help            show this help message and exit\n      -i HEADER-FILE, --input-file HEADER-FILE\n                            input file (must be quoted when using wildcards)\n      -o FILE, --output-file FILE\n                            output file\n      -d, --enable-dependency\n                            Extract dependency relationships from method arguments\n      -t JINJA-FILE, --template-file JINJA-FILE\n                            path to jinja2 template file\n      --version             show program's version number and exit\n\n\nInput files are added using the ``-i`` option.  Inputs can be full file paths or\ninclude wildcards.  Note that double quotes are required when using wildcards.\nThe output file is selected with the ``-o`` option.  The output is a text file\nfollowing the PlantUML syntax.\n\nFor instance, the following command will generate an input file for PlantUML\n(``output.puml``) from several header files.\n\n.. code:: sh\n    :name: usage-sh\n\n    hpp2plantuml -i File_1.hpp -i \"include/Helper_*.hpp\" -o output.puml\n\nTo customize the output PlantUML file, templates can be used (using the ``-t``\nparameter):\n\n.. code:: sh\n    :name: usage-sh-template\n\n    hpp2plantuml -i File_1.hpp -i \"include/Helper_*.hpp\" -o output.puml -t template.puml\n\nThis will use the ``template.puml`` file as template.  Templates follow the `jinja <http://jinja.pocoo.org/>`_\nsyntax.  For instance, to add a preamble to the PlantUML output, the template\nfile may contain:\n\n::\n\n    {% extends 'default.puml' %}\n\n    {% block preamble %}\n    title \"This is a title\"\n    skinparam backgroundColor #EEEBDC\n    skinparam handwritten true\n    {% endblock %}\n\nThis will inherit from the default template and override the preamble only.\n\nModule\n~~~~~~\n\nTo use as a module, simply ``import hpp2plantuml``.  The ``CreatePlantUMLFile``\nfunction can then be used to create a PlantUML file from a set of input files.\nAlternatively, the ``Diagram`` object can be used directly to build internal\nobjects (from files or strings).  The ``Diagram.render()`` method can be used to\nproduce a string output instead of writing to a text file.  See the API\ndocumentation for more details.\n\n\n.. _sec-module-install:\n\nInstallation\n------------\n\nUsing ``pip``\n~~~~~~~~~~~~~\n\nThe package is available on `PyPi <https://pypi.python.org/>`_ and can be installed using pip:\n\n::\n\n    pip install hpp2plantuml\n\nFrom source\n~~~~~~~~~~~\n\nThe code uses ``setuptools``, so it can be built using:\n\n::\n\n    python setup.py install\n\nTo build the documentation, run:\n\n::\n\n    python setup.py sphinx\n\nTo run the tests, run:\n\n::\n\n    python setup.py test\n\n\nThe full documentation is available via:\n\n- `This org-mode post <https://thibaultmarin.github.io/blog/posts/2016-11-30-hpp2plantuml_-_Convert_C++_header_files_to_PlantUML.html>`_\n- `Read the docs <http://hpp2plantuml.readthedocs.io/en/latest/>`_\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Convert C++ header files to PlantUML",
    "version": "0.8.6",
    "project_urls": {
        "Homepage": "https://github.com/thibaultmarin/hpp2plantuml"
    },
    "split_keywords": [
        "class"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "19c68211b9923e7bbca5f1868c2f37ddb1d97f010c24d0fdb12002466b8d9c95",
                "md5": "1b77d194116b9b5b9043258b7e55a3cb",
                "sha256": "f458200c33b15abe33d4305bbd82f2be0b3708282e163ab723813d50bc0bd3e4"
            },
            "downloads": -1,
            "filename": "hpp2plantuml-0.8.6-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1b77d194116b9b5b9043258b7e55a3cb",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 18237,
            "upload_time": "2024-12-01T23:46:54",
            "upload_time_iso_8601": "2024-12-01T23:46:54.765733Z",
            "url": "https://files.pythonhosted.org/packages/19/c6/8211b9923e7bbca5f1868c2f37ddb1d97f010c24d0fdb12002466b8d9c95/hpp2plantuml-0.8.6-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-01 23:46:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "thibaultmarin",
    "github_project": "hpp2plantuml",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "hpp2plantuml"
}
        
Elapsed time: 2.62404s