{ "info": { "author": "Jeff Portwood - Graphiq Data Engineering", "author_email": "jportwood@graphiq.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3" ], "description": "KettleParser\n============\n\n.. image:: https://travis-ci.org/graphiq-data/KettleParser.svg?branch=master\n :target: https://travis-ci.org/graphiq-data/KettleParser\n\n.. image:: https://badge.fury.io/py/KettleParser.svg\n :target: https://badge.fury.io/py/KettleParser\n\n.. contents::\n\n\nAbout\n-----\n\nKettleParser is a python library that parses Kettle XML files (.ktr and .kjb) for quick analysis. It takes in the XML metadata of a transformation or job and parses it so that you can easily access various attributes without the. You can get information on steps, hops, connections, and turn your transformation or job into a python graph object for structural analysis.\n\nUsage\n-----\n\nAll metadata for steps, hops, and connections can be accessed by calling the ``get_attribute`` method. Refer to following transformation and read through the examples below for more information.\n\n.. image:: https://github.com/graphiq-data/KettleParser/blob/master/tests/transformation_1/transformation_1.png?raw=true\n :width: 600 px\n :height: 341 px\n\nParsing\n~~~~~~~\n\nFor now, KettleParser only supports parsing complete Kettle files that are saved locally and not strings of raw XML. The\n``Parse`` class is the main class to parse your Kettle file (.ktr or .kjb). Just call the class and pass it the filepath to your Kettle file:\n\n.. code-block:: python\n\n >>> import KettleParser\n >>> my_transformation = KettleParser.Parse(\"/path/to/my_transformation.ktr\")\n\n\nSteps\n~~~~~\n\nAll steps in your transformation can be iterated on via the ``steps`` attribute:\n\n.. code-block:: python\n\n >>> for step in my_transformation.steps:\n ... step.get_attribute(\"name\")\n 'Text file input'\n ... step.get_attribute(\"type\")\n 'TextFileInput'\n\nEach type of step will have different attributes, but common attributes you'll like use are:\n\n* ``name``: Name of step -- this will be a unique value across all steps in the same transformation\n* ``type``: Type of step\n* ``copies``: Number of copies of that step launched (.ktr files only)\n\n\nTo filter by enabled or disabled steps use the ``get_enabled_steps()`` or ``get_disabled_steps()`` methods respectively.\n\nHops\n~~~~\n\nAll hops in your transformation can be iterated on via the ``hops`` attribute:\n\n.. code-block:: python\n\n >>> for hop in my_transformation.hops:\n ... hop.get_attribute(\"from\")\n 'Text file input'\n ... hop.get_attribute(\"to\")\n 'Select values'\n ... hop.get_attribute(\"enabled\")\n True\n\nEach individual hops contains three main attributes:\n\n* ``from``: Name of source step\n* ``to``: Name of target step\n* ``enabled``: Is the hop enabled? (Boolean)\n\nFor a transformation, the ``hops`` object contains all hops: both enabled and disabled, and including error handling (note that enabled/disabled and error handling are not mutually exclusive). To easily filter different types of hops, use the following methods:\n\n* ``get_enabled_hops()``: returns only hops that are enabled (including error handling)\n* ``get_disabled_hops()``: returns only hops that are disabled (including error handling)\n* ``get_error_hops()``: returns only hops that are error handling hops (including enabled and disabled)\n\n\nGraph\n~~~~~\n\nYou can also represent your transformation as a graph object by calling the KettleGraph class. This class takes in a list of hop objects to build the graph with.\n\n.. code-block:: python\n\n >>> import KettleParser\n >>> my_transformation = KettleParser.Parse(\"/path/to/my_transformation.ktr\")\n >>> my_graph = KettleParser.KettleGraph(my_transformation.hops)\n\nCall the ``graph`` attribute to get a python graph object:\n\n.. code-block:: python\n\n >>> my_graph.graph\n {'Text file input': ['Select values'],\n 'Filter rows': ['Dummy (do nothing)', 'Text file output'],\n 'Select values': ['Filter rows']}\n\nYou can also find all paths between two steps by using the ``find_all_paths()`` method and passing it to step names. This method is a generator, letting you iterate through all possible paths (please be aware that very complex transformations could have thousands of paths between steps):\n\n.. code-block:: python\n\n >>> paths = my_graph.find_all_paths(\"Text file input\", \"Text file output\")\n >>> paths.next()\n ['Text file input', 'Select values', 'Filter rows', 'Text file output']\n\nInstallation\n------------\n\nTo install KettleParser, simply:\n\n.. code-block:: bash\n\n pip install KettleParser\n\nIssues\n------\n\nPlease submit issues `here `_.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/graphiq-data/KettleParser", "keywords": "kettle pdi pentaho", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "KettleParser", "package_url": "https://pypi.org/project/KettleParser/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/KettleParser/", "project_urls": { "Homepage": "https://github.com/graphiq-data/KettleParser" }, "release_url": "https://pypi.org/project/KettleParser/1.0.2/", "requires_dist": null, "requires_python": "", "summary": "Library for parsing and analyzing Kettle XML files", "version": "1.0.2" }, "last_serial": 2210463, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "f39493854e9df6c04c9526b531560273", "sha256": "33632f77285a710a846b2c6266f7db020747aec602e1004d455115b66cf1fca3" }, "downloads": -1, "filename": "KettleParser-1.0.0-py2.7.egg", "has_sig": false, "md5_digest": "f39493854e9df6c04c9526b531560273", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 7417, "upload_time": "2016-07-01T23:13:50", "url": "https://files.pythonhosted.org/packages/e4/2f/cc6c963acdb39c1c02747a7145f5d6c443517c30e1cb8a88da58963e400e/KettleParser-1.0.0-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "58bead3aa29b2477786d784eabeede61", "sha256": "76537d6e018a22eb238c167350a5a924cd74066d2be81809a10f5bf955c54706" }, "downloads": -1, "filename": "KettleParser-1.0.0.tar.gz", "has_sig": false, "md5_digest": "58bead3aa29b2477786d784eabeede61", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10272, "upload_time": "2016-07-01T23:13:55", "url": "https://files.pythonhosted.org/packages/69/12/316e6f2cc5a380d60eef182eb11b0247a735770f82c74c9d6e9cbd1f67c5/KettleParser-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "0462159926b13b2fadcedf1232d32d92", "sha256": "cc171c2161d273194fb4dc79fb28dd5de3a8862fb484dc1be63100eb0b0092d7" }, "downloads": -1, "filename": "KettleParser-1.0.1.tar.gz", "has_sig": false, "md5_digest": "0462159926b13b2fadcedf1232d32d92", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5570, "upload_time": "2016-07-01T23:21:22", "url": "https://files.pythonhosted.org/packages/55/4b/78fabc4d3af37784d5cdccdeaa1e9366f0f29b7ed53aa39a515b34ef5872/KettleParser-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "b6438aa0eb6717bf2725b17c197e8739", "sha256": "5442b7a1c45a13488a348589f2e3e509c82239517d890ec4d3a2cb23c9d5a8e2" }, "downloads": -1, "filename": "KettleParser-1.0.2.tar.gz", "has_sig": false, "md5_digest": "b6438aa0eb6717bf2725b17c197e8739", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5605, "upload_time": "2016-07-08T17:42:03", "url": "https://files.pythonhosted.org/packages/74/d6/bbfa84a93bf2fd6ce34e2491cc5144c4d69c6d870e8dd921585c12c3f337/KettleParser-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b6438aa0eb6717bf2725b17c197e8739", "sha256": "5442b7a1c45a13488a348589f2e3e509c82239517d890ec4d3a2cb23c9d5a8e2" }, "downloads": -1, "filename": "KettleParser-1.0.2.tar.gz", "has_sig": false, "md5_digest": "b6438aa0eb6717bf2725b17c197e8739", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5605, "upload_time": "2016-07-08T17:42:03", "url": "https://files.pythonhosted.org/packages/74/d6/bbfa84a93bf2fd6ce34e2491cc5144c4d69c6d870e8dd921585c12c3f337/KettleParser-1.0.2.tar.gz" } ] }