{"id":21131,"library":"distinctipy","title":"distinctipy","description":"A lightweight Python library for generating visually distinct colours. Current version: 1.3.4. Release cadence: infrequent, minor patches.","status":"active","version":"1.3.4","language":"python","source_language":"en","source_url":"https://github.com/alan-turing-institute/distinctipy","tags":["color","distinct colors","visualization","accessibility"],"install":[{"cmd":"pip install distinctipy","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Used for color swatch visualization and internal color space conversion","package":"matplotlib","optional":true},{"reason":"Used for color distance calculations in CAM02-UCS color space","package":"colorspacious","optional":true}],"imports":[{"note":"submodule not exposed","wrong":"from distinctipy.distinctipy import get_colors","symbol":"get_colors","correct":"from distinctipy import get_colors"},{"note":"module-level import works but less idiomatic","wrong":"import distinctipy; distinctipy.color_swatch()","symbol":"color_swatch","correct":"from distinctipy import color_swatch"}],"quickstart":{"code":"from distinctipy import get_colors, color_swatch\nn = 15\ncolors = get_colors(n)\nprint(colors[:3])\ncolor_swatch(colors)","lang":"python","description":"Generate 15 distinct colors and display their swatches."},"warnings":[{"fix":"Use Python >=3.8, or stay on v1.3.3.","message":"Python 3.7 support dropped in v1.3.4.","severity":"breaking","affected_versions":">=1.3.4"},{"fix":"Call as get_colors(n=15) instead of get_colors(15).","message":"The `n` parameter name for number of colors is retained but may change in future. Use keyword argument.","severity":"deprecated","affected_versions":"all"},{"fix":"Multiply by 255 if you need 0-255 integers: [tuple(int(c*255) for c in color) for color in colors].","message":"Colors are returned as RGB tuples with values 0-1, not 0-255. Direct use with matplotlib expects 0-1.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"pip install distinctipy","cause":"Library not installed or installed in wrong environment.","error":"ModuleNotFoundError: No module named 'distinctipy'"},{"fix":"Upgrade: pip install --upgrade distinctipy. Then use: from distinctipy import color_swatch","cause":"color_swatch was added in v1.2.0; older version or incorrect import.","error":"AttributeError: module 'distinctipy' has no attribute 'color_swatch'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}