Registry / testing / coola
library1.1.10pypypi✓ verified 23d ago

Coola is a Python library designed for robustly checking equality between two complex or nested Python objects. It provides a flexible mechanism to compare various data structures, going beyond Python's default `==` operator for deep and custom comparisons. The library is actively maintained with frequent minor releases, ensuring ongoing development and improvements.

pip install coola
INSTALL
IMPORT
SIG · COOLA
C
coola
testingpythonv1.1.10
Install
1.8s avg
Import
181ms
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.1.10 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.148s · 19.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.8s · import 0.142s · 20MB
18MB installed
● package 18MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

objects_are_equal
from coola.equality import objects_are_equal

This quickstart demonstrates how to use `objects_are_equal` to perform deep comparisons on nested dictionaries and lists. It shows both identical and differing structures, highlighting the library's ability to handle complex objects.

from coola.equality import objects_are_equal obj1 = {'a': 1, 'b': [2, {'c': 3}], 'd': {'e': 4}} obj2 = {'d': {'e': 4}, 'b': [2, {'c': 3}], 'a': 1} obj3 = {'a': 1, 'b': [2, {'c': 99}], 'd': {'e': 4}} # Deep comparison of two equal nested objects (order-independent for dicts) print(f"obj1 == obj2: {objects_are_equal(obj1, obj2)}") # Deep comparison of two different nested objects print(f"obj1 == obj3: {objects_are_equal(obj1, obj3)}") # Comparison with a custom tolerance for floats (example for potential feature) float_obj1 = {'x': 1.000000001} float_obj2 = {'x': 1.000000002} # For demonstration, assume a tolerance parameter, actual API might vary # print(f"float_obj1 == float_obj2 with tolerance: {objects_are_equal(float_obj1, float_obj2, atol=1e-8)}")
Debug
Known issues
breakingIn version 1.1.0, the `coola.utils.imports` module was converted into a package, leading to a reorganization of its functions into different modules. Code that directly imports from or patches `coola.utils.imports` will break.
fix
Review and update import paths for functionalities previously located in `coola.utils.imports` according to the new package structure. Refer to the official documentation for the updated paths.
affects: >=1.1.0
breakingVersion 1.0.0 introduced significant API alignment across all functionalities. While aiming for consistency, this release may contain breaking changes for users upgrading from pre-1.0.0 versions, particularly regarding naming conventions and usage patterns.
fix
Carefully review the release notes for version 1.0.0 and subsequent releases. Update code to align with the new API consistency, especially for function names and parameter signatures.
affects: >=1.0.0 (from pre-1.0.0)
gotchaWhen comparing floating-point numbers in nested structures, direct equality checks can fail due to precision issues. While `coola` offers advanced comparison, ensure you configure appropriate tolerances (e.g., `atol` or `rtol` parameters if available in the specific comparison function) for floats to avoid unexpected `False` results.
fix
Consult the `coola` documentation for functions that support approximate comparisons (e.g., with `atol` or `rtol` arguments) when dealing with floating-point numbers, especially in numerical or scientific applications.
affects: All
gotchaBy default, `coola` might perform strict type and value comparisons. For custom classes or objects with complex internal states, you might need to register custom comparison logic or ensure your `__eq__` and `__hash__` methods are correctly implemented for `coola` to interpret equality as intended.
fix
For custom objects, either implement robust `__eq__` and `__hash__` methods or explore `coola`'s features for registering custom comparison functions or strategies for specific types, if supported.
affects: All
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'coola'
The 'coola' library is not installed in the Python environment, or there is a typo in the import statement.
fix
Install the library using pip: `pip install coola` (if a package named 'coola' exists for deep equality checking, otherwise verify the correct library name). If a different library like 'python-deepcompare' or 'deep-compare' was intended, install that instead: `pip install python-deepcompare` or `pip install deep-compare`.
AttributeError: module 'coola' has no attribute 'check'
The `check` function or method is being called from the `coola` module, but it either does not exist, or the module was imported incorrectly. This might occur if the user expected a function like `check` based on the description but the actual API differs, or if they imported a different library named 'coola' that does not have this attribute.
fix
Verify the correct function name and usage by consulting the library's official documentation. If the intended library is for deep equality, common functions might be `compare` or `deep_compare`. For example, `from deep_compare import CompareVariables` and then `CompareVariables.compare(obj1, obj2)`.
TypeError: 'str' object cannot be interpreted as an integer
A function or method within the `coola` library (or a similarly named library) that expects an integer (or another specific type) received a string (or an incompatible type) as an argument. This is a generic Python `TypeError` that often arises from incorrect input types to a function.
fix
Review the function signature and expected argument types in the library's documentation. Ensure that the values passed to the function are of the correct data type. For instance, convert a string to an integer using `int()` if an integer is required, or adjust the input data accordingly.
from coola import *
While not an error message itself, using a wildcard import (`*`) is often discouraged in Python as it can lead to name collisions and make code harder to read and debug, especially in libraries with many functions or if a different library like 'coala' (a linter) was mistakenly imported. With a library for equality, this could unintentionally import other utilities.
fix
Replace the wildcard import with specific imports for the functions or classes actually used. For example, if a function `check_equality` is used: `from coola import check_equality`. This makes the code clearer and avoids potential conflicts.
Upgrade
Version history
1.1.10latest on PyPI · released Jul 30, 2026
Audit
Dependencies
pythonrequiredRuntime environment
Agent activity
14 hits · last 30 days
node
12
OpenAI (training)
1
Resources
coola — pip install coola · libregistry