csvschemavalidation


Namecsvschemavalidation JSON
Version 0.0.8 PyPI version JSON
download
home_pagehttps://github.com/YasineNifa/PyCSVSchema
Summarycsvschemavalidation is an implementation of CSV Schema in Python.
upload_time2023-03-22 10:45:39
maintainer
docs_urlNone
authorYassine Nifa
requires_python
licenseMIT
keywords csv schema json jsonschema validation validator
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            # csvschemavalidation

csvschemavalidation is an implementation of [CSV Schema](https://github.com/csvschema/csvschema) in Python.

This project is at Alpha version and still under heavy development.

## Example

```python
>>> from csvschemavalidation.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(csvfile='demo.csv', schema=schema)
>>> v.validate()

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

Note that the validator does not check if the CSV format fits the dialect defined in schema correctly. For example, if wrong delimiter present in schema, validator might read the whole line as one cell.

## Installation

```bash
pip install csvschemavalidation
```

## Requirements

Python 3.5 or above


## TODO
* Documentation and Examples
* Optional header
* Decide whether to rely on Python's built-in int and float function to convert values
* Tests

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/YasineNifa/PyCSVSchema",
    "name": "csvschemavalidation",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "csv schema json jsonschema validation validator",
    "author": "Yassine Nifa",
    "author_email": "yasine.nifa@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/a9/ed/b31b05f3b75f398081ce52af24ee02713e2efa93b13a5cdbc8619618c798/csvschemavalidation-0.0.8.tar.gz",
    "platform": null,
    "description": "# csvschemavalidation\n\ncsvschemavalidation is an implementation of [CSV Schema](https://github.com/csvschema/csvschema) in Python.\n\nThis project is at Alpha version and still under heavy development.\n\n## Example\n\n```python\n>>> from csvschemavalidation.checker import Validator\n>>> # demo.csv:\n... # id,name,value\n... # 1,Ann,\"5\"\n... # 2,Ben,\"10\"\n... # 3,Tom,\"14\"\n>>> schema = {\n...     'fields': [\n...         {\n...             'name': 'value',\n...             'type': 'number',\n...             'multipleOf': 5\n...         }\n...     ]\n... }\n>>> v = Validator(csvfile='demo.csv', schema=schema)\n>>> v.validate()\n\nTraceback (most recent call last):\n...\n<ValidationError: 'Value 14.0 is not multiple of 5'; column name: value; row number: 3>\n```\n\nNote that the validator does not check if the CSV format fits the dialect defined in schema correctly. For example, if wrong delimiter present in schema, validator might read the whole line as one cell.\n\n## Installation\n\n```bash\npip install csvschemavalidation\n```\n\n## Requirements\n\nPython 3.5 or above\n\n\n## TODO\n* Documentation and Examples\n* Optional header\n* Decide whether to rely on Python's built-in int and float function to convert values\n* Tests\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "csvschemavalidation is an implementation of CSV Schema in Python.",
    "version": "0.0.8",
    "split_keywords": [
        "csv",
        "schema",
        "json",
        "jsonschema",
        "validation",
        "validator"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cb6cd5622b8a363a7eaae1f4d06791e1e450cdb3e11e598692835fec696dc479",
                "md5": "0ccbac5c7e289a1a75131b9c70069cee",
                "sha256": "3ab14410b630b90c732cc9ecd6e3fe2cb2ba51c7c1a5cfc029bd01883b375bd7"
            },
            "downloads": -1,
            "filename": "csvschemavalidation-0.0.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0ccbac5c7e289a1a75131b9c70069cee",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 16270,
            "upload_time": "2023-03-22T10:45:37",
            "upload_time_iso_8601": "2023-03-22T10:45:37.720270Z",
            "url": "https://files.pythonhosted.org/packages/cb/6c/d5622b8a363a7eaae1f4d06791e1e450cdb3e11e598692835fec696dc479/csvschemavalidation-0.0.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a9edb31b05f3b75f398081ce52af24ee02713e2efa93b13a5cdbc8619618c798",
                "md5": "419f5722835401e827200dab164c7716",
                "sha256": "f9d806043a7fbbf741aa08c4b0e868d175e5e68299e9dd6fbecfda8b30217b8f"
            },
            "downloads": -1,
            "filename": "csvschemavalidation-0.0.8.tar.gz",
            "has_sig": false,
            "md5_digest": "419f5722835401e827200dab164c7716",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 13978,
            "upload_time": "2023-03-22T10:45:39",
            "upload_time_iso_8601": "2023-03-22T10:45:39.468507Z",
            "url": "https://files.pythonhosted.org/packages/a9/ed/b31b05f3b75f398081ce52af24ee02713e2efa93b13a5cdbc8619618c798/csvschemavalidation-0.0.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-22 10:45:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "YasineNifa",
    "github_project": "PyCSVSchema",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "csvschemavalidation"
}
        
Elapsed time: 0.70523s