ncls
A fast interval tree-like implementation in C, wrapped for the Python ecosystem.
Decision gist · record as of 2026-08-14
Yes, if you need fast interval overlap queries and are comfortable with a compiled dependency. The package is stable, has no known vulnerabilities, and offers significant speed and memory advantages. However, note the deprecation notice recommending an alternative for new projects and the aging maintenance status—evaluate whether that better suits your long-term needs.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a C compiler and build tools to compile the extension from source if a pre-built wheel is not available for your Python version and platform.
- Medium install friction due to compiled C extensions; however, pre-built wheels are available for common Python versions and platforms (macOS ARM64, Linux x86_64, i686, musllinux).
- Last release was recent (2025-07-04), but the package is marked as aging with no commits since then.
License · maintenance · safety
MIT (permissive) — MIT license is permissive and poses no restrictions on commercial or private use, modification, or redistribution.
last release 2025-07-04 (406 days) · last repo commit 2025-07-04 · 224 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 104,335 downloads/mo, #12,753 on PyPI
Alternatives
Verify before relying
pip install ncls
from ncls import NCLS
import numpy as np
starts = np.array([0, 1, 2])
ends = np.array([100, 101, 102])
ids = np.array([0, 1, 2])
ncls = NCLS(starts, ends, ids)
results = ncls.find_overlap(0, 2)
for interval in results:
print(interval)- Whether the package's aging maintenance status affects long-term compatibility with future Python versions.
- The deprecation notice recommends ruranges as an alternative; whether NCLS remains the right choice for new projects.
- Minimum Python version requirement, as requires_python is unspecified in the metadata.
What it is and what it does
NCLS is a Nested Containment List data structure for interval overlap queries, originally from the defunct PyGr library and revived as a standalone tool. It builds on the algorithm described in the original paper and is optimized for speed and memory efficiency compared to traditional interval trees. The package wraps a C implementation with Python bindings and depends only on numpy.
You use NCLS by constructing an index from arrays of interval start and end positions, then query it to find overlaps with new intervals. It supports both single-query (slower, Python-based) and batch-query (faster, C-based) modes. The package is designed for genomic and bioinformatics workflows but works for any interval overlap problem.
Use it for
- Finding all genomic features that overlap a given region in a genome annotation database.
- Batch-querying multiple query intervals against a large reference set of intervals to identify all pairwise overlaps.
- Building interval indices for read alignment or variant annotation pipelines where speed is critical.
- Detecting overlaps in time-series or coordinate-based data where traditional tree structures are too slow.
- Memory-constrained environments where interval tree memory overhead is prohibitive.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need fast interval overlap queries and are comfortable with a compiled dependency.
The package is stable, has no known vulnerabilities, and offers significant speed and memory advantages. However, note the deprecation notice recommending an alternative for new projects and the aging maintenance status—evaluate whether that better suits your long-term needs.
Install
ncls on PyPI
Before you install
Medium install friction due to compiled C extensions; however, pre-built wheels are available for common Python versions and platforms (macOS ARM64, Linux x86_64, i686, musllinux). Last release was recent (2025-07-04), but the package is marked as aging with no commits since then.
Requires a C compiler and build tools to compile the extension from source if a pre-built wheel is not available for your Python version and platform.
License in practice
MIT license is permissive and poses no restrictions on commercial or private use, modification, or redistribution.
Quickstart
pip install ncls
from ncls import NCLS
import numpy as np
starts = np.array([0, 1, 2])
ends = np.array([100, 101, 102])
ids = np.array([0, 1, 2])
ncls = NCLS(starts, ends, ids)
results = ncls.find_overlap(0, 2)
for interval in results:
print(interval)
Verify before relying
- Whether the package's aging maintenance status affects long-term compatibility with future Python versions.
- The deprecation notice recommends ruranges as an alternative; whether NCLS remains the right choice for new projects.
- Minimum Python version requirement, as requires_python is unspecified in the metadata.
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 1 packagenumpy |
| Maintenance | Aging 406 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 104,335 / month, #12,753 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: Other EnvironmentIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseOperating System :: MacOS :: MacOS XOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3Topic :: Scientific/Engineering |
Evidence: ncls-0.0.70-cp310-cp310-macosx_11_0_arm64.whl; ncls-0.0.70-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl; ncls-0.0.70-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; ncls-0.0.70-cp310-cp310-musllinux_1_1_i686.whl; ncls-0.0.70-cp310-cp310-musllinux_1_1_x86_64.whl; ncls-0.0.70-cp311-cp311-macosx_11_0_arm64.whl; ncls-0.0.70-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl; ncls-0.0.70-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; ncls-0.0.70-cp311-cp311-musllinux_1_1_i686.whl; ncls-0.0.70-cp311-cp311-musllinux_1_1_x86_64.whl; ncls-0.0.70-cp312-cp312-macosx_11_0_arm64.whl; ncls-0.0.70-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl; ncls-0.0.70-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; ncls-0.0.70-cp312-cp312-musllinux_1_1_i686.whl; ncls-0.0.70-cp312-cp312-musllinux_1_1_x86_64.whl; ncls-0.0.70-cp39-cp39-macosx_11_0_arm64.whl; ncls-0.0.70-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl; ncls-0.0.70-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; ncls-0.0.70-cp39-cp39-musllinux_1_1_i686.whl; ncls-0.0.70-cp39-cp39-musllinux_1_1_x86_64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “interval overlap queries”
- nclsNCLS provides a fast interval overlap query data structure…
- intervaltreeA self-balancing interval tree data structure that stores and queries…
- portionportion provides data structures and operations for working with…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also intervaltree · pyranges · portion · intervals · awkward · igwn-segments · pybedtools · bx-python · multiqc · jenkspy