datatyping is a pure Python library with no dependencies that you can use to verify whether elements in a data structure have the expected types. Great for incoming JSON.
import datatyping
datatyping.validate([int], [1, 2, 3])
Check out the documentation for more usage examples.
$ pip install datatyping
Fork the repository first. Then use the following lines to setup:
$ git clone https://github.com/YOUR_USERNAME/datatyping
$ cd datatyping
$ virtualenv venv
$ . venv/bin/activate
$ python setup.py develop
Run tests:
$ pip install pytest hypothesis
$ python -m pytest
Build documentation:
$ make -C docs/ html
- Inspired by "How Python Makes Working With Data More Difficult in the Long Run".
- Any and all contributions are welcome.
- Please open an issue if you think we can help.
- Suggest anything you want to see support for!