Skip to content
Tools for test driven data-wrangling and data validation.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
datatest Update difference behavior to support NaN values inside tuples. Jul 16, 2019
docs Add missing docs for unwrap() method to data-handling.rst. Jul 15, 2019
tests Update difference behavior to support NaN values inside tuples. Jul 16, 2019
.gitignore Add common virtual environment files and folders to .gitignore. May 18, 2019
.readthedocs.yml Add configuration file and requirements for ReadTheDocs. Apr 28, 2019
.travis.yml Add py3.8-dev to Travis-CI config (now using Xenial for 3.7 and 3.8 o… Apr 17, 2019
AUTHORS Update AUTHORS to clarify work-for-hire contributions and Jun 26, 2018
CHANGELOG Prepare version info, CHANGELOG, and README for version 0.9.6 release. Jun 3, 2019
LICENSE Update year from 2018 to 2019 for docs and copyright. Mar 28, 2019
MANIFEST.in Reorganize data files for test and update MANIFEST.in accordingly. Jan 27, 2018
README.rst Update README bullet points and add keywords to documentation index. Jun 1, 2019
release_checklist.txt Add step to release checklist for verifying documentation builds. Jun 3, 2019
requirements-dev.txt Rename requirements.txt to requirements-dev.txt to clarify intended use. Apr 21, 2019
run-tests.bat Change Abstract Base Class imports from "collections" package Jul 5, 2018
run-tests.sh Change Abstract Base Class imports from "collections" package Jul 5, 2018
setup.cfg Make changes to distribution files to play nice with PyPI. May 16, 2016
setup.py Add top-level-directory and start-directory options to test command. May 30, 2019

README.rst

datatest: Test driven data-wrangling and data validation

Current Build Status Development Status Apache 2.0 License Supported Python Versions

Datatest helps speed up and formalize data-wrangling and data validation tasks. It repurposes software testing practices for data preparation and quality assurance projects. Datatest can help you:

  • Clean and wrangle data faster and more accurately.
  • Maintain a record of checks and decisions regarding important data sets.
  • Distinguish between ideal criteria and acceptible deviation.
  • Measure progress of data preparation tasks.
  • On-board new team members with an explicit and structured process.
  • Test data pipeline components and end-to-end behavior.

Datatest supports both pytest and unittest style testing. It implements a system of validation methods, difference classes, and acceptance context managers.

Datatest has no hard dependencies; supports Python 2.6, 2.7, 3.1 through 3.8, PyPy, and PyPy3; and is freely available under the Apache License, version 2.

Documentation:
Official:

Installation

The easiest way to install datatest is to use pip:

pip install datatest

To upgrade an existing installation, use the "--upgrade" option:

pip install --upgrade datatest

Stuntman Mike

If you need bug-fixes or features that are not available in the current stable release, you can "pip install" the development version directly from GitHub:

pip install --upgrade https://github.com/shawnbrown/datatest/archive/master.zip

All of the usual caveats for a development install should apply---only use this version if you can risk some instability or if you know exactly what you're doing. While care is taken to never break the build, it can happen.

Safety-first Clyde

If you need to review and test packages before installing, you can install datatest manually.

Download the latest source distribution from the Python Package Index (PyPI):

https://pypi.org/project/datatest/ (navigate to "Download files")

Unpack the file (replacing X.Y.Z with the appropriate version number) and review the source code:

tar xvfz datatest-X.Y.Z.tar.gz

Change to the unpacked directory and run the tests:

cd datatest-X.Y.Z
python setup.py test

Don't worry if some of the tests are skipped. Tests for optional data sources (like pandas DataFrames or MS Excel files) are skipped when the related third-party packages are not installed.

If the source code and test results are satisfactory, install the package:

python setup.py install

Supported Versions

Tested on Python 2.6, 2.7, 3.1 through 3.8, PyPy, and PyPy3. Datatest is pure Python and may also run on other implementations as well (check using "setup.py test" before installing).

Backward Compatibility

If you have existing tests that use API features which have changed since 0.8.0, you can still run your old code by adding the following import to the beginning of each file:

from datatest.__past__ import api08

To maintain existing test code, this project makes a best-effort attempt to provide backward compatibility support for older features. The API will be improved in the future but only in measured and sustainable ways.

All of the data used at the National Committee for an Effective Congress has been checked with datatest for several years so there is, already, a large and growing codebase that relies on current features and must be maintained into the future.

Soft Dependencies

There are no hard, third-party dependencies. But if you want to interface with pandas DataFrames, MS Excel workbooks, or other optional data sources, you will need to install the relevant packages (pandas, xlrd, etc.).

Older Pythons (3.1 and 2.6)

While datatest supports Python 3.1 and 2.6, some earlier builds of these versions were bundled with an older version of SQLite that is not compatible with datatest. The sqlite3 package is part of the Python Standard Library and some features of datatest use it for internal data handling---though users never need to use the package directly.

If you must use one of these older Python versions and you are experiencing issues, it is recommended that you upgrade to the latest patch release (currently Python 3.1.5 or Python 2.6.9).

Development Repository

The development repository for datatest is hosted on GitHub.


Freely licensed under the Apache License, Version 2.0

Copyright 2014 - 2019 National Committee for an Effective Congress, et al.

You can’t perform that action at this time.