{ "info": { "author": "Maikel Martens", "author_email": "maikel@martens.me", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python :: 3", "Topic :: Software Development :: Code Generators" ], "description": "\n.. image:: https://travis-ci.org/krukas/Mage2Gen.svg?branch=master\n :target: https://travis-ci.org/krukas/Mage2Gen\n \nMage2Gen\n========\nMage2Gen is a python library for generating Magento 2 modules. It is\nbuild to be extendable with snippets for creating more complex Magento 2\nmodules based on simple input.\n\nInstallation\n============\nTo install the Python library and the command line utility, run:\n\n sudo pip3 install mage2gen\n\nInteractive command line\n========================\nWith the mage2gen command line tool you can interactively create and generate Magento 2 modules.\nIf you have installed mage2gen for your whole system you can start it by running *mage2gen*.\nYou will be asked to give the module a package name, name and description:\n\n.. code:: bash\n\n bash> mage2gen\n Package name [Mage2gen]: Mage2gen\n Module name: Test\n Description: A Mage2Gen test module\n \n Type help or ? to list commands.\n (Mage2Gen) \n\nHelp\n~~~~\nYou can use *help* or *?* to show all available commands and *help * to show command specific help descriptions: \n\n.. code:: bash\n\n (Mage2Gen) help\n \n Documented commands (type help ):\n ========================================\n add exit generate help info list remove\n \n Undocumented commands:\n ======================\n EOF\n \n (Mage2Gen) help add\n Add a snippet to the module\n\nList snippets\n~~~~~~~~~~~~~\nWith the *list* command you get a list of all the available snippets you can add to your module:\n\n.. code:: bash\n\n (Mage2Gen) list\n console cronjob controller system plugin shipping install language observer payment\n\nAdd snippet\n~~~~~~~~~~~\nTo add a snippet you can use the *add * command, you can auto-complete a snippet name with TAB:\n\n.. code:: bash\n \n (Mage2Gen) add console\n Action name*: test\n Short description*: Test log command\n\nShow added snippets\n~~~~~~~~~~~~~~~~~~~\nWhen you have added multiple snippets and you want to see which snippets are added to the module you can use the *info* command to show an overview:\n\n.. code:: bash\n\n (Mage2Gen) info\n \n Mage2gen/Test\n \n Consoles\n \n Index Action name Short description \n --------------------------------------------------------------------------------\n 0 test Test log command \n --------------------------------------------------------------------------------\n\nRemove snippet\n~~~~~~~~~~~~~~\nWhen you want to remove an added snippet you can use the *remove * command, to remove the snippet from the module:\n\n.. code:: bash\n\n (Mage2Gen) remove console 0\n Removed Console snippet\n\nGenerate module\n~~~~~~~~~~~~~~~\nWhen you are ready with your module and added the snippets you want to use, you can generate the module with the *generate* command. If you are inside a Magento 2 project directory, it will select the default path for the module:\n\n.. code:: bash\n\n (Mage2Gen) generate\n Generate path [/media/data/Downloads/magento2/app/code]*: \n Path does not exist, do you want to create it? [y/N]: y\n Module (Mage2gen/Test) generated to: /media/data/Downloads/magento2/app/code\n\nExample usage library\n=====================\n\n.. code:: python\n\n from mage2gen import Module\n\n # Create a module (Module1) for the package (Mage2gen)\n module = Module('Mage2gen', 'Module1')\n\n # Generate module files to folder (to_folder)\n module.generate_module('to_folder')\n\nSnippets\n========\n\nMage2Gen has core classes for creating and merging PHP classes, XML\nfiles and static files. For generating a module you don't want to define\nyour PHP class or XML file for basic module concepts like observers,\nplugins or controllers. This is where snippets come in, which add these\nconcepts based on simple input. The currently supported snippets are\nlisted below. If you would like to add a snippet to Mage2Gen, simply fork this\nproject. Add your snippet or other improvements and create a pull request afterwards.\n\nController\n~~~~~~~~~~\n\nCreates a controller with block, layout.xml and template. Can create a\ncontroller for frontend and adminhtml.\n\nParams:\n-------\n- **(str) frontname:** frontame route for module \n- **(str) section:** subfolder in module/Controller \n- **(str) action:** action class \n- **(bool) adminhtml [False]:** if controller is used for adminhtml\n\nExample:\n--------\n.. code:: python\n\n from mage2gen.snippets import ControllerSnippet\n\n controller_snippet = ControllerSnippet(module)\n controller_snippet.add(frontname='mage2gen', section='order', action='json')\n\nPlugin\n~~~~~~\n\nCreates a plugin for a public method, link to Magento 2 `docs`_\n\nParams:\n-------\n- **(str) classname:** full class namespace of class with method \n- **(str) methodname:** method name of class \n- **(str) plugintype:** type for plugin (before, after or around) \n- **(bool) sortorder [10]:** the order the plugin is executed in respect to other plugins. \n- **(bool) disabled [False]:** disable a plugin\n\nExample:\n--------\n.. code:: python\n\n from mage2gen.snippets import PluginSnippet\n\n plugin_snippet = PluginSnippet(module)\n plugin_snippet.add('Magento\\Catalog\\Model\\Product', 'getName')\n\nObserver\n~~~~~~~~\n\nCreate an observer for an event\n\nParams:\n-------\n- **(str) event:** event name \n- **(int) scope [ObserverSnippet.SCOPE\\_ALL]:** handle observer for all (SCOPE\\_ALL), frontend (SCOPE\\_FRONTEND) or backend (SCOPE\\_ADMINHTML)\n\nExample:\n--------\n.. code:: python\n\n from mage2gen.snippets import ObserverSnippet\n\n observer_snippet = ObserverSnippet(module)\n observer_snippet.add('catalog_product_save_after')\n\nCreate a Snippet\n================\n\nYou can create your own snippets. If you would like to add a snippet to\nMage2Gen, simply fork this project. Add you snippet or other improvements\nand create a pull request afterwards. You can read this `blog`_ post for an how to guide on creating a snippet.\n\nBase snippet\n~~~~~~~~~~~~\n\n.. code:: python\n\n from mage2gen import Module, Phpclass, Phpmethod, Xmlnode, StaticFile, Snippet\n\n class CustomSnippet(Snippet):\n def add(self, **params):\n # create and add PHP classes, XML and static files to the module\n \n # Get module name (_)\n self.module_name\n \n # Add PHP class to module (You can add the same class with different \n # methods and attributes multiple times, Mage2Gen will merge them to \n # one class with all the methods and attributes).\n self.add_class(PhpClassObject)\n \n # Add XML to module (Same as with the PHP class, you can add multiple\n # XML nodes for the same file !important root node must be the same.\n # An XML node will be merged when the node name and the XML attributes \n # name or id are the same. When creating a node you can define which\n # attributes make the node unique, default is name and id).\n self.add_xml('full/path/to/xml/with/file/name', XmlNodeObject)\n \n # Add static file\n self.add_static_file('path/to/file/location', StaticFileObject)\n\nAdding a PHP class\n~~~~~~~~~~~~~~~~~~\n\nTODO\n\nAdding XML file\n~~~~~~~~~~~~~~~\n\nTODO\n\nAdding Static file\n~~~~~~~~~~~~~~~~~~\n\nTODO\n\nTODO\n====\n\n- Increase test coverage.\n- Adding more snippets:\n - Model attributes\n - Custom models with adminhtml grid\n - Adding fields to checkout process\n \nExample implementation:\n~~~~~~~~~~~~~~~~~~~~~~~\n\n- Interactive command line\n- Mage2gen Online Magento 2 Module Creator `mage2gen`_ \n\n.. _docs: http://devdocs.magento.com/guides/v2.0/extension-dev-guide/plugins.html\n.. _mage2gen: http://mage2gen.com\n.. _blog: http://martens.me/programming/how-to-make-a-mage2gen-snippet.html\n", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/krukas/Mage2Gen/releases/tag/2.3.3", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/krukas/Mage2Gen", "keywords": "Magento", "license": "GPL3", "maintainer": "", "maintainer_email": "", "name": "Mage2Gen", "package_url": "https://pypi.org/project/Mage2Gen/", "platform": "", "project_url": "https://pypi.org/project/Mage2Gen/", "project_urls": { "Download": "https://github.com/krukas/Mage2Gen/releases/tag/2.3.3", "Homepage": "https://github.com/krukas/Mage2Gen" }, "release_url": "https://pypi.org/project/Mage2Gen/2.3.3/", "requires_dist": null, "requires_python": "", "summary": "Magento 2 module generator", "version": "2.3.3" }, "last_serial": 5796811, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "efec70a739d56145a0cec60b3465b15f", "sha256": "0007c622f299b3867d5820c5afd930119680f4e5110d6d6952dbd7827d4a2f7d" }, "downloads": -1, "filename": "Mage2Gen-0.1.tar.gz", "has_sig": false, "md5_digest": "efec70a739d56145a0cec60b3465b15f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3327, "upload_time": "2016-05-20T11:52:48", "url": "https://files.pythonhosted.org/packages/2f/76/a49932a7585772790be3f572309b4a3cbb0e7731202073ba634f21fbfef2/Mage2Gen-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "f3e6f877e15bcfb4e4fc650ca73fb900", "sha256": "ea5c60de4cafdeccfebc19cea26325d08ab95c72582109953a0c25906088cac7" }, "downloads": -1, "filename": "Mage2Gen-0.2.tar.gz", "has_sig": false, "md5_digest": "f3e6f877e15bcfb4e4fc650ca73fb900", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4896, "upload_time": "2016-05-20T17:04:15", "url": "https://files.pythonhosted.org/packages/50/f1/6f2d49d610129c605cff4502454236e121d63a0fd7ef8b1f7cee71e4a481/Mage2Gen-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "bf6b4d4eb6d17c1ae98748135da9ebab", "sha256": "50cfeb9a020940285834d2efdab13585e39e4125ad07977210ae4ca4ec805e87" }, "downloads": -1, "filename": "Mage2Gen-0.3.tar.gz", "has_sig": false, "md5_digest": "bf6b4d4eb6d17c1ae98748135da9ebab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5097, "upload_time": "2016-05-27T10:04:20", "url": "https://files.pythonhosted.org/packages/da/3f/f95dd6d3069570083f608b3097386c417ed97375f07161d4947699cb9789/Mage2Gen-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "6df5339ca9b5cae7fa6bd672f53c95f1", "sha256": "7baa3235950c72567ba2631edc79449f58ed5c05b9d95c053a3d322a8e3a6088" }, "downloads": -1, "filename": "Mage2Gen-0.4.tar.gz", "has_sig": false, "md5_digest": "6df5339ca9b5cae7fa6bd672f53c95f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19234, "upload_time": "2016-06-22T19:23:18", "url": "https://files.pythonhosted.org/packages/a1/58/6b863e0cc1c44f6d884c0a1f7970f6ed18a426d795cf0a7c748ef2c3e857/Mage2Gen-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "4cf4d1867f7a9447fef8a49753c1247b", "sha256": "bd46b8863d1bbada217b16b922bbf0b2cc3ae4233ef4725e2e19827764d96ff2" }, "downloads": -1, "filename": "Mage2Gen-0.5.tar.gz", "has_sig": false, "md5_digest": "4cf4d1867f7a9447fef8a49753c1247b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20153, "upload_time": "2016-06-22T19:33:31", "url": "https://files.pythonhosted.org/packages/a3/ea/871011dad07fbe93cd82b5b9c05bc73f556a411f60ecb187b1a8cd74f9ae/Mage2Gen-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "a6843265b073e73c1875c1e92e589a88", "sha256": "b700bbb71d97533568e8729ccc3d4ec87d0e86a9944105c2829e1c26ca83540a" }, "downloads": -1, "filename": "Mage2Gen-0.6.tar.gz", "has_sig": false, "md5_digest": "a6843265b073e73c1875c1e92e589a88", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20688, "upload_time": "2016-07-09T15:26:24", "url": "https://files.pythonhosted.org/packages/b1/19/b02bc275c3b36fd48e47c7f3235b9af9d8e2b980b98f28cc5e3dd7c9ee73/Mage2Gen-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "1caea440325fd314a6026083746c7db6", "sha256": "42455bfa7ecea2715fcbf4d91c87b27b5208d6c588ff2b077e0ab5f95dc78d6b" }, "downloads": -1, "filename": "Mage2Gen-0.7.tar.gz", "has_sig": false, "md5_digest": "1caea440325fd314a6026083746c7db6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21700, "upload_time": "2016-07-09T16:40:16", "url": "https://files.pythonhosted.org/packages/b7/02/9b97c39d8544927da91441cd8c15a1597acbd2fdb576b6734f8ca6cad572/Mage2Gen-0.7.tar.gz" } ], "0.8": [ { "comment_text": "", "digests": { "md5": "5ff7b6ac634b1ecea4291d0c511c2769", "sha256": "ad51259f8fa8c4d7108cd140b1dc14587babe2999298df527474e4db5b70e9d5" }, "downloads": -1, "filename": "Mage2Gen-0.8.tar.gz", "has_sig": false, "md5_digest": "5ff7b6ac634b1ecea4291d0c511c2769", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 61804, "upload_time": "2016-12-01T16:48:43", "url": "https://files.pythonhosted.org/packages/75/a6/11b0a6139ca329281d5d431151d70752019e8b2d8238bce46e7ddd24a23a/Mage2Gen-0.8.tar.gz" } ], "0.9": [ { "comment_text": "", "digests": { "md5": "02d2f9e1724199b85d8803643e46bcfe", "sha256": "fa42d07c507f8890ca1699f95c885b324b7c1505a2adad12676620b0f0768216" }, "downloads": -1, "filename": "Mage2Gen-0.9.tar.gz", "has_sig": false, "md5_digest": "02d2f9e1724199b85d8803643e46bcfe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 65026, "upload_time": "2017-10-09T14:11:02", "url": "https://files.pythonhosted.org/packages/69/9c/3aba76735eeba4e9d517d7f7929d61194bdfb14625570e472c82c3560d6e/Mage2Gen-0.9.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "a10be516449c81e76e63b55ef8377ec4", "sha256": "60899de16874c6a61aa27e21965cd4c3cc187e573fd5bb2c3198d1624dda545b" }, "downloads": -1, "filename": "Mage2Gen-1.0.0.tar.gz", "has_sig": false, "md5_digest": "a10be516449c81e76e63b55ef8377ec4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 66342, "upload_time": "2018-06-04T19:30:53", "url": "https://files.pythonhosted.org/packages/9f/af/c041eca8445045a7bf75c2b157329f0105c2e88b81a1a2e6dc16592fdf80/Mage2Gen-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "3cea6d32b545b3182057fca1371bb074", "sha256": "59e340df64cea8afd49669e6a2ade24defcf05d4c501bc674bdc9e00fa4f5a17" }, "downloads": -1, "filename": "Mage2Gen-1.1.0.tar.gz", "has_sig": false, "md5_digest": "3cea6d32b545b3182057fca1371bb074", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 66662, "upload_time": "2018-07-27T11:44:59", "url": "https://files.pythonhosted.org/packages/40/42/911b1be33501ef3a58ecfa799da39549b1351c9fc3aeaad91ef468e653e1/Mage2Gen-1.1.0.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "a810af387acb4164d82396dd038e0788", "sha256": "fd5b09fbe83a8f3ecd078f10b5e37a184e47d2df3cda38487b7974e8189c0bb6" }, "downloads": -1, "filename": "Mage2Gen-2.0.0.tar.gz", "has_sig": false, "md5_digest": "a810af387acb4164d82396dd038e0788", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 66351, "upload_time": "2018-06-04T19:33:28", "url": "https://files.pythonhosted.org/packages/3f/42/e479cf8efc966dd9a144251535a534b9279b2e323473ec0c8b0b5d43d43c/Mage2Gen-2.0.0.tar.gz" } ], "2.1.0": [ { "comment_text": "", "digests": { "md5": "fe73a54db42a1345c20bf54967d3ab90", "sha256": "3de2fb13fb36b906edef735ae53da504eb4942fd197cd631cdf8652a2ce84dd4" }, "downloads": -1, "filename": "Mage2Gen-2.1.0.tar.gz", "has_sig": false, "md5_digest": "fe73a54db42a1345c20bf54967d3ab90", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 67404, "upload_time": "2018-07-27T11:42:58", "url": "https://files.pythonhosted.org/packages/fb/21/1802eff7264303d1e3b10cd7ca9f9932b6fc4257402f2612bd94673848f5/Mage2Gen-2.1.0.tar.gz" } ], "2.1.1": [ { "comment_text": "", "digests": { "md5": "60a9c8e54b811eb96c31aefcc654919b", "sha256": "fcbead53ca4742887d627d3223f11ca917e97163b6b22534e0ca557f8e078b7e" }, "downloads": -1, "filename": "Mage2Gen-2.1.1.tar.gz", "has_sig": false, "md5_digest": "60a9c8e54b811eb96c31aefcc654919b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 70098, "upload_time": "2019-09-07T17:29:31", "url": "https://files.pythonhosted.org/packages/33/30/e74098fe6d839640d06fdeeb534bee45350834544a9017b323e2b7504727/Mage2Gen-2.1.1.tar.gz" } ], "2.2.0": [ { "comment_text": "", "digests": { "md5": "93b378f7a25e64dac15fc770b1454f5b", "sha256": "37f80f7a61fcfbdee5847fc7b4fb1d18a6b43d8efd1c5ca78882ff312f7cbb0c" }, "downloads": -1, "filename": "Mage2Gen-2.2.0.tar.gz", "has_sig": false, "md5_digest": "93b378f7a25e64dac15fc770b1454f5b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 76713, "upload_time": "2019-09-07T17:22:30", "url": "https://files.pythonhosted.org/packages/20/7f/41e1244659f78fafa3da2e50150c5ecde049a9fa02d5f57c2b3a606fa0c6/Mage2Gen-2.2.0.tar.gz" } ], "2.2.1": [ { "comment_text": "", "digests": { "md5": "6881d25f9aebeefe491fa8f895557a2c", "sha256": "597c141692fb01739d692de6719f8d3ba79865788a697c5eb13401c4c3c6470f" }, "downloads": -1, "filename": "Mage2Gen-2.2.1.tar.gz", "has_sig": false, "md5_digest": "6881d25f9aebeefe491fa8f895557a2c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 79999, "upload_time": "2019-09-07T17:32:39", "url": "https://files.pythonhosted.org/packages/c8/29/9c38b890d7f41964a571e1621c420b2ed3254bf293f12980a7be1826f627/Mage2Gen-2.2.1.tar.gz" } ], "2.3.2": [ { "comment_text": "", "digests": { "md5": "429cf06c0f81c14f9a6f7726f9323169", "sha256": "c24c2cc64645506520860aae5878b6e4a25cbc86581c652b9dab2c5992a15901" }, "downloads": -1, "filename": "Mage2Gen-2.3.2.tar.gz", "has_sig": false, "md5_digest": "429cf06c0f81c14f9a6f7726f9323169", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 76708, "upload_time": "2019-09-07T17:25:26", "url": "https://files.pythonhosted.org/packages/aa/87/2fa1295c10c64ef1ae36a1463d3cb6b35a1c281f1d120a1052712585dcf4/Mage2Gen-2.3.2.tar.gz" } ], "2.3.3": [ { "comment_text": "", "digests": { "md5": "508cd143bb7d2721dc19e13d8a10ed7e", "sha256": "3d9a8587ab322d1cd54ed8a8966c4e6c878298fa56c3c00913e362664a828af9" }, "downloads": -1, "filename": "Mage2Gen-2.3.3.tar.gz", "has_sig": false, "md5_digest": "508cd143bb7d2721dc19e13d8a10ed7e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 98124, "upload_time": "2019-09-07T17:36:31", "url": "https://files.pythonhosted.org/packages/63/36/903bae55b0e50438eea11cf9dfd24920d8333cea92ba9118571b07a3e2da/Mage2Gen-2.3.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "508cd143bb7d2721dc19e13d8a10ed7e", "sha256": "3d9a8587ab322d1cd54ed8a8966c4e6c878298fa56c3c00913e362664a828af9" }, "downloads": -1, "filename": "Mage2Gen-2.3.3.tar.gz", "has_sig": false, "md5_digest": "508cd143bb7d2721dc19e13d8a10ed7e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 98124, "upload_time": "2019-09-07T17:36:31", "url": "https://files.pythonhosted.org/packages/63/36/903bae55b0e50438eea11cf9dfd24920d8333cea92ba9118571b07a3e2da/Mage2Gen-2.3.3.tar.gz" } ] }