--- id: jenkspy version: "0.4.1" 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) license_treatment: permissive maintenance: aging --- # jenkspy — Compute Natural Breaks (Fisher-Jenks algorithm) License: permissive · Maintenance: aging · Downloads: 207.5K/mo ## 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 above — 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 pip install jenkspy uv add jenkspy 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_current - Install friction: medium - Maintenance: aging - Downloads: 207.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags natural breaks classification, fisher-jenks algorithm, optimal data binning, jenks optimization method, statistical data clustering, class boundary detection, data discretization, data-binning, statistical-classification, geospatial [View on SkillFed](https://skillfed.io/packages/jenkspy) · [View on PyPI](https://pypi.org/project/jenkspy/)