Datatest provides tools for test driven data-wrangling and
data validation. It supports both pytest and unittest style
testing.
I've been working to get datatest ready for a few pre-PyCon
updates. This latest release takes many of the "how-to"
solutions and brings them into the core package.
* Docs - https://datatest.readthedocs.io/
* PyPI - https://pypi.org/project/datatest/
* Devel - https://github.com/shawnbrown/datatest
Upgrade an existing installation to 0.9.4:
pip install --upgrade datatest
What's New in Datatest 0.9.4:
* Added Python 3.8 testing and support.
* Added new validate methods (moved from how-to recipes into
core module):
* Added approx() method to require for approximate numeric
equality.
* Added fuzzy() method to require strings by approximate match.
* Added interval() method to require elements within a given
interval.
* Added set(), subset(), and superset() methods for explicit
membership checking.
* Added unique() method to require unique elements.
* Added order() method to require elements by relative order.
* Changed default sequence validation to check elements by
index position rather than checking by relative order.
* Added fuzzy-matching allowance to allow strings by approximate
match.
* Added Predicate class to formalize behavior--also provides
inverse-matching with the inversion operator (~).
* Added new methods to Query class:
* Added unwrap() to remove single-element containers and return
their unwrapped contents.
* Added starmap() to unpack grouped arguments when applying a
function to elements.
* Fixed improper use of assert statements with appropriate
conditional checks and error behavior.
* Added requirement class hierarchy (using BaseRequirement). This
gives users a cleaner way to implement custom validation behavior
and makes the underlying codebase easier to maintain.
* Changed name of ProxyGroup to RepeatingContainer.
* Changed "How To" examples to use the new validation methods.
Datatest version 0.9.6 is now available.
Datatest helps speed up and formalize data-wrangling and data validation tasks. It repurposes software testing practices for data preparation and quality assurance projects.
* Docs - https://datatest.readthedocs.io/ * PyPI - https://pypi.org/project/datatest/ * Devel - https://github.com/shawnbrown/datatest
Upgrade an existing installation:
pip install --upgrade datatest
What's New in Datatest 0.9.6:
* Cleaned up the acceptance API to make it both less verbose and more expressive: * Consolidated specific-instance and class-based acceptances into a single interface. * Added a new accepted.tolerance() method that subsumes the behavior of accepted.deviation() by supporting Missing and Extra quantities in addition to Deviation objects. * Deprecated old methods:
======================= ================================== Old Syntax New Syntax ======================= ================================== accepted.specific(...) accepted(...) accepted.missing() accepted(Missing) accepted.extra() accepted(Extra) *NO EQUIVALENT* accepted(CustomDifferenceClass) accepted.deviation(...) accepted.tolerance(...) accepted.limit(...) accepted.count(...) *NO EQUIVALENT* accepted.count(..., scope='group') ======================= ==================================
Other methods--accepted.args(), accepted.keys(), etc.--remain unchanged.
* Changed validation to generate Deviation objects for a broader definition of quantitative values (like datetime objects)--not just for subclasses of numbers.Number. * Changed handling for pandas.Series objects to treat them as sequences instead of mappings. * Added handling for DBAPI2 cursor objects to automatically unwrap single-value rows. * Removed acceptance classes from datatest namespace--these were inadvertently added in a previous version but were never part of the documented API. They can still be referenced via the `acceptances` module:
from datatest.acceptances import ...
python-announce-list@python.org