skillfed

jenkspy

Compute Natural Breaks (Fisher-Jenks algorithm)

jenkspy v0.4.1 207.5K downloads/30d#9,550 on PyPI239
Permissive license MIT License Copyright (c) 2016-2022 Matthieu Viry Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) AGING released

What it is and what it does

Jenkspy implements the Fisher-Jenks algorithm, a deterministic optimization method that finds the best way to partition numerical data into a specified number of classes by minimizing variance within each class. It accepts lists, tuples, arrays, or numpy arrays of integers or floats and returns the break points that define class boundaries. The package provides two interfaces: a simple `jenks_breaks()` function for direct break computation, and a scikit-learn-style `JenksNaturalBreaks` class for fitting, prediction, and grouping workflows.

The library is built as a C extension and ships with pre-compiled wheels for major platforms and Python versions, eliminating compilation for most users. It depends only on numpy and is marked Production/Stable with MIT licensing, making it suitable for integration into data analysis and geospatial classification pipelines.

Use it for:

  • Classify geographic or demographic data into natural groups for choropleth mapping or statistical analysis.
  • Discretize continuous variables into optimal bins for machine learning feature engineering.
  • Identify natural thresholds in sensor or time-series data for alerting or segmentation.
  • Group numerical measurements into categories with minimal within-group variation for reporting.
  • Partition income, age, or other population data into statistically meaningful brackets.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Computes optimal class boundaries for numerical data using the Fisher-Jenks algorithm, partitioning a list or array into natural groups with minimal within-class variance.

Yes. Jenkspy is a stable, production-ready library with no known vulnerabilities, permissive MIT licensing, and solid adoption. Install friction is moderate due to C compilation, but wheels eliminate this for most users. Use it if you need deterministic, optimal class boundaries for numerical data.

Install

jenkspy on PyPI

pip

pip install jenkspy

uv

uv add jenkspy

poetry

poetry add jenkspy

Installing jenkspy

Before you install

Medium install friction due to C extension compilation, but wheels are provided for Windows, macOS, and Linux across multiple Python versions. Repository is aging but stable and actively maintained with recent commit activity.

License in practice

MIT License permits unrestricted use, modification, and distribution with minimal restrictions—suitable for commercial and open-source projects alike.

Quickstart

import jenkspy
import numpy as np

data = [0.0, 1.5, 2.3, 5.1, 6.8, 9.2]
breaks = jenkspy.jenks_breaks(data, n_classes=3)
print(breaks)  # [0.0, 2.3, 6.8, 9.2]

Requires numpy as a runtime dependency; C compiler needed only when building from source.

Verify before relying

  • Performance characteristics (speed relative to other implementations) not quantified in fact sheet.
  • Exact support status for Python 3.7–3.9—wheels shown for 3.10+ only, though classifiers list earlier versions.
  • Whether the package remains actively developed or is in maintenance-only mode given 802-day release gap.

Package facts

License MIT License Copyright (c) 2016-2022 Matthieu Viry Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.7)
Install friction medium — platform-specific wheel
Runtime dependencies 1 — numpy
Maintenance aging — 802 days since the last release
Last repo commit
First released
Downloads 207,474/month — #9,550 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: jenkspy-0.4.1-cp310-cp310-macosx_10_9_x86_64.whl; jenkspy-0.4.1-cp310-cp310-macosx_11_0_arm64.whl; jenkspy-0.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; jenkspy-0.4.1-cp310-cp310-win_amd64.whl; jenkspy-0.4.1-cp311-cp311-macosx_10_9_x86_64.whl; jenkspy-0.4.1-cp311-cp311-macosx_11_0_arm64.whl; jenkspy-0.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; jenkspy-0.4.1-cp311-cp311-win_amd64.whl; jenkspy-0.4.1-cp312-cp312-macosx_10_9_x86_64.whl; jenkspy-0.4.1-cp312-cp312-macosx_11_0_arm64.whl; jenkspy-0.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; jenkspy-0.4.1-cp312-cp312-win_amd64.whl; jenkspy-0.4.1-cp313-cp313-macosx_10_13_x86_64.whl; jenkspy-0.4.1-cp313-cp313-macosx_11_0_arm64.whl; jenkspy-0.4.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; jenkspy-0.4.1-cp313-cp313-win_amd64.whl; jenkspy-0.4.1-cp314-cp314-macosx_10_15_x86_64.whl; jenkspy-0.4.1-cp314-cp314-macosx_11_0_arm64.whl; jenkspy-0.4.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; jenkspy-0.4.1-cp314-cp314t-macosx_10_15_x86_64.whl

Development Status :: 5 - Production/StableLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/EngineeringTyping :: Typed

Tags

natural breaks classificationfisher-jenks algorithmoptimal data binningjenks optimization methodstatistical data clusteringclass boundary detectiondata discretization
data-binningstatistical-classificationgeospatial

More Scientific/Engineering packages