Skip to main content

Test Driven Data Analysis

Project description

Installation

The simplest way to install all of the TDDA Python modules is using pip:

pip install tdda

But note that it is not particularly easy to run through the examples using a PyPi binary installation like that. The full set of sources, including all examples, will be downloadable from PyPi with:

pip download –no-binary :all: tdda

The sources are also publicly available from Github:

git clone git@github.com:tdda/tdda.git

Documentation is available at [http://pythonhosted.org/tdda/](http://pythonhosted.org/tdda/).

If you clone the Github repo, use

python setup.py install

afterwards to install the command-line tools (tdda and rexpy).

Level 0:

The tdda.referencetest library is used to support the creation of reference tests, based on either unittest or pytest.

These are like other tests except:

  1. They have special support for comparing strings to files and files to files.

  2. That support includes the ability to provide exclusion patterns (for things like dates and versions that might be in the output).

  3. When a string/file assertion fails, it spits out the command you need to diff the output.

  4. 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.

  5. They have special support for handling CSV files.

  6. It supports flags (-w and -W) to rewrite the reference (expected) results once you have confirmed that the new actuals are correct.

The package includes docstrings, available with:

>>> from tdda import referencetest
>>> help(referencetest)

For more details from a source distribution or checkout, see the README.md file and examples in the referencetest subdirectory.

An older implementation of these ideas is available as a unittest wrapper class, WritableTestCase, in writabletestcase.py. This can be imported directly with from tdda.writabletestcase import WritableTestCase. Examples of using this are currently available in the deprecated subdirectory. This older version will be fully deprecated and removed soon.

Level 1:

The tdda.constraints library 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 usage details:

>>> from tdda import constraints
>>> help(constraints)

For more details from a source distribution or checkout, see the README.md file and examples in the constraints subdirectory.

Resources

Resources on these topics include:

All examples, tests and code should run under Python2 and Python3.

The tdda repository also includes rexpy, a tool for automatically inferring regular expressions from a single field of data examples.

The package also has doc strings, which you can see with:

>>> from tdda import rexpy
>>> help(rexpy)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tdda-0.3.10.tar.gz (109.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tdda-0.3.10-py3-none-any.whl (141.6 kB view details)

Uploaded Python 3

tdda-0.3.10-py2-none-any.whl (141.6 kB view details)

Uploaded Python 2

File details

Details for the file tdda-0.3.10.tar.gz.

File metadata

  • Download URL: tdda-0.3.10.tar.gz
  • Upload date:
  • Size: 109.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tdda-0.3.10.tar.gz
Algorithm Hash digest
SHA256 fe7f0b1f381ab33266a543d3d8afef73d7cf21bd710c9b2e8246b9035816fb02
MD5 371db573e925884ea36ced4347d93c6a
BLAKE2b-256 d10c55ff9578ee6f5f835f5529d5be026705891ac220021a02f63b089d8cd51c

See more details on using hashes here.

File details

Details for the file tdda-0.3.10-py3-none-any.whl.

File metadata

File hashes

Hashes for tdda-0.3.10-py3-none-any.whl
Algorithm Hash digest
SHA256 c6c9813afa01eb712361b4b22ad25e05604b5dde6a71fa32823217e3c828b04c
MD5 3ed121ff4844c1e928f9af9c1a4e46af
BLAKE2b-256 ff129d7f0362e6fdfed0db3e80a8c7821175669dd96c4330ab9cb5b2a3e9af9b

See more details on using hashes here.

File details

Details for the file tdda-0.3.10-py2-none-any.whl.

File metadata

File hashes

Hashes for tdda-0.3.10-py2-none-any.whl
Algorithm Hash digest
SHA256 292f7e8543bfe60d370955f04afc7e903fec26ac7680515d5d2e20ff51cc5d56
MD5 13289fc758ee85d75efa2b92e51266e7
BLAKE2b-256 19e21a2beb748da4da8bfea60aef037da3a6afa56d6fa293c3bb30bdbefed176

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page