Skip to content

PyCSVSchema is an implementation of CSV Schema in Python.

License

Notifications You must be signed in to change notification settings

crowdskout/PyCSVSchema

Repository files navigation

PyCSVSchema

PyCSVSchema is an implementation of CSV Schema in Python.

This project is under heavy development.

>>> from pycsvschema.checker import Validator
>>> 
>>> # demo.csv:
... # id,name,value
... # 1,Ann,"5"
... # 2,Ben,"10"
... # 3,Tom,"14"
... 
>>> 
>>> schema = {
...     'fields': [
...         {
...             'name': 'value',
...             'type': 'number',
...             'multipleOf': 5
...         }
...     ]
... }
>>> 
>>> v = Validator(filename='demo.csv', schema=schema)
>>> v.validate()

Traceback (most recent call last):
...
<ValidationError: 'Value 14.0 is not multiple of 5'; column: value; row: 3>

Installation

pip install pycsvschema

Requirements

Python 3.5 or above

TODO

  • tests

About

PyCSVSchema is an implementation of CSV Schema in Python.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published