{ "info": { "author": "Barry Scott", "author_email": "barry@barrys-emacs.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Utilities" ], "description": "# colour_filter module and colour-filter command - colour parts of lines\n\n## colour-filter command\n\nThe `colour-filter` command reads lines from its input,\ncolours parts of the line and prints the result on its output.\n\nFor example colour the output of a build script. Colour `Info:` in green\nand all of the line that starts `Error:` in red.\n\n``` bash\n $ ./build.sh 2>&1 | colour-filter '^Info:' green 'Error:.*' red\n```\n\n## colour_filter module\n\n`ColourFilter` class\n\n- `__init__()`\n\n Create instance of ColourFilter.\n\n- `enableDebug( enable=True )`\n\n Turn on the debug output to help understand why patterns are not matching as expected.\n\n- `define( pattern, colour )`\n\n When the regular express `pattern` is found in a line of input colour it as `colour` on the output.\n\n `colour` is either the string name of a list colour name seperated by ':' or ';'.\n E.g. `'red'` or 'red;bg-white'\n\n The builtin foreground colour names are:\n\n bold, black, brown, green, yellow, blue,\n magenta, cyan, gray, red, lightred, lightgreen,\n lightyellow, lightblue, lightmagenta, lightcyan\n ans white.\n\n The builtin background colour names are:\n\n bg-black, bg-brown, bg-green, bg-yellow,\n bg-blue, bg-magenta, bg-cyan, bg-gray\n and bg-white.\n\n- `filterLines( input_file, output_file, line_buffered )`\n\n Read lines from `input_file` until end-of-file.\n Replace all matching patterns with their defined colour.\n Write each converted line to `output_file` and if `line_buffered` is `True`\n call `flush()` on the `output_file`.\n\n### Example that colours lines of `build.log`\n\n``` python\n from colour_filter import ColourFilter\n\n f = ColourFilter()\n f.define( 'Info:', 'green' )\n f.define( 'Error:', 'red;bg-white' )\n\n with open( 'build.log' ) as input_file:\n f.filterLines( input_file, sys.stdout, line_buffered=False )\n\n```\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/barry-scott/CLI-tools", "keywords": "development", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "colour-filter", "package_url": "https://pypi.org/project/colour-filter/", "platform": "", "project_url": "https://pypi.org/project/colour-filter/", "project_urls": { "Homepage": "https://github.com/barry-scott/CLI-tools" }, "release_url": "https://pypi.org/project/colour-filter/1.1.1/", "requires_dist": [ "colour-text", "config-path" ], "requires_python": "", "summary": "Colour Filter", "version": "1.1.1", "yanked": false, "yanked_reason": null }, "last_serial": 6009154, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "0bd7d6efb1df1eeebb19af630addffde", "sha256": "65dff20fdef1481a4f159d3e22ecaa9de7570453d0d75524e6652f07d4c27cd9" }, "downloads": -1, "filename": "colour_filter-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "0bd7d6efb1df1eeebb19af630addffde", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6719, "upload_time": "2019-08-11T14:09:26", "upload_time_iso_8601": "2019-08-11T14:09:26.971212Z", "url": "https://files.pythonhosted.org/packages/cf/c9/9b721059063db33d0d57cf02b53c0d460d74560da94846109095c0cf0707/colour_filter-1.0.0-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "fc880477380a853a8a0f405a193eee62", "sha256": "dcb41874af342aec3e032116f8eac53e2f82095f36da48cc2840bb5cee8d0cb1" }, "downloads": -1, "filename": "colour-filter-1.0.0.tar.gz", "has_sig": false, "md5_digest": "fc880477380a853a8a0f405a193eee62", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4366, "upload_time": "2019-08-11T14:09:36", "upload_time_iso_8601": "2019-08-11T14:09:36.257288Z", "url": "https://files.pythonhosted.org/packages/db/04/58ce540657881359df16ec5e40f0eb6337ee40fcbbd8875a3370e45be66b/colour-filter-1.0.0.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "6f259a608a7d633129e43d6ff172fc53", "sha256": "5a65268c0aa4cee6d0b5347208e4b811a237476eeef3798234f192a7880966a5" }, "downloads": -1, "filename": "colour_filter-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "6f259a608a7d633129e43d6ff172fc53", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6731, "upload_time": "2019-08-11T14:23:29", "upload_time_iso_8601": "2019-08-11T14:23:29.029451Z", "url": "https://files.pythonhosted.org/packages/1c/64/5d1888edc68ccbd0d306d2011636bfc7af348a95c0edfe07bc7fc620629a/colour_filter-1.0.1-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "f9980efd1ae1925fc1b67f88c589c06a", "sha256": "19c21d12199a5e1cf76161df847f87befe07a63c209d19df7d9d6554c86c50cb" }, "downloads": -1, "filename": "colour-filter-1.0.1.tar.gz", "has_sig": false, "md5_digest": "f9980efd1ae1925fc1b67f88c589c06a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4387, "upload_time": "2019-08-11T14:23:30", "upload_time_iso_8601": "2019-08-11T14:23:30.459489Z", "url": "https://files.pythonhosted.org/packages/b2/4a/69bcc8ff6c0cbbf72b067c8027bfc3dea9bf197f976d74eb37e6e36f1c98/colour-filter-1.0.1.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "fbf3229e1ea6f8860e1836ee6701ba86", "sha256": "13b526ad3cfcc2a80b92e5931db5f3a816298de0581d26c94a648e6f0843e5e6" }, "downloads": -1, "filename": "colour_filter-1.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "fbf3229e1ea6f8860e1836ee6701ba86", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7790, "upload_time": "2019-08-16T11:53:38", "upload_time_iso_8601": "2019-08-16T11:53:38.868537Z", "url": "https://files.pythonhosted.org/packages/7c/6f/b728030a5aa96bb82b6e9eb5cb7b4ee37421305577e5e927e2f726a9ab32/colour_filter-1.0.2-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "ae88778ebd5d457ae6fb5c6cb8e4981c", "sha256": "f6223efd39d87e7632b80eb78e5265f91a1fe4ebe1671886e62c38e7dc965834" }, "downloads": -1, "filename": "colour-filter-1.0.2.tar.gz", "has_sig": false, "md5_digest": "ae88778ebd5d457ae6fb5c6cb8e4981c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4402, "upload_time": "2019-08-16T11:53:45", "upload_time_iso_8601": "2019-08-16T11:53:45.131296Z", "url": "https://files.pythonhosted.org/packages/c2/63/b924d09076d62b96c16da1e9ee64878a15ea35267491a9beafcc2331cf27/colour-filter-1.0.2.tar.gz", "yanked": false, "yanked_reason": null } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "258a90064d509bb028fe9ed4d86d19fb", "sha256": "311cd7465542fe731009f8ade19e27e5bc937e59a74844a6dd8b60916253a240" }, "downloads": -1, "filename": "colour_filter-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "258a90064d509bb028fe9ed4d86d19fb", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8493, "upload_time": "2019-09-28T16:53:59", "upload_time_iso_8601": "2019-09-28T16:53:59.719807Z", "url": "https://files.pythonhosted.org/packages/83/78/acf5bebc5d287fea6cdad234470c4d5fa5b84354af338139902a24116fd3/colour_filter-1.1.0-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "205c4db167189a320404df35a472e33c", "sha256": "7c9c701482cc922bf3543d179fdc6ee8451edc7d091470453dc9a84ae8a95f14" }, "downloads": -1, "filename": "colour_filter-1.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "205c4db167189a320404df35a472e33c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8495, "upload_time": "2019-10-21T20:20:47", "upload_time_iso_8601": "2019-10-21T20:20:47.846803Z", "url": "https://files.pythonhosted.org/packages/51/8a/96cc496e6e293d3580b0b551c258b7b3a677117f4fa4d59a2eb1e4fe34f3/colour_filter-1.1.1-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "205c4db167189a320404df35a472e33c", "sha256": "7c9c701482cc922bf3543d179fdc6ee8451edc7d091470453dc9a84ae8a95f14" }, "downloads": -1, "filename": "colour_filter-1.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "205c4db167189a320404df35a472e33c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8495, "upload_time": "2019-10-21T20:20:47", "upload_time_iso_8601": "2019-10-21T20:20:47.846803Z", "url": "https://files.pythonhosted.org/packages/51/8a/96cc496e6e293d3580b0b551c258b7b3a677117f4fa4d59a2eb1e4fe34f3/colour_filter-1.1.1-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }