{ "info": { "author": "Stephen Whitlock", "author_email": "stephen@jshwisolutions.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7" ], "description": "=======================================================\nThe minimalist - all purpose - color class for printing\n=======================================================\n\nInstallation\n\n.. code-block:: console\n\n pip install object-colors\n\nSetup\n\n.. code:: python\n\n from object_colors import Color\n c = Color()\n..\n\nUsage\n\n* key-values\n Match `effects` with `effect` and `colors` with `text` and `background`\n\n .. code:: javascript\n\n keys = [\"text\", \"effect\", \"background\"]\n values = {\n \"colors\": [\"black\", \"red\", \"green\", \"yellow\", \"blue\", \"purple\", \"cyan\", \"white\"]\n \"effects\": ['none', \"bold\", 'bright', \"underline\", \"negative\"]\n }\n ..\n\nMethods\n\n* set()\n `Set values with keyword arguments`\n\n .. code:: python\n\n >>> c.set(text=\"red\", effect=\"bold\", background=\"blue\")\n >>> c.set(\"red\", \"bold\", \"blue\")\n >>> c.set(114)\n >>> print(c.__dict__)\n ..\n\n .. code:: python\n\n {'text': 1, 'effect': 1, 'background': 4}\n ..\n\n `Set a new class with a keyword (any key) followed by a dict value`\n\n .. code:: python\n\n >>> c.set(\n red={\"text\": \"red\"},\n bold_red={\"text\": \"red\", \"effect\": \"bold\"},\n yellow={\"text\": \"yellow\"}\n )\n >>> c.yellow.set(effect=\"bold\")\n >>> print(c.__dict__)\n ..\n .. code:: python\n\n {\n 'text': 1,\n 'effect': 1,\n 'background': 4,\n 'red': ,\n 'bold_red': ,\n 'yellow': \n }\n ..\n .. code:: python\n\n >>> print(c.yellow.__dict__)\n ..\n .. code:: python\n\n {'text': 3, 'effect': 1, 'background': 0}\n ..\n\n* print()\n `Instance includes enhanced print() function for color output`\n\n .. code:: python\n\n >>> c.print(\"no color print\")\n >>> c.red.print(\"red print\", flush=True)\n >>> c.yellow.print(\"yellow print\", end=\"\")\n ..\n\n* get()\n `Store values for multicolored printing`\n\n .. code:: python\n\n >>> bullet = c.red.get(\"[!] \")\n >>> warning = c.yellow(\"Warning\")\n >>> print(bullet + warning)\n ..\n\n* pop()\n `Remove unused attributes`\n\n .. code:: python\n\n >>> c.pop(\"bold_red\")\n >>> print(c.__dict__)\n ..\n\n .. code:: python\n\n {\n 'text': 1,\n 'effect': 1,\n 'background': 4,\n 'red': ,\n 'yellow': \n }\n ..\n\n `Or create new instances`\n\n .. code:: python\n\n >>> red = c.pop(\"red\")\n >>> print(c.__dict__)\n ..\n\n .. code:: python\n\n {\n 'text': 1,\n 'effect': 1,\n 'background': 4,\n 'yellow': \n }\n ..\n\n .. code:: python\n\n >>> print(red.__dict__)\n ..\n\n .. code:: python\n\n {'text': 1, 'effect': 0, 'background': 0}\n ..\n\n .. code:: python\n\n >>> red.print()\n >>> red.get()\n >>> red.set()\n ..\n\n\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jshwi/object_colors", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "object-colors", "package_url": "https://pypi.org/project/object-colors/", "platform": "", "project_url": "https://pypi.org/project/object-colors/", "project_urls": { "Homepage": "https://github.com/jshwi/object_colors" }, "release_url": "https://pypi.org/project/object-colors/1.0.3/", "requires_dist": null, "requires_python": "", "summary": "Adding colours to Python simplified into a single class", "version": "1.0.3" }, "last_serial": 5942619, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "124ca556ac0f038c2c18160df9f40a06", "sha256": "63a4fb7078b13af9d3b9da567f116fb53a6d5341eca8779315883e70b93ed241" }, "downloads": -1, "filename": "object-colors-1.0.1.tar.gz", "has_sig": false, "md5_digest": "124ca556ac0f038c2c18160df9f40a06", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3780, "upload_time": "2019-10-02T11:22:50", "url": "https://files.pythonhosted.org/packages/14/ff/43ab50252f447b39b25818f17fb41d2dbb6b9668beeec21aaf8963a44bd6/object-colors-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "1f24ec009c7750fe17c3421cccdbed6f", "sha256": "8bf0b268ef27c4643ca5697e94bf76c520d0feeda43cd41dc087625c128bcf99" }, "downloads": -1, "filename": "object_colors-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "1f24ec009c7750fe17c3421cccdbed6f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5875, "upload_time": "2019-10-07T16:40:14", "url": "https://files.pythonhosted.org/packages/ac/96/a77b195681391b0bcdce74dd2a286636f83b90a3f8e023d8c39bc249aec9/object_colors-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "48df12bde42ea7f8eaaad43696cd4c32", "sha256": "524b00011ae168aa7b819c4caa8594361f6c87db850cbbfaa6f2aa0872d66a3b" }, "downloads": -1, "filename": "object-colors-1.0.2.tar.gz", "has_sig": false, "md5_digest": "48df12bde42ea7f8eaaad43696cd4c32", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4963, "upload_time": "2019-10-07T16:40:19", "url": "https://files.pythonhosted.org/packages/fb/24/6dfaa0afe7d17a9fb4ae90b76d85e1bf6811038c51c194bbb0ce9973b627/object-colors-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "6746eba230c6f05346f56ee89d36c7d2", "sha256": "55287deea6ee2189c4dc99cf0769667835a7eaec10883650e134f77c2ee07f26" }, "downloads": -1, "filename": "object_colors-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "6746eba230c6f05346f56ee89d36c7d2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5878, "upload_time": "2019-10-08T03:17:14", "url": "https://files.pythonhosted.org/packages/1e/b1/4f2c5a3fb70495d5f8d7e586ab6796260c2c96ca59efcffcd8829bad5fb2/object_colors-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "267a20241f8764244026a3879a6121df", "sha256": "c42e9f6b357098056d550e5147854f964664622c78acb630530b5d29001c0705" }, "downloads": -1, "filename": "object-colors-1.0.3.tar.gz", "has_sig": false, "md5_digest": "267a20241f8764244026a3879a6121df", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5129, "upload_time": "2019-10-08T03:17:30", "url": "https://files.pythonhosted.org/packages/4b/cc/457fd8fc26eda75eed37a6d32b51d8d7dbd2162f9ed17a896a8986218c47/object-colors-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6746eba230c6f05346f56ee89d36c7d2", "sha256": "55287deea6ee2189c4dc99cf0769667835a7eaec10883650e134f77c2ee07f26" }, "downloads": -1, "filename": "object_colors-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "6746eba230c6f05346f56ee89d36c7d2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5878, "upload_time": "2019-10-08T03:17:14", "url": "https://files.pythonhosted.org/packages/1e/b1/4f2c5a3fb70495d5f8d7e586ab6796260c2c96ca59efcffcd8829bad5fb2/object_colors-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "267a20241f8764244026a3879a6121df", "sha256": "c42e9f6b357098056d550e5147854f964664622c78acb630530b5d29001c0705" }, "downloads": -1, "filename": "object-colors-1.0.3.tar.gz", "has_sig": false, "md5_digest": "267a20241f8764244026a3879a6121df", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5129, "upload_time": "2019-10-08T03:17:30", "url": "https://files.pythonhosted.org/packages/4b/cc/457fd8fc26eda75eed37a6d32b51d8d7dbd2162f9ed17a896a8986218c47/object-colors-1.0.3.tar.gz" } ] }