{ "info": { "author": "David Garc\u00eda Garz\u00f3n", "author_email": "voki@canvoki.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Logging", "Topic :: Text Processing :: Filters", "Topic :: Text Processing :: Markup :: HTML" ], "description": "python-deansi: Turns coloured console output into the equivalent html\n=====================================================================\n\nFeatures\n--------\n\n- It can be used either as module or as a command line tool.\n- Supports most \u2018m\u2019 codes (colors and attributes).\n- The apperance can be customized using styles in a very convenient and\n powerful way.\n\n - ANSI attributes are mapped to stylable HTML classes\n (``ansi_yellow``, ``ansi_bright``...)\n - Text sequences with the same set of ANSI attributes are enclosed\n in a single ``span`` with those classes activated.\n - You can define styles for a class or for a certain combination of\n classes\n - You can define the style depending on the enclosing container so\n that different styles can coexist in a single document.\n\n- It has been test driven developed and back2back tested.\n\nUsage as Python module\n----------------------\n\n- ``deansi.styleSheet()``: returns the default stylesheet for the ANSI\n classes you can customize.\n- ``deansi.deansi(consoleText)``: returns the HTML conversion\n\nThe following example use them to build a simple console look of the\noutput:\n\n.. code:: python\n\n import deansi\n\n html_template = \"\"\"\\\n \n
{ansiText}
\n \"\"\"\n ansiInput = \"\\033[31mHello World!!\\033[m\"\n\n print html_template.format(\n defaultStyle = deansi.styleSheet(),\n ansiText = deansi.deansi(ansiInput),\n )\n\nCommand line use\n----------------\n\n``deansi`` can be used as pipe based command line tool. A quite simple\nuse, could be:\n\n.. code:: bash\n\n $ ls --color | deansi.py > ls.html\n\nBesides, we can use some options to modify its behaviour:\n\n.. code:: bash\n\n $ deansy.py --help\n\n usage: deansi.py [-h] [-s FILE] [-t FILE] [--dark] [INPUT_FILE] [OUTPUT_FILE]\n\n Converts coloured console output into equivalent HTML\n\n positional arguments:\n INPUT_FILE the console input to convert (default stdin)\n OUTPUT_FILE the file where to drop the html output (default\n stdout)\n\n optional arguments:\n -h, --help show this help message and exit\n -s FILE, --style FILE\n use FILE as stylesheet\n -t FILE, --template FILE\n use FILE as html template\n --dark use the dark background style\n\nCustomizing stylesheets\n-----------------------\n\nThe default stylesheet looks like this:\n\n.. code:: css\n\n .ansi_terminal { background-color: #222; color: #cfc; }\n .ansi_terminal { white-space: pre; font-family: monospace; }\n .ansi_black { color: black; }\n .ansi_red { color: darkred; }\n .ansi_green { color: darkgreen; }\n .ansi_yellow { color: orange; }\n .ansi_blue { color: darkblue; }\n .ansi_magenta { color: purple; }\n .ansi_cyan { color: darkcyan; }\n .ansi_white { color: lightgray; }\n .ansi_bright.ansi_black { color: gray; }\n .ansi_bright.ansi_red { color: red; }\n .ansi_bright.ansi_green { color: green; }\n .ansi_bright.ansi_yellow { color: yellow; }\n .ansi_bright.ansi_blue { color: blue; }\n .ansi_bright.ansi_magenta { color: magenta; }\n .ansi_bright.ansi_cyan { color: cyan; }\n .ansi_bright.ansi_white { color: white; }\n .ansi_bgblack { background-color: black; }\n .ansi_bgred { background-color: red; }\n .ansi_bggreen { background-color: green; }\n .ansi_bgyellow { background-color: yellow; }\n .ansi_bgblue { background-color: blue; }\n .ansi_bgmagenta { background-color: magenta; }\n .ansi_bgcyan { background-color: cyan; }\n .ansi_bgwhite { background-color: white; }\n .ansi_bright { font-weight: bold; }\n .ansi_faint { opacity: .5; }\n .ansi_italic { font-style: italic; }\n .ansi_underscore { text-decoration: underline; }\n .ansi_blink { text-decoration: blink; }\n .ansi_reverse { border: 1pt solid; }\n .ansi_hide { opacity: 0; }\n .ansi_strike { text-decoration: line-through; }\n\nBecause of the cascading behaviour of CSS whichever style rules after\nthe default ones, will override those ones. For example if you want to\nchange the yellow color when the ansi bright attribute apply, instead of\napplying bold font you can say:\n\n.. code:: css\n\n .ansi_yellow.ansi_bright { color: #FF7; font-weight: inherit; }\n\nIf you want several behaviours in the same html you can use css magic\nlike that:\n\n.. code:: css\n\n .my_own_ansi_enviroment .ansi_inverse { font-style: italic; border: none; }", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/GuifiBaix/python-deansi", "keywords": null, "license": "GNU General Public License v3 or later (GPLv3+)", "maintainer": null, "maintainer_email": null, "name": "deansi", "package_url": "https://pypi.org/project/deansi/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/deansi/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/GuifiBaix/python-deansi" }, "release_url": "https://pypi.org/project/deansi/1.2/", "requires_dist": null, "requires_python": null, "summary": "ANSI codes to HTML converter", "version": "1.2" }, "last_serial": 1894899, "releases": { "1.0": [ { "comment_text": "built for Linux-3.11.0-26-generic-i686-athlon-with-glibc2.4", "digests": { "md5": "4168dedc05e3625d7dce8da9b517e215", "sha256": "31e7c2a97ae7ed6d60a171d7f4475acd9aeff71cb5a672652173c826c5fbe3f7" }, "downloads": -1, "filename": "deansi-1.0.linux-i686.tar.gz", "has_sig": false, "md5_digest": "4168dedc05e3625d7dce8da9b517e215", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 6531, "upload_time": "2016-01-08T04:27:17", "url": "https://files.pythonhosted.org/packages/cd/46/29cf8deabba6687639d758448a1e53c90f088334eab755da1544a47cb417/deansi-1.0.linux-i686.tar.gz" }, { "comment_text": "", "digests": { "md5": "d94f68753f21e8cbe3d8502e2404a5c4", "sha256": "a06173984abe3536ddd69ed19f2da910dbd2c0296d30355db76d6c55162de6d3" }, "downloads": -1, "filename": "deansi-1.0.tar.gz", "has_sig": false, "md5_digest": "d94f68753f21e8cbe3d8502e2404a5c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5235, "upload_time": "2016-01-08T04:07:54", "url": "https://files.pythonhosted.org/packages/3d/0e/9c3528d5350b55f7d145001fcbb72450d7115282f2fa408bcae562b1ace2/deansi-1.0.tar.gz" } ], "1.1": [ { "comment_text": "built for Linux-3.11.0-26-generic-i686-athlon-with-glibc2.4", "digests": { "md5": "5ff18267b9ba418c158ad16013bc13eb", "sha256": "4a2aa8e4538158450cdee981ee81c29999ff3c60e6fe396a88f28fd3c8f1a8de" }, "downloads": -1, "filename": "deansi-1.1.linux-i686.tar.gz", "has_sig": false, "md5_digest": "5ff18267b9ba418c158ad16013bc13eb", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 7457, "upload_time": "2016-01-08T09:17:36", "url": "https://files.pythonhosted.org/packages/d5/bc/439f56460cdbf8445e306df0706624297e3720253cb45b9f943cb103f0d3/deansi-1.1.linux-i686.tar.gz" }, { "comment_text": "", "digests": { "md5": "bd33c572ab9a94d11207df3c29d1b62a", "sha256": "ec80736b4332cc28f5c82e95549f2bea767b4bbe47a4230d9e997d5f1836179c" }, "downloads": -1, "filename": "deansi-1.1.tar.gz", "has_sig": false, "md5_digest": "bd33c572ab9a94d11207df3c29d1b62a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5754, "upload_time": "2016-01-08T09:17:10", "url": "https://files.pythonhosted.org/packages/e5/be/fe5c7e4f899b7704ff1c69293acc779e5fec230e942d9d119e28da8c46bc/deansi-1.1.tar.gz" } ], "1.2": [ { "comment_text": "built for Linux-3.11.0-26-generic-i686-athlon-with-glibc2.4", "digests": { "md5": "e123cac70ef66c0385079377e4b2d0c6", "sha256": "ed2f84f8628b650c56347ac417cabb6e7153e503d68304f4e906655467a4ea1a" }, "downloads": -1, "filename": "deansi-1.2.linux-i686.tar.gz", "has_sig": false, "md5_digest": "e123cac70ef66c0385079377e4b2d0c6", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 7723, "upload_time": "2016-01-08T13:29:25", "url": "https://files.pythonhosted.org/packages/56/a1/e56808f3cd0fbf9dc636c0cfa676179e0d6c18c5a1f8135b826cd053326e/deansi-1.2.linux-i686.tar.gz" }, { "comment_text": "", "digests": { "md5": "0413b53790844681d92289eef2965a14", "sha256": "349a13743240e8f580ea33fd63dfaca31cca632f06f957777456c230bd642318" }, "downloads": -1, "filename": "deansi-1.2.tar.gz", "has_sig": false, "md5_digest": "0413b53790844681d92289eef2965a14", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5849, "upload_time": "2016-01-08T13:29:17", "url": "https://files.pythonhosted.org/packages/54/65/d3ddc93e5ecfdf6d4c9dd3c3d75cdfb85f0d14534f0c720ab735673faf1e/deansi-1.2.tar.gz" } ] }, "urls": [ { "comment_text": "built for Linux-3.11.0-26-generic-i686-athlon-with-glibc2.4", "digests": { "md5": "e123cac70ef66c0385079377e4b2d0c6", "sha256": "ed2f84f8628b650c56347ac417cabb6e7153e503d68304f4e906655467a4ea1a" }, "downloads": -1, "filename": "deansi-1.2.linux-i686.tar.gz", "has_sig": false, "md5_digest": "e123cac70ef66c0385079377e4b2d0c6", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 7723, "upload_time": "2016-01-08T13:29:25", "url": "https://files.pythonhosted.org/packages/56/a1/e56808f3cd0fbf9dc636c0cfa676179e0d6c18c5a1f8135b826cd053326e/deansi-1.2.linux-i686.tar.gz" }, { "comment_text": "", "digests": { "md5": "0413b53790844681d92289eef2965a14", "sha256": "349a13743240e8f580ea33fd63dfaca31cca632f06f957777456c230bd642318" }, "downloads": -1, "filename": "deansi-1.2.tar.gz", "has_sig": false, "md5_digest": "0413b53790844681d92289eef2965a14", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5849, "upload_time": "2016-01-08T13:29:17", "url": "https://files.pythonhosted.org/packages/54/65/d3ddc93e5ecfdf6d4c9dd3c3d75cdfb85f0d14534f0c720ab735673faf1e/deansi-1.2.tar.gz" } ] }