{ "info": { "author": "Alessandro Pisa", "author_email": "alessandro.pisa@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9" ], "description": "![tests](https://github.com/collective/zpretty/workflows/tests/badge.svg)\n\n[![image](https://coveralls.io/repos/github/collective/zpretty/badge.svg?branch=master)](https://coveralls.io/github/collective/zpretty?branch=master)\n\nA tool to format in a **very opinionated** way HTML, XML and text\ncontaining XML snippets.\n\nIt satisfies a primary need: decrease the pain of diffing HTML/XML.\n\nFor this reason `zpretty` formats the markup following these rules of\nthumb:\n\n- maximize the vertical space/decrease the line length\n- attributes should be sorted consistently\n- attribute sorting is first semantic and then alphabetic\n\nThis tool understands the [TAL\nlanguage](https://en.wikipedia.org/wiki/Template_Attribute_Language) and\nhas some features dedicated to it.\n\nThis tool is not a linter! If you are looking for linters safe bets are\n[Tidy](http://www.html-tidy.org/) and\n[xmllint](http://xmlsoft.org/xmllint.html).\n\nYou may have parsing problems! `zpretty` will close for you some known\nself closing tags, like `input` and `img`, that are allowed to be open\nin HTML.\n\n`zpretty` is not clever enough to understand correctly valueless\nattributes! Some work is ongoing, but it works best with \\\"normal\\\"\nattributes.\n\nLack of feature/slowness are a known issue. For the moment the\ndevelopment focused in having a working tool. So it works fast enough:\nless than a second to format a \\~100k file. New features are planned and\nalso huge perfomance boost can be easily obtained. Anyway `zpretty` is\nnot your option for formatting large files (\\> 1 MB).\n\nSee [TODO section](#todo_section) to know what is forecast for the\nfuture.\n\nThe source code and the issue tracker are hosted on\n[GitHub](https://github.com/collective/zpretty).\n\n# INSTALL\n\nThe suggested installation method is using\n[pip](https://pypi.python.org/pypi/pip/):\n\n $ pip install zpretty\n\nThe latest release of `zpretty` requires Python3. If you need to use\nPython2.7 use `zpretty` 0.9.x.\n\n# USAGE\n\nBasic usage:\n\n zpretty [-h] [--encoding ENCODING] [-i] [-x] [-z] [--check] [file ...]\n\n positional arguments:\n file The list of files to prettify (defaults to stdin)\n\n optional arguments:\n -h, --help show this help message and exit\n --encoding ENCODING The file encoding (defaults to utf8)\n -i, --inplace Format files in place (overwrite existing file)\n -x, --xml Threat the input file(s) as XML\n -z, --zcml Threat the input file(s) as XML. Follow the ZCML\n styleguide\n --check Return code 0 if nothing would be changed, 1 if some\n files would be reformatted\n\n\nWithout parameters constraining the file type (e.g. [-x]{.title-ref},\n[-z]{.title-ref}, \\...) `zpretty` will try to guess the right options\nfor you.\n\nExample:\n\n zpretty hello_world.html\n\n# DEVELOP\n\n $ git clone ...\n $ cd zpretty\n $ make\n\n# RUNNING TESTS\n\n $ make test\n\n# TODO\n\n- [ ] Valueless attributes are not allowed in XML\n- [ ] Attributes are aligned in a strange way if previous sibling has no spaces\n- [ ] TBD: Style attributes should be multiline\n\n# Changelog\n\n2.2.0 (2021-12-06)\n------------------\n\n- Add a `--check` command line parameter (Fixes #49) [ale-rt]\n- Now the package is `pre-commit` compatibile (Fixes #50) [ale-rt]\n\n\n2.1.0 (2021-02-12)\n------------------\n\n- Remove unused `autofix` method [ale-rt]\n- Do not render a spurious `=\"\"` when new lines appear inside a tag (Refs. #35) [ale-rt]\n- The attributes renderer knows about the element indentation\n and for indents the attributes consequently [ale-rt]\n- The ZCML element has now its custom tag templates, this simplifies the code [ale-rt]\n- Attributes content spanning multiple lines is not indented anymore (Refs. #17) [ale-rt]\n- Improved sorting for zcml attributes (Refs. #11) [ale-rt]\n- Code is compliant with black 20.8b1 [ale-rt]\n- Switch to pytest for running tests [ale-rt]\n- Upgrade dev requirements [ale-rt]\n- Support Python 3.9 [ale-rt]\n\n\n## 2.0.0 (2020-05-28)\n\n- Updated the list of self closing elements and boolean attributes [ale-rt]\n\n\n## 1.0.3 (2020-05-22)\n\n- Fix unwanted newlines (#20)\n\n\n## 1.0.2 (2019-11-03)\n\n- In Python3.8 quotes in attributes were escaped\n- Fix output again on file and stdout [ale-rt]\n\n## 1.0.1 (2019-10-28)\n\n- Fix output on file [ale-rt]\n\n## 1.0.0 (2019-10-27)\n\n- Support Python3 only [ale-rt]\n\n## 0.9.3 (2017-05-06)\n\n- Last release that supports Python2.7\n- Fix text method\n- Preserve entities in text\n- Added an `--encoding` parameter\n- Added an `--xml` parameter to force xml parsing\n- Choose the better parser according to the given filename if no parser is forced\n- Process stdin if `-` is in the arguments or no arguments are passed [ale-rt]\n\n## 0.9.2 (2017-02-27)\n\n- Small modification for the order of the zcml attributes\n- Auto add a new line to the end of the prettified files\n- Self heal open self closing tag. [ale-rt]\n\n## 0.9.1.1 (2017-02-18)\n\n- Fixed bad release. [ale-rt]\n\n## 0.9.1 (2017-02-18)\n\n- Initial support for zcml style guide (\\#3). [ale-rt]\n\n## 0.9.0 (2017-02-11)\n\n- Initial release. [ale-rt]\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/collective/zpretty", "keywords": "Formatter,HTML,Prettifier,Pretty print,TAL,XML,ZPT", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "zpretty", "package_url": "https://pypi.org/project/zpretty/", "platform": "", "project_url": "https://pypi.org/project/zpretty/", "project_urls": { "Homepage": "https://github.com/collective/zpretty" }, "release_url": "https://pypi.org/project/zpretty/2.2.0/", "requires_dist": null, "requires_python": "", "summary": "An opinionated HTML/XML soup formatter", "version": "2.2.0", "yanked": false, "yanked_reason": null }, "last_serial": 12220410, "releases": { "0.9.0": [ { "comment_text": "", "digests": { "md5": "902af4cf73881901362e860b8c71be8e", "sha256": "8f79bf0453e9865ff764e687597c78261a25e3c202344c5c188cc2b9efa4cb15" }, "downloads": -1, "filename": "zpretty-0.9.0.tar.gz", "has_sig": false, "md5_digest": "902af4cf73881901362e860b8c71be8e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22262, "upload_time": "2017-02-11T13:50:24", "upload_time_iso_8601": "2017-02-11T13:50:24.487398Z", "url": "https://files.pythonhosted.org/packages/42/46/23873aac8c26b8a9c2ae69ad595a2e5b5a8fbeccc05de669e6dbea06030b/zpretty-0.9.0.tar.gz", "yanked": false, "yanked_reason": null } ], "0.9.1": [], "0.9.1.1": [ { "comment_text": "", "digests": { "md5": "886e23c1917443dc4713111201b31ac1", "sha256": "4518d8732c879e92ec41c9667910cdea9b8e8f81ab19dad50848480749fb75b4" }, "downloads": -1, "filename": "zpretty-0.9.1.1.tar.gz", "has_sig": false, "md5_digest": "886e23c1917443dc4713111201b31ac1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14783, "upload_time": "2017-02-18T11:07:48", "upload_time_iso_8601": "2017-02-18T11:07:48.457420Z", "url": "https://files.pythonhosted.org/packages/a2/22/24045b2a260bfdfb4bf76116dbe1300456daa8b8c4ce1f6f0569931118bd/zpretty-0.9.1.1.tar.gz", "yanked": false, "yanked_reason": null } ], "0.9.2": [ { "comment_text": "", "digests": { "md5": "9431747f7172b2e118fad7855f05948f", "sha256": "9809e96485a5e3ff3fe87ba3a88b510cf3e9e3e6c186e78f00317e152f2a5537" }, "downloads": -1, "filename": "zpretty-0.9.2.tar.gz", "has_sig": false, "md5_digest": "9431747f7172b2e118fad7855f05948f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15166, "upload_time": "2017-02-27T21:35:17", "upload_time_iso_8601": "2017-02-27T21:35:17.152111Z", "url": "https://files.pythonhosted.org/packages/7b/d6/03f973043950d5ee78ab01ff80bb52cf42737a3048c0cc03a7855301d375/zpretty-0.9.2.tar.gz", "yanked": false, "yanked_reason": null } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "5a9acf5e746b4e2e0d50a55c9601f15e", "sha256": "13cdf47b36b6a66207a2a730f737565480f94324a54281f2dbaf88da368276d8" }, "downloads": -1, "filename": "zpretty-0.9.3.tar.gz", "has_sig": false, "md5_digest": "5a9acf5e746b4e2e0d50a55c9601f15e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17160, "upload_time": "2017-05-06T14:01:39", "upload_time_iso_8601": "2017-05-06T14:01:39.826007Z", "url": "https://files.pythonhosted.org/packages/48/18/012d58a0eaae8dd2bbf4c3352034e244ca9bd7552bded3b7c5e4e6d0ddd5/zpretty-0.9.3.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "fe1622aa2dccf2bf829ba55e241ff66e", "sha256": "2c15c457e4b2ebb7902fa8716542266564a24472275c8a24f9088efeb9d6e464" }, "downloads": -1, "filename": "zpretty-1.0.0.tar.gz", "has_sig": false, "md5_digest": "fe1622aa2dccf2bf829ba55e241ff66e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17566, "upload_time": "2019-10-27T14:21:54", "upload_time_iso_8601": "2019-10-27T14:21:54.960426Z", "url": "https://files.pythonhosted.org/packages/38/be/73a3fe2c2f2d406e078ec8eaae33c7fa70fdaa275ef8617ecc47cdc3c311/zpretty-1.0.0.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "85ce3f1f43972131e64db0dab1162df5", "sha256": "ff792685987ae18adae3b61343f2c0e4072dce85051b4a890dde3030d6df1ef5" }, "downloads": -1, "filename": "zpretty-1.0.1.tar.gz", "has_sig": false, "md5_digest": "85ce3f1f43972131e64db0dab1162df5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17590, "upload_time": "2019-10-28T13:34:50", "upload_time_iso_8601": "2019-10-28T13:34:50.908658Z", "url": "https://files.pythonhosted.org/packages/3a/12/42cac0b6327b00b1dd74ebfaa34ae3e6dd00d1c2575fc5e3cf5529ce455e/zpretty-1.0.1.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "77c1d107ffd9b325a6a18a67f2aa0dc9", "sha256": "209b5411c0624a63090027b34086c014f9f0384697892657527d5c19ed0bfba8" }, "downloads": -1, "filename": "zpretty-1.0.2.tar.gz", "has_sig": false, "md5_digest": "77c1d107ffd9b325a6a18a67f2aa0dc9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17869, "upload_time": "2019-11-03T09:40:13", "upload_time_iso_8601": "2019-11-03T09:40:13.393996Z", "url": "https://files.pythonhosted.org/packages/db/79/7cfb3c0b2a8e6a06e972532a2f0386f0fdd1679d903d30c18c65bd8d6d43/zpretty-1.0.2.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "7bc0868d9a91dec1a01c363ae70ca7d4", "sha256": "186a4dcefabbc646efbb6a9e2ff7f55fe3cb9cebad1ada68b1b9bf6398440c50" }, "downloads": -1, "filename": "zpretty-1.0.3.tar.gz", "has_sig": false, "md5_digest": "7bc0868d9a91dec1a01c363ae70ca7d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20228, "upload_time": "2020-05-22T06:43:58", "upload_time_iso_8601": "2020-05-22T06:43:58.121729Z", "url": "https://files.pythonhosted.org/packages/a3/b9/8f3f8fbfe41a2e8ef988836ad16c26aa26b4174861575e7dec7447e69009/zpretty-1.0.3.tar.gz", "yanked": false, "yanked_reason": null } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "5560bed8010cd1d16547911e74860e3c", "sha256": "b2c17e14ade6627db961a96752ec7c86d81976ed9e7faf86b0e1a9cb6782a99a" }, "downloads": -1, "filename": "zpretty-2.0.0.tar.gz", "has_sig": false, "md5_digest": "5560bed8010cd1d16547911e74860e3c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20646, "upload_time": "2020-05-28T07:44:09", "upload_time_iso_8601": "2020-05-28T07:44:09.900415Z", "url": "https://files.pythonhosted.org/packages/fa/05/a39fd989df995d8d02cb80e6f2d8b95b51fc28eb453044ac0c670ac837a3/zpretty-2.0.0.tar.gz", "yanked": false, "yanked_reason": null } ], "2.1.0": [ { "comment_text": "", "digests": { "md5": "a142ab79235f36bb73377c2f2f65303e", "sha256": "bfe182cc56a28bf098f34ae01305d785b19fef0b6cb12af67eafd139478a042c" }, "downloads": -1, "filename": "zpretty-2.1.0.tar.gz", "has_sig": false, "md5_digest": "a142ab79235f36bb73377c2f2f65303e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26600, "upload_time": "2021-02-12T15:45:21", "upload_time_iso_8601": "2021-02-12T15:45:21.372679Z", "url": "https://files.pythonhosted.org/packages/d7/1c/f87d518ac03fa00ef9549ce27c94cf228210cc5fc97391acf421bcd66e34/zpretty-2.1.0.tar.gz", "yanked": false, "yanked_reason": null } ], "2.2.0": [ { "comment_text": "", "digests": { "md5": "3cce782439388784dc887134bcde8b3e", "sha256": "1bc96e146a6c598668baf2f2d5927b3288b3ff752a5d448b7dc17265f7404a93" }, "downloads": -1, "filename": "zpretty-2.2.0.tar.gz", "has_sig": false, "md5_digest": "3cce782439388784dc887134bcde8b3e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26863, "upload_time": "2021-12-06T07:37:26", "upload_time_iso_8601": "2021-12-06T07:37:26.265023Z", "url": "https://files.pythonhosted.org/packages/72/21/7a3389260ca6525bdb4c9f1db34f0ee7c6e48cb10b12f9ad13a2f0e49193/zpretty-2.2.0.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3cce782439388784dc887134bcde8b3e", "sha256": "1bc96e146a6c598668baf2f2d5927b3288b3ff752a5d448b7dc17265f7404a93" }, "downloads": -1, "filename": "zpretty-2.2.0.tar.gz", "has_sig": false, "md5_digest": "3cce782439388784dc887134bcde8b3e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26863, "upload_time": "2021-12-06T07:37:26", "upload_time_iso_8601": "2021-12-06T07:37:26.265023Z", "url": "https://files.pythonhosted.org/packages/72/21/7a3389260ca6525bdb4c9f1db34f0ee7c6e48cb10b12f9ad13a2f0e49193/zpretty-2.2.0.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }