{ "info": { "author": "Seth Girvin", "author_email": "sethg@geographika.co.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Build Tools" ], "description": "mappyfile-colors\r\n================\r\n\r\n| |Version| |Build Status|\r\n\r\nA `mappyfile `_ plugin to standardise and convert colors used in a Mapfile. \r\nFeatures include:\r\n\r\n+ conversion between RGB and HEX colors\r\n+ harmonise all colors in a Mapfile to either RGB or hex values\r\n+ add `human readable color `_ names as comments\r\n+ add color names to RGB color ranges as comments (*not currently possible for HEX color ranges*)\r\n+ Python2 and 3 compatible\r\n\r\n.. image:: https://raw.githubusercontent.com/geographika/mappyfile-colors/master/rainbow.png\r\n\r\nSee `example.map`_ and `rainbow_classes.txt`_ for the Mapfile to generate the above image. \r\n\r\nInstallation\r\n------------\r\n\r\n.. code-block:: console\r\n\r\n pip install mappyfile-colors\r\n\r\nNote installing the ``mappyfile-colors`` plugin will automatically install the following \r\ndependencies:\r\n\r\n* mappyfile\r\n* webcolors\r\n\r\nOnline Demo\r\n-----------\r\n\r\n+ Go to the online mappyfile demo at http://mappyfile.geographika.net/\r\n+ Select the \"Rainbow colors\" map\r\n+ Open \"Settings\", the *mappyfile-colors Plugin Settings* section allows conversion to RGB and HEX, and to include\r\n color names as comments in the Mapfile output\r\n+ Click the Format button\r\n\r\nUsage\r\n-----\r\n\r\nTo use the colors plugin, import, and then pass in a custom ``ColorsTransformer``. \r\nTwo additional parameters can also be passed to the ``mappyfile.loads`` function:\r\n\r\n+ ``include_color_names`` - set to True to add color names as comments (default is False)\r\n+ ``conversion_type`` - a parameter to convert colors within a Mapfile, either import ``ConversionType`` or use an integer value\r\n to set the conversion:\r\n\r\n .. code-block:: python\r\n\r\n NO_CONVERSION = 0\r\n TO_RGB = 1\r\n TO_HEX = 2\r\n\r\nA sample script to convert RGB to HEX colors, and include the color names is shown below. \r\n\r\n.. code-block:: python\r\n\r\n import mappyfile\r\n from mappyfile.plugins import mappyfile_colors \r\n from mappyfile_colors import ColorsTransformer, ConversionType\r\n\r\n s = \"\"\"\r\n CLASS\r\n STYLE\r\n COLOR 184 134 11\r\n OUTLINECOLOR 0 0 255\r\n WIDTH 3\r\n END\r\n END\r\n \"\"\"\r\n\r\n d = mappyfile.loads(s, include_color_names=True, transformerClass=ColorsTransformer, conversion_type=ConversionType.TO_HEX)\r\n print(mappyfile.dumps(d))\r\n\r\nThis will output the following:\r\n\r\n.. code-block:: bat\r\n\r\n CLASS \r\n STYLE\r\n COLOR \"#b8860b\" # darkgoldenrod\r\n OUTLINECOLOR \"#0000ff\" # blue \r\n WIDTH 3\r\n END\r\n END\r\n\r\n\r\nSee the `test_plugin.py`_ for further examples. \r\n\r\nColor Factory\r\n+++++++++++++\r\n\r\nThe plugin also includes a ``ColorFactory`` class to return unique colors from color palettes. This can be useful for\r\ngenerating MapServer classes based on unique values. Basic usage is shown below:\r\n\r\n.. code-block:: python\r\n\r\n color_factory = mappyfile_colors.ColorFactory()\r\n print(color_factory.palette_names)\r\n clrs = color_factory.get_colors(palette_name=\"maximum_contrast\") # returns an iterator\r\n print(next(clrs))\r\n\r\nAuthor\r\n------\r\n\r\n* Seth Girvin `@geographika `_\r\n\r\n.. |Version| image:: https://img.shields.io/pypi/v/mappyfile-colors.svg\r\n :target: https://pypi.python.org/pypi/mappyfile-colors\r\n\r\n.. |Build Status| image:: https://travis-ci.org/geographika/mappyfile-colors.svg?branch=master\r\n :target: https://travis-ci.org/geographika/mappyfile-colors\r\n\r\n\r\n.. _test_plugin.py: https://github.com/geographika/mappyfile-colors/blob/master/tests/test_plugin.py\r\n.. _example.map: https://github.com/geographika/mappyfile-colors/blob/master/example.map\r\n.. _rainbow_classes.txt: https://github.com/geographika/mappyfile-colors/blob/master/rainbow_classes.txt\r\n\r\n\r\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/geographika/mappyfile-colors", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "mappyfile-colors", "package_url": "https://pypi.org/project/mappyfile-colors/", "platform": "", "project_url": "https://pypi.org/project/mappyfile-colors/", "project_urls": { "Homepage": "http://github.com/geographika/mappyfile-colors" }, "release_url": "https://pypi.org/project/mappyfile-colors/0.4.1/", "requires_dist": [ "mappyfile (>=0.8.1)", "webcolors" ], "requires_python": "", "summary": "A mappyfile plugin to convert between RGB and Hex colors, and to add human readable names", "version": "0.4.1" }, "last_serial": 5490329, "releases": { "0.3.0": [ { "comment_text": "", "digests": { "md5": "d13770a4e06cf9a8bffe71cc21588b73", "sha256": "5ef9b35ef6b4050e0a269b72304af69191399871ff3c201490943967de12e2b5" }, "downloads": -1, "filename": "mappyfile_colors-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d13770a4e06cf9a8bffe71cc21588b73", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5442, "upload_time": "2019-02-26T23:25:11", "url": "https://files.pythonhosted.org/packages/1d/8f/58a391baabe11f125f16d1bff1b45f9ebcc884809b33d09af52f533852a9/mappyfile_colors-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "69ae6855a7cd1f90f86d880d4883d42e", "sha256": "f601a5d9315e435bd68393c5d71077a660fc63a587516f55308573879bc37b58" }, "downloads": -1, "filename": "mappyfile-colors-0.3.0.tar.gz", "has_sig": false, "md5_digest": "69ae6855a7cd1f90f86d880d4883d42e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6155, "upload_time": "2019-02-26T23:25:13", "url": "https://files.pythonhosted.org/packages/8a/d2/f9acf003948cb23fc9369ab913ea72602aeb2d49835569776ed27b29330e/mappyfile-colors-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "dbb25189d8a009c4ff2a7061e62d4688", "sha256": "4a9ee927d19d7152a47e0bb6dffed1be0277b3a27bcdedc8077c080fa9f915c6" }, "downloads": -1, "filename": "mappyfile_colors-0.4.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "dbb25189d8a009c4ff2a7061e62d4688", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6107, "upload_time": "2019-07-05T07:56:11", "url": "https://files.pythonhosted.org/packages/e5/0a/157c6b59cae9780e811bcfa1fe40f129249fe1bdd03ca6e27636e9834d5e/mappyfile_colors-0.4.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b9dd331162ee925c51185298e762e5e4", "sha256": "11dd2a95cb3b0757f20b5e352d1897ad12678fa1c0d343de6bf72fe06d0e5885" }, "downloads": -1, "filename": "mappyfile-colors-0.4.0.tar.gz", "has_sig": false, "md5_digest": "b9dd331162ee925c51185298e762e5e4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7272, "upload_time": "2019-07-05T07:56:12", "url": "https://files.pythonhosted.org/packages/1a/7b/100c483c46019356a86c90a5fa3906b6d130ef39aa235ab2580088b00a81/mappyfile-colors-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "f9c5ba8d909fadb54637e41e8a9ed72a", "sha256": "c7c32c183c32ff908e9b88cb1e874f5b33501098bf8abbd11135348d1a630716" }, "downloads": -1, "filename": "mappyfile_colors-0.4.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f9c5ba8d909fadb54637e41e8a9ed72a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6117, "upload_time": "2019-07-05T08:54:58", "url": "https://files.pythonhosted.org/packages/c9/34/02dca62586c3f44e4d1aa57335523f01f02a84bc6847e2c4bcc06611f0b8/mappyfile_colors-0.4.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "27aab4bed3cafcc957cf1508b627ea3e", "sha256": "fb9c5dac733ce21dd31ea08b032cfea1173543fbd46db3500cd0e5c8ba7018dd" }, "downloads": -1, "filename": "mappyfile-colors-0.4.1.tar.gz", "has_sig": false, "md5_digest": "27aab4bed3cafcc957cf1508b627ea3e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7286, "upload_time": "2019-07-05T08:55:00", "url": "https://files.pythonhosted.org/packages/5e/07/878cd0f171c39dba8b19cc3a95f5db42253a099592ea854c3b247fd42fd9/mappyfile-colors-0.4.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f9c5ba8d909fadb54637e41e8a9ed72a", "sha256": "c7c32c183c32ff908e9b88cb1e874f5b33501098bf8abbd11135348d1a630716" }, "downloads": -1, "filename": "mappyfile_colors-0.4.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f9c5ba8d909fadb54637e41e8a9ed72a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6117, "upload_time": "2019-07-05T08:54:58", "url": "https://files.pythonhosted.org/packages/c9/34/02dca62586c3f44e4d1aa57335523f01f02a84bc6847e2c4bcc06611f0b8/mappyfile_colors-0.4.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "27aab4bed3cafcc957cf1508b627ea3e", "sha256": "fb9c5dac733ce21dd31ea08b032cfea1173543fbd46db3500cd0e5c8ba7018dd" }, "downloads": -1, "filename": "mappyfile-colors-0.4.1.tar.gz", "has_sig": false, "md5_digest": "27aab4bed3cafcc957cf1508b627ea3e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7286, "upload_time": "2019-07-05T08:55:00", "url": "https://files.pythonhosted.org/packages/5e/07/878cd0f171c39dba8b19cc3a95f5db42253a099592ea854c3b247fd42fd9/mappyfile-colors-0.4.1.tar.gz" } ] }