$npx skillfedfor your agent

powerlaw

Toolbox for testing if a probability distribution fits a power law

Worth itPyPI MathematicsReleased Jan 2026118.9K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — powerlaw-2.0.0-py3-none-any.whl
v2.0.0 · released 2026-01-02 · Python >=3.8 · 5 runtime deps: scipy, numpy, matplotlib, mpmath, tqdm

Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and a permissive license. It is the standard tool for rigorous power-law fitting in Python and is well-suited for academic research, data analysis, and any work requiring careful statistical comparison of heavy-tailed distributions. Install it if you need to test whether data actually follows a power law rather than relying on visual inspection or naive fitting.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low friction: pure Python wheel with five standard scientific dependencies (scipy, numpy, matplotlib, mpmath, tqdm) that most data science environments already have.
  • Actively maintained with recent commits and CI across Python 3.8–3.12.

License · maintenance · safety

MIT (permissive) — MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions, making it suitable for academic, commercial, and private projects.

last release 2026-01-02 (224 days) · last repo commit 2026-04-09 · 640 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 118,899 downloads/mo, #12,100 on PyPI

Verify before relying

import powerlaw
import numpy as np

data = np.array([1.7, 3.2, 5.4, 2.1, 1.5, 2.8])
fit = powerlaw.Fit(data)
print(fit.power_law.alpha)
R, p = fit.distribution_compare('power_law', 'lognormal')
  • Whether mpmath's numerical precision requirement for negative numbers in scipy's gamma functions remains a practical limitation in current scipy versions.
  • Performance characteristics and scalability limits on very large datasets.
Same gist for agents: .md · .json

What it is and what it does

powerlaw is a statistical toolbox for testing whether empirical data follows a power-law distribution and comparing it against competing heavy-tailed models like lognormals. It implements the rigorous methods from Clauset et al. 2007 and Klaus et al. 2011, which address the common problem of incorrectly identifying power laws in real-world data. The package fits power-law parameters (alpha and xmin), performs goodness-of-fit tests, and conducts likelihood-ratio comparisons between distributions.

The library is designed for researchers and data analysts who need to determine whether their data exhibits true power-law behavior or whether simpler distributions (like lognormal) provide equally good or better explanations. It integrates with matplotlib for visualization and uses numpy and scipy for numerical computation. The package includes a lognormal_positive variant for cases where theoretical constraints require the underlying distribution parameters to remain positive.

Use it for

  • Analyze network degree distributions or other empirical data to test whether they follow power laws.
  • Compare competing heavy-tailed distribution hypotheses using likelihood-ratio tests to determine the best fit.
  • Visualize fitted power-law distributions and raw data together using matplotlib integration.
  • Validate whether observed tail behavior in scientific datasets (e.g., biological, physical) matches power-law predictions.
  • Fit power-law exponents (alpha) and minimum values (xmin) for downstream modeling or theoretical comparison.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

The package is actively maintained, has no known vulnerabilities, low install friction, and a permissive license. It is the standard tool for rigorous power-law fitting in Python and is well-suited for academic research, data analysis, and any work requiring careful statistical comparison of heavy-tailed distributions. Install it if you need to test whether data actually follows a power law rather than relying on visual inspection or naive fitting.

Install

powerlaw on PyPI

Before you install

Low friction: pure Python wheel with five standard scientific dependencies (scipy, numpy, matplotlib, mpmath, tqdm) that most data science environments already have. Actively maintained with recent commits and CI across Python 3.8–3.12.

License in practice

MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions, making it suitable for academic, commercial, and private projects.

Quickstart

import powerlaw
import numpy as np

data = np.array([1.7, 3.2, 5.4, 2.1, 1.5, 2.8])
fit = powerlaw.Fit(data)
print(fit.power_law.alpha)
R, p = fit.distribution_compare('power_law', 'lognormal')

Verify before relying

  • Whether mpmath's numerical precision requirement for negative numbers in scipy's gamma functions remains a practical limitation in current scipy versions.
  • Performance characteristics and scalability limits on very large datasets.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.8
Install frictionLow. Pure-Python wheel
Runtime dependencies
5 packages
scipynumpymatplotlibmpmathtqdm
MaintenanceActively maintained 224 days since the last release
Last repo commit
First released
Downloads118,899 / month, #12,100 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: Mathematics

Evidence: powerlaw-2.0.0-py3-none-any.whl

Tags

Capabilities
power law fittingheavy-tailed distribution analysisgoodness of fit testingdistribution comparisonstatistical distribution fittingpower law detectiontail behavior analysis
Topics
statistical-testingdistribution-fittingheavy-tailed-data

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 › “power law fitting”

  • powerlawFits heavy-tailed distributions like power laws to data and compares…
  • trianglesolverSolves for unknown sides and angles of a triangle given partial…
  • eyeciteExtracts legal citations from text, recognizing case names, statutory…

Give your agent the search over MCP, or paste the wish link into any chat.

More Mathematics packages

networkx Worth it
PyPI · Python Modules · released Dec 2025

NetworkX provides data structures and algorithms for creating, analyzing, and manipulating graphs and networks, supporting everything from simple undirected graphs to complex directed and weighted networks.

BSD-3-Clausepure Python
290.9Mdownloads / mo
kiwisolver Worth it
PyPI · Mathematics · released Mar 2026

kiwisolver is a Python binding to a fast C++ implementation of the Cassowary constraint solver, enabling you to solve systems of linear constraints and inequalities.

Install it if you need to solve constraint systems; skip it if you only need simple linear algebra.

BSD-3-Clausecompiled wheel · 3.10+
205.5Mdownloads / mo
sympy Worth it
PyPI · Scientific/Engineering · released Apr 2025

SymPy is a Python library for symbolic mathematics, performing algebraic manipulation, calculus, equation solving, and mathematical expression simplification without numerical approximation.

BSD-3-Clausepure Python · 3.9+
196.4Mdownloads / mo
contourpy Worth it
PyPI · Information Analysis · released Jul 2025

ContourPy calculates contours of 2D quadrilateral grids using C++11 algorithms wrapped in Python, offering serial and multithreaded implementations without requiring Matplotlib as a dependency.

BSD-3-Clausecompiled wheel · 3.11+
191.2Mdownloads / mo
torch With conditions
PyPI · Software Development · released Jul 2026

PyTorch provides GPU-accelerated tensor computation and automatic differentiation for building and training deep neural networks in Python.

Apache-2.0 AND Apache-2.0 WITH LLVM-exception AND BSD-2-Clause AND BSD-3-Clause AND BSL-1.0 AND MITcompiled wheel · 3.10+
102.5Mdownloads / mo
onnxruntime Worth it
PyPI · Software Development · released Jul 2026

onnxruntime loads and executes Open Neural Network Exchange (ONNX) models with a focus on inference performance across CPUs and accelerators.

Install it if you have ONNX models to run in production or development.

MITcompiled wheel · 3.11+
89.3Mdownloads / mo

See also reliability · powershap · pwlf · statistics · piecewise-regression · pyjpt · copulas · bootstrapped · numpyro · distrax