{"id":27272,"library":"pycsvschema","title":"PyCSVSchema","description":"PyCSVSchema is a Python implementation of the CSV Schema specification (version 0.3). It allows you to validate CSV files against a schema defined in YAML or JSON. Currently at version 0.0.6, it is in early development with weekly commits.","status":"active","version":"0.0.6","language":"python","source_language":"en","source_url":"https://github.com/csv-schema/PyCSVSchema","tags":["csv","schema","validation","csv-schema"],"install":[{"cmd":"pip install pycsvschema","lang":"bash","label":"pip"}],"dependencies":null,"imports":[{"wrong":"from pycsvschema import CSVSchema","symbol":"CSVSchema","correct":"from pycsvschema import CSVSchema"}],"quickstart":{"code":"import yaml\nfrom pycsvschema import CSVSchema\n\nschema_yaml = \"\"\"\nfields:\n  - name: id\n    type: integer\n    constraints:\n      required: true\n  - name: name\n    type: string\n\"\"\"\nschema = yaml.safe_load(schema_yaml)\nvalidator = CSVSchema(schema)\n\nwith open('data.csv', 'r') as f:\n    errors = validator.validate(f)\n\nfor error in errors:\n    print(error)\n","lang":"python","description":"Load a schema from YAML, create a CSVSchema instance, and validate a CSV file."},"warnings":[{"fix":"Parse the schema using yaml.safe_load() or json.loads() before passing to CSVSchema.","message":"PyCSVSchema expects the schema in Python dict form (parsed from YAML/JSON), not a raw string. Passing a schema string directly will raise a TypeError.","severity":"gotcha","affected_versions":"all"},{"fix":"Use CSVSchema instead of CSVValidator. Change imports and constructor calls.","message":"In v0.0.6, the library switched from CSVValidator class to CSVSchema. Importing CSVValidator from pycsvschema no longer works.","severity":"breaking","affected_versions":">=0.0.6"},{"fix":"Use with open('file.csv') as f: validator.validate(f) instead of validator.validate('file.csv').","message":"Using 'validate()' with a file path string is deprecated; always pass a file object (opened via open()).","severity":"deprecated","affected_versions":">=0.0.5"}],"env_vars":null,"search_vec":"'0.0.6':32 '0.3':13 'allow':15 'commit':40 'csv':9,19,41,45 'csv-schema':44 'current':29 'defin':24 'develop':37 'earli':36 'file':20 'implement':6 'json':28 'pycsvschema':1,2 'python':5 'schema':10,23,42,46 'specif':11 'valid':18,43 'version':12,31 'week':39 'yaml':26","created_at":"2026-05-01T17:45:24.319531+00:00","updated_at":"2026-05-01T17:45:24.319531+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nImportError: cannot import name 'CSVSchema' from 'pycsvschema' (/tmp/tmpbclq_sud/venv/lib/python3.12/site-packages/pycsvschema/__init__.py)"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"csvschema","cli_version":"sh: 1: csvschema: not found","type":"library","homepage":null,"github":"https://github.com/csv-schema/PyCSVSchema","docs":null,"changelog":null,"pypi":"https://pypi.org/project/pycsvschema/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}