Skip to main content

Clustlib: Constrained Clustering Library

Code style: black Python version: 3.12

What it is?

Clustlib is a Python library that provides a unified framework for constrained clustering algorithms.

Unlike traditional clustering, where groups are formed purely from data similarity, constrained clustering integrates prior knowledge in the form of must-link and cannot-link constraints.

This library includes implementations of both classic algorithms and state-of-the-art metaheuristics, enabling researchers and practitioners to experiment, compare, and extend methods in a common environment.

If you want to know more deep in our documentation

✨ Key Features

  • Unified Python API across all algorithms
  • Support for must-link and cannot-link constraints
  • Scikit-learn inspired design for easy integration
  • Implementations from different families:
    • K-Means based methods
    • Bayesian models
    • Evolutionary and metaheuristic approaches
  • Modular and extensible codebase

🚀 Installation

pip install clustlib

Basic Usage

from clustlib.kmeans import COPKMeans

constraints = np.zeros((X.shape[0], X.shape[0]))

# Example: COP-KMeans
model = COPKMeans(n_clusters=3, constraints=constraints)
model.fit(X)
labels = model.labels_

Metadata

Release files for clustlib 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clustlib 0.1.0
File Size Uploaded Provenance Actions
clustlib-0.1.0.tar.gz 26.4 kB With provenance Details for clustlib-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for clustlib 0.1.0
File Interpreter ABI Platform Actions
clustlib-0.1.0-py3-none-any.whl Python 3 none any Details for clustlib-0.1.0-py3-none-any.whl

Total release size: 60.7 kB

Release files / clustlib-0.1.0.tar.gz

Download URL clustlib-0.1.0.tar.gz
Size 26.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f29e5e8fd98439d22818ed5f080f3518f6c187d2a838da8f475d9db1a2c36045
BLAKE2b-256 checksum
How to use checksums
7de2d89e0e2f1b1486e112b5bc705751532844096afabda5e85f2e5e136b8b9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2025.

Transparency log

Release files / clustlib-0.1.0-py3-none-any.whl

Download URL clustlib-0.1.0-py3-none-any.whl
Size 34.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
70a6f12386d7a48d03128a9ab67bf68071b3f14574ccbe1599cb4ea02a10cad7
BLAKE2b-256 checksum
How to use checksums
128275399678cde50a15daec4525e23658f1d9fce976c1bf88693091bed877ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2025.

Transparency log

Security for clustlib 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for clustlib-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page