uhi
Unified Histogram Interface: tools to help library authors work with histograms
Decision gist · record as of 2026-08-14
Yes, if you are building libraries that work with histograms from multiple sources or need to enforce histogram interface standards. Install as a type-checking or testing dependency in projects that depend on histogram libraries like boost-histogram or hist. Not necessary for end-user code that only uses a single histogram library, but adds minimal friction and provides real value in interoperability scenarios.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low install friction with only numpy and typing-extensions as runtime dependencies.
- Actively maintained with recent releases; primarily designed as a type-checking and testing dependency for other libraries rather than a direct runtime requirement.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause is permissive and places no significant restrictions on use or redistribution in commercial or open-source contexts.
last release 2026-04-26 (110 days) · last repo commit 2026-08-13 · 21 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 430,415 downloads/mo, #6,728 on PyPI
Alternatives
Verify before relying
pip install uhi
import uhi.typing.plotting
from uhi.numpy_plottable import ensure_plottable_histogram
# Check if an object conforms to PlottableHistogram protocol
isinstance(histogram_obj, uhi.typing.plotting.PlottableHistogram)
# Adapt NumPy-style histogram tuple to PlottableHistogram
plottable = ensure_plottable_histogram(counts, edges)- Whether the runtime-usable components (numpy_plottable adapter, protocol runtime checking) are sufficient for direct use or if this is primarily a transitive dependency.
- Performance characteristics when using isinstance() checks against PlottableHistogram at runtime in tight loops.
What it is and what it does
UHI is a standards library that defines how histogram objects should behave across different scientific Python libraries. It provides type protocols—especially PlottableHistogram—that libraries like boost-histogram, hist, and uproot conform to, enabling code to work with histograms from multiple sources without knowing their concrete type. The package includes runtime-checkable protocols so you can use isinstance() to verify conformance, plus a utility to convert NumPy-style histogram tuples (counts, edges) into objects that match the standard interface.
The package is designed primarily as a dependency for library authors and type checkers rather than end-user code, though it does expose a few useful runtime tools. It depends only on numpy and typing-extensions, making it lightweight to include in projects that need histogram interoperability. The active maintenance and support for current Python versions (3.10+) ensures it stays aligned with modern scientific Python practices.
Use it for
- Type-check histogram objects from different libraries to ensure they conform to a common interface before passing them to plotting functions.
- Adapt NumPy histogram tuples (counts, edges) into standardized PlottableHistogram objects for compatibility with libraries expecting the protocol.
- Document and enforce histogram indexing conventions across a multi-library scientific computing project.
- Support library development by providing reference protocols that new histogram implementations can conform to.
- Enable runtime verification that a histogram object supports the expected methods and attributes without tight coupling to a specific library.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are building libraries that work with histograms from multiple sources or need to enforce histogram interface standards.
Install as a type-checking or testing dependency in projects that depend on histogram libraries like boost-histogram or hist. Not necessary for end-user code that only uses a single histogram library, but adds minimal friction and provides real value in interoperability scenarios.
Install
uhi on PyPI
Before you install
Low install friction with only numpy and typing-extensions as runtime dependencies. Actively maintained with recent releases; primarily designed as a type-checking and testing dependency for other libraries rather than a direct runtime requirement.
Requires Python 3.10 or later.
License in practice
BSD-3-Clause is permissive and places no significant restrictions on use or redistribution in commercial or open-source contexts.
Quickstart
pip install uhi
import uhi.typing.plotting
from uhi.numpy_plottable import ensure_plottable_histogram
# Check if an object conforms to PlottableHistogram protocol
isinstance(histogram_obj, uhi.typing.plotting.PlottableHistogram)
# Adapt NumPy-style histogram tuple to PlottableHistogram
plottable = ensure_plottable_histogram(counts, edges)
Verify before relying
- Whether the runtime-usable components (numpy_plottable adapter, protocol runtime checking) are sufficient for direct use or if this is primarily a transitive dependency.
- Performance characteristics when using isinstance() checks against PlottableHistogram at runtime in tight loops.
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesnumpytyping-extensions |
| Maintenance | Actively maintained 110 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 430,415 / month, #6,728 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/EngineeringTyping :: Typed |
Evidence: uhi-1.1.1-py3-none-any.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 › “histogram interface standard”
- uhiUHI defines and documents a standard interface for histogram objects…
- histoprintHistoprint renders NumPy histograms and compatible histogram objects…
- aiodogstatsdAn asyncio-based client for sending metrics to StatsD and DogStatsD,…
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 hist · boost-histogram · histoprint · hdrhistogram · uproot3-methods · omnibase_spi · plotille