Skip to main content

PyCSVSchema is an implementation of CSV Schema in Python.

Project description

PyPI Page: https://pypi.python.org/pypi/pycsvschema

Github Page: https://github.com/crowdskout/PyCSVSchema

Introduction

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

License

PyCSVSchema uses the MIT license, see LICENSE file for the details.

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

pycsvschema-0.0.6.tar.gz (8.7 kB view hashes)

Uploaded Source

Built Distribution

pycsvschema-0.0.6-py3-none-any.whl (13.6 kB view hashes)

Uploaded Python 3

Supported by

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