skillfed

coola

Library to check equality between two complex/nested objects

coola v1.1.10 1.0M downloads/30d#4,525 on PyPI1
Permissive license BSD-3-Clause Active released

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 coola

uv

uv add coola

poetry

poetry add coola

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseOperating System :: MacOSOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/EngineeringTopic :: Software Development :: LibrariesTopic :: Software Development :: Testing

Tags

compare nested data structuresequality testing for complex objectsdataframe comparisonnumerical tolerance comparisonnested structure diff reportingtensor array comparison
testingdata-structuresscientific-computing

More Libraries packages