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 coolaVerified import paths — ran on the pinned version, not inferred.
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.
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.
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.
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.
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.
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`.
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)`.
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.
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.