py-cdhit
A Python package for CD-HIT, clustering protein or nucleotide sequences.
Run CD-HIT from Python and read its output into pandas DataFrames without switching to the shell or writing a custom parser. CD-HIT is bundled, so pip install py-cdhit works on Linux, macOS and Windows without installing CD-HIT separately.
Installation
python -m pip install py-cdhit
Ready-made packages cover 64-bit Linux, macOS 15 or later, and 64-bit Windows. On other systems, pip builds CD-HIT from source (see Development).
To use an external installation, set CD_HIT_DIR for the core programs or CD_HIT_AUXTOOLS_DIR for the auxiliary tools. An explicit CDHIT(path=...) takes precedence.
Usage
Cluster a protein FASTA file at 90% identity and read the cluster assignments into a pandas DataFrame.
from pycdhit import cd_hit, read_clstr
cd_hit(i="proteins.fasta", o="nr90", c=0.9, n=5)
df_clstr = read_clstr("nr90.clstr")
See the CD-HIT user guide or try the example notebook.
Bundled software and citation
The source distribution includes CD-HIT 4.8.1 and its GPL license. When publishing results, cite Li and Godzik (2006) and Fu et al. (2012).
Development
Source builds need a C++ compiler with OpenMP and the zlib development files. On Linux, use GCC. On macOS, install libomp with Homebrew and set OpenMP_ROOT to the output of brew --prefix libomp. On Windows, use MinGW-w64 GCC with libgomp and zlib, set CMAKE_GENERATOR to Ninja, set CXX to the full path to g++.exe, and add its directory to PATH.
From a Git checkout, initialize the pinned CD-HIT source, install the development tools and run the tests.
git submodule update --init
python -m pip install -e ".[dev]"
python -m pytest
To build the source distribution and a wheel for the current platform, run these commands.
python -m pip install build
python -m build
The archives are written to dist/. The Wheels workflow runs manually. It builds wheels from the source distribution and tests the installed package on Ubuntu by default, or on all supported platforms when all is selected. To build the documentation locally, install docs/requirements.txt and run python -m sphinx -b html docs docs/_build/html.
Metadata
Release files for py-cdhit 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| py_cdhit-2.0.0.tar.gz | 987.8 kB | Without provenance | Details for py_cdhit-2.0.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| py_cdhit-2.0.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details for py_cdhit-2.0.0-py3-none-win_amd64.whl |
| py_cdhit-2.0.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl | Python 3 | none | Linux glibc 2.28+ x86-64, Linux glibc 2.24+ x86-64 | Details for py_cdhit-2.0.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
| py_cdhit-2.0.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl | Python 3 | none | Linux glibc 2.28+ ARM64, Linux glibc 2.24+ ARM64 | Details for py_cdhit-2.0.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
| py_cdhit-2.0.0-py3-none-macosx_15_0_x86_64.whl | Python 3 | none | macOS 15.0+ x86-64 | Details for py_cdhit-2.0.0-py3-none-macosx_15_0_x86_64.whl |
| py_cdhit-2.0.0-py3-none-macosx_15_0_arm64.whl | Python 3 | none | macOS 15.0+ ARM64 | Details for py_cdhit-2.0.0-py3-none-macosx_15_0_arm64.whl |
Total release size: 5.9 MB
Release files / py_cdhit-2.0.0.tar.gz
| Download URL | py_cdhit-2.0.0.tar.gz |
|---|---|
| Size | 987.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dd1bc50119e926fbb10c736c3ec38980fa3482da237ef19bd39da4fb383659f4
|
|
BLAKE2b-256 checksum How to use checksums |
2eba196444129cf772d5db12ee3ec96fb3396506684980395c942cc8fcda7b94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.11
|
Release files / py_cdhit-2.0.0-py3-none-win_amd64.whl
| Download URL | py_cdhit-2.0.0-py3-none-win_amd64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
cc0d9b47e8b0ebadea8890d39ce206570ad2edf8e16f6b5b6837667468f60bed
|
|
BLAKE2b-256 checksum How to use checksums |
35732938a7e55d1e7f85bbf8d23c29fc8b205d05841177543e2b6dd18bad5320
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.11
|
Release files / py_cdhit-2.0.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | py_cdhit-2.0.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 705.0 kB |
| Tags | Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
517feadfcb03e10b537bbb79fc2052b98cf166e3ed6094eb0a059067233189f2
|
|
BLAKE2b-256 checksum How to use checksums |
47345e33330c773f361db51e78bedf75bf0f681d9eb51ecd70c57e5f5aaa3cdf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.11
|
Release files / py_cdhit-2.0.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | py_cdhit-2.0.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 687.8 kB |
| Tags | Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
0d0e2f210135f4ac25ef78a5c9cb497201a7bd157455c48edca52cd9b5ee1bf9
|
|
BLAKE2b-256 checksum How to use checksums |
a23be4ee5fc016817ba0788f3fef623c61e5374ff68b085145a1e15de31bdec2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.11
|
Release files / py_cdhit-2.0.0-py3-none-macosx_15_0_x86_64.whl
| Download URL | py_cdhit-2.0.0-py3-none-macosx_15_0_x86_64.whl |
|---|---|
| Size | 800.4 kB |
| Tags | Python 3 macOS 15.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
d48a372fb468019376a844284543e3a54c7baa22b3f4e0c2f9f008d428520305
|
|
BLAKE2b-256 checksum How to use checksums |
2cf5ccf116b08572a9af026e728d5fabd20e283180d154c03a76d7e3b5db4c70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.11
|
Release files / py_cdhit-2.0.0-py3-none-macosx_15_0_arm64.whl
| Download URL | py_cdhit-2.0.0-py3-none-macosx_15_0_arm64.whl |
|---|---|
| Size | 728.0 kB |
| Tags | Python 3 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
71eb7db530fb9ee02ec71c47c481fda79d52897dbee180211121a1b087abee67
|
|
BLAKE2b-256 checksum How to use checksums |
4fee6c683107c3ab451729991861bd809bfe7ae0f9f15c0fa52c93546869802b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.11
|
Security for py-cdhit 2.0.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.