Package: tdda
What is it?The TDDA Python module provides command-line and Python API support for
the overall process of data analysis, through the following tools:Reference Testing: extensions tounittestandpytestfor
managing testing of data analysis pipelines, where the results are
typically much larger, and more complex, than single numerical
values.Constraints: tools (and API) for discovery of constraints from data,
for validation of constraints on new data, and for anomaly detection.Finding Regular Expressions (Rexpy): tools (and API) for automatically
inferring regular expressions from text data.Automatic Test Generation (Gentest): TDDA can generate tests for
more-or-less any command that can be run from a command line,
whether it be Python code, R code, a shell script, a shell
command, aMakefileor a multi-language pipeline involving
compiled code. _”Gentest writes tests, so you don’t have to.”™_<img width=”100%” src=”doc/source/image/tdda-machines-light.png”/>Documentationhttp://tdda.readthedocs.ioInstallationThe simplest way to install all of the TDDA Python modules is usingpip:pip install tddaThe full set of sources, including all examples, are downloadable from
PyPi with:pip download –no-binary :all: tddaThe sources are also publicly available from Github:git clonegit@github.com:tdda/tdda.gitDocumentation is available athttp://tdda.readthedocs.io.If you clone the Github repo, usepython setup.py installafterwards to install the command-line tools (tddaandrexpy).Reference TestsThetdda.referencetestlibrary is used to support
the creation ofreference tests, based on either unittest or pytest.These are like other tests except:They have special support for comparing strings to files
and files to files.That support includes the ability to provide exclusion patterns
(for things like dates and versions that might be in the output).When a string/file assertion fails, it spits out the command you
need to diff the output.If there were exclusion patterns, it also writes modified versions
of both the actual and expected output and also prints the diff
command needed to compare those.They have special support for handling CSV files.It supports flags (-w and -W)  to rewrite the reference (expected)
results once you have confirmed that the new actuals are correct.For more details from a source distribution or checkout, see theREADME.mdfile and examples in thereferencetestsubdirectory.ConstraintsThetdda.constraintslibrary is used to ‘discover’ constraints
from a (Pandas) DataFrame, write them out as JSON, and to verify that
datasets meet the constraints in the constraints file.For more details from a source distribution or checkout, see theREADME.mdfile and examples in theconstraintssubdirectory.Finding Regular ExpressionsThetddarepository also includesrexpy, a tool for automatically
inferring regular expressions from a single field of data examples.ResourcesResources on these topics include:TDDA Blog:http://www.tdda.infoQuick Reference Guide (“Cheatsheet”):http://www.tdda.info/pdf/tdda-quickref.pdf1-page summary:https://stochasticsolutions.com/pdf/TDDA-One-Pager.pdfFull documentation:http://tdda.readthedocs.ioGeneral Notes on Constraints and Assertions:http://www.tdda.info/constraints-and-assertionsNotes on using the Pandas constraints library:http://www.tdda.info/constraint-discovery-and-verification-for-pandas-dataframesPyCon UK Talk on TDDA:Video:https://www.youtube.com/watch?v=FIw_7aUuY50Slides and Rough Transcript:http://www.tdda.info/slides-and-rough-transcript-of-tdda-talk-from-pycon-uk-2016All examples, tests and code run under Python 2.7, Python 3.5 and Python 3.6.