Registry / data / distinctipy

distinctipy

JSON →
library1.3.4pypypi✓ verified 86d ago

A lightweight Python library for generating visually distinct colours. Current version: 1.3.4. Release cadence: infrequent, minor patches.

pip install distinctipy
INSTALL
IMPORT
SIG · DISTINCTIPY
D
distinctipy
datapythonv1.3.4
Install
3.6s avg
Import
335ms
Disk
89MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.3.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.328s · 89.5MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.6s · import 0.342s · 86MB
89MB installed
● package 89MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

get_colors
from distinctipy import get_colors
from distinctipy.distinctipy import get_colors
submodule not exposed
color_swatch
from distinctipy import color_swatch
import distinctipy; distinctipy.color_swatch()
module-level import works but less idiomatic

Generate 15 distinct colors and display their swatches.

from distinctipy import get_colors, color_swatch n = 15 colors = get_colors(n) print(colors[:3]) color_swatch(colors)
Debug
Known issues
breakingPython 3.7 support dropped in v1.3.4.
fix
Use Python >=3.8, or stay on v1.3.3.
affects: >=1.3.4
deprecatedThe `n` parameter name for number of colors is retained but may change in future. Use keyword argument.
fix
Call as get_colors(n=15) instead of get_colors(15).
affects: all
gotchaColors are returned as RGB tuples with values 0-1, not 0-255. Direct use with matplotlib expects 0-1.
fix
Multiply by 255 if you need 0-255 integers: [tuple(int(c*255) for c in color) for color in colors].
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'distinctipy'
Library not installed or installed in wrong environment.
fix
pip install distinctipy
AttributeError: module 'distinctipy' has no attribute 'color_swatch'
color_swatch was added in v1.2.0; older version or incorrect import.
fix
Upgrade: pip install --upgrade distinctipy. Then use: from distinctipy import color_swatch
Upgrade
Version history
1.3.4latest on PyPI · released Jan 10, 2024
Audit
Dependencies
matplotliboptionalUsed for color swatch visualization and internal color space conversion
colorspaciousoptionalUsed for color distance calculations in CAM02-UCS color space
Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
distinctipy — pip install distinctipy · libregistry