{"id":24195,"library":"pandas-schema","title":"pandas-schema","description":"A validation library for Pandas data frames using user-friendly schemas. Current version is 0.3.6, with infrequent releases.","status":"maintenance","version":"0.3.6","language":"python","source_language":"en","source_url":"https://github.com/TMiguelT/PandasSchema","tags":["pandas","validation","dataframe","schema"],"install":[{"cmd":"pip install pandas-schema","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required to work with DataFrames","package":"pandas","optional":false}],"imports":[{"note":"DataFrameSchema is exposed at the package level","wrong":"from pandas_schema.schema import DataFrameSchema","symbol":"DataFrameSchema","correct":"from pandas_schema import DataFrameSchema"},{"note":"","wrong":"","symbol":"Column","correct":"from pandas_schema import Column"},{"note":"Check and validators are in the validation submodule","wrong":"from pandas_schema import Check","symbol":"Check","correct":"from pandas_schema.validation import Check"}],"quickstart":{"code":"import pandas as pd\nfrom pandas_schema import DataFrameSchema, Column\nfrom pandas_schema.validation import CanConvertValidation\n\nschema = DataFrameSchema({\n    'age': Column(int, [\n        CanConvertValidation(int)\n    ])\n})\ndf = pd.DataFrame({'age': ['25', '30']})\nerrors = schema.validate(df)\nif errors:\n    for error in errors:\n        print(error)\nelse:\n    print('Validation passed')","lang":"python","description":"Define a schema and validate a DataFrame. Returns list of errors."},"warnings":[{"fix":"Use int, float, str, etc.","message":"Column type parameter expects Python types (e.g., int, float) not numpy dtypes. Using 'int64' may cause unexpected behavior.","severity":"gotcha","affected_versions":"0.x"},{"fix":"Use from pandas_schema.validation import Check, CanConvertValidation, etc.","message":"Validators are in pandas_schema.validation; importing from pandas_schema directly won't give Check or validation classes.","severity":"gotcha","affected_versions":"0.x"},{"fix":"Upgrade to 0.3.6 or ensure data is numeric before validation.","message":"InRangeValidation crashes on non-numeric text in versions <=0.3.5. This is fixed in 0.3.6.","severity":"gotcha","affected_versions":"<=0.3.5"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use: from pandas_schema.validation import Check","cause":"Check class is in the validation submodule, not at package level.","error":"ImportError: cannot import name 'Check' from 'pandas_schema'"},{"fix":"Instantiate DataFrameSchema and call schema.validate(df).","cause":"Confusion with pandas built-in validate; the package provides schema.validate(df).","error":"AttributeError: 'DataFrame' object has no attribute 'validate'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}