coola
Library to check equality between two complex/nested objects
What it is and what it does
coola is a lightweight equality-checking library for scientific Python that solves the problem of comparing complex nested structures containing tensors, arrays, and DataFrames—objects where Python's native `==` operator fails or produces unexpected results. It provides three main functions: `objects_are_equal()` for strict comparison, `objects_are_allclose()` for numerical tolerance, and difference reporting to show exactly what differs between two structures.
Beyond equality checking, coola also offers utilities for data summarization (human-readable nested structure summaries), conversion between list-of-dicts and dict-of-lists formats, mapping utilities for flattening and filtering nested dictionaries, systematic traversal via depth-first and breadth-first search, and reduction operations (min, max, mean, median, quantile, std) on numeric sequences with pluggable backends. It has no core dependencies, making it lightweight, and supports modern Python versions (3.10 and above).
Use it for:
- Unit testing: Compare expected and actual outputs in tests with clear failure messages showing structural differences.
- Numerical validation: Check if two nested structures are equal within a tolerance using `objects_are_allclose()`.
- Data pipeline debugging: Summarize and compare intermediate results to identify where data diverges.
- Configuration comparison: Flatten and compare nested configuration dictionaries or extract specific values.
- Batch processing: Traverse nested collections using DFS/BFS to filter or extract specific data types.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
coola compares complex nested data structures containing tensors, arrays, DataFrames, and other scientific objects for exact or approximate equality, with detailed difference reporting.
Yes. coola is actively maintained, has no core dependencies, supports current Python versions, carries no known vulnerabilities, and solves a real problem for anyone working with nested data structures in testing or validation. The permissive BSD-3-Clause license poses no restrictions. Install it if you regularly compare complex objects.
Install
coola on PyPI
pip
pip install coolauv
uv add coolapoetry
poetry add coolaInstalling coola
Before you install
Low install friction with no runtime dependencies; actively maintained with a release 15 days ago and recent commits.
License in practice
BSD-3-Clause is permissive; you can use, modify, and distribute coola freely in commercial and private projects with minimal restrictions.
Quickstart
pip install coola
from coola.equality import objects_are_equal
data1 = {"key": "value1"}
data2 = {"key": "value1"}
result = objects_are_equal(data1, data2)
print(result) # True
Requires Python 3.10 or higher; optional dependencies must be installed separately to compare specific types like tensors or arrays.
Verify before relying
- Whether custom comparators can be registered for user-defined types beyond the documented supported types
- Performance characteristics when comparing very large nested structures or deeply nested hierarchies
- Whether the library handles circular references in nested structures
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 15 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,006,325/month — #4,525 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: coola-1.1.10-py3-none-any.whl
Keywords: equality, jax, numpy, pandas, polars, pyarrow, pytorch, testing, xarray
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
recursive-diffRecursively compares two Python data structures…
permissive · top 15,000 on PyPI
feufeu checks package availability, resolves…
permissive · top 5,000 on PyPI
datacompyDataComPy compares two DataFrames across…
permissive · top 5,000 on PyPI
narwhalsNarwhals provides a lightweight compatibility…
permissive · top 1,000 on PyPI
jsoncomparisonCompares two JSON-like objects and returns a…
permissive · top 5,000 on PyPI
array-api-compatProvides a unified wrapper around NumPy, CuPy,…
permissive · top 5,000 on PyPI
dataframe-api-compatProvides a lightweight compatibility layer that…
permissive · top 15,000 on PyPI
pyjsonCompares the similarity between two JSON files…
permissive · top 15,000 on PyPI
deepdiff6DeepDiff recursively compares two Python…
permissive · top 15,000 on PyPI
awkward-pandasExtends pandas DataFrames to store and…
permissive · top 15,000 on PyPI