--- id: trafaret version: "2.1.1" license: BSD license_treatment: permissive maintenance: abandoned --- # trafaret — Validation and parsing library License: permissive · Maintenance: abandoned · Downloads: 964.4K/mo ## What it is and what it does Trafaret is a validation and data transformation library that lets you define schemas to check and convert incoming data—configs, JSON, form submissions, or any structured input. You write a schema once (using a shorthand syntax or composable validator objects), then call it to validate and transform data; if the data doesn't match, you get detailed error messages showing exactly what failed and where. The library supports custom error messages, context passing during validation, and async checking via async_check. It has no runtime dependencies, making it lightweight to add to a project. However, the package has been abandoned since April 2022 with no recent commits, so it receives no maintenance or security updates. Use it for: - Validate JSON payloads in web APIs before processing, catching malformed or missing fields early - Check and transform configuration files (YAML, JSON, TOML) at startup to ensure required keys and correct types - Validate and normalize form submissions in web applications, converting string inputs to the correct types - Build data pipelines that require strict schema enforcement, transforming data as it flows through stages - Parse and validate user input in CLI tools, ensuring arguments and options meet expected formats ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Trafaret validates and transforms foreign data (JSON, configs, user input) against schemas you define, with support for custom error messages and async checking. Yes, if you need a lightweight, dependency-free validation library and can accept that the package is no longer maintained. The API is stable and works well for straightforward schema validation tasks. No, if you require active maintenance, security updates, or support for the latest Python versions—consider an actively maintained alternative like Pydantic or Marshmallow instead. ## Install pip install trafaret uv add trafaret poetry add trafaret ## Installing trafaret Before you install: Low install friction with no runtime dependencies. However, the package is abandoned—last release was 2022-04-01 and no commits since then. Use only if you accept the risk of no future maintenance or security updates. License in practice: BSD license is permissive; you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions. Quickstart: pip install trafaret import trafaret as t validator = t.Dict(a=t.Int, b=t.List(t.String)) result = validator.check({'a': 5, 'b': ['lorem', 'ipsum']}) Verify before relying: - Whether the package works reliably with modern Python versions (requires_python is unspecified in the fact sheet) - Whether async_check and aiohttp support mentioned in the description are fully functional in version 2.1.1 ## Package facts - License: BSD (permissive) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 964.4K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags data validation library, schema validation python, json schema validator, config validation, data transformation validation, form data validation, structured data checking, validation, schema-checking, data-transformation [View on SkillFed](https://skillfed.io/packages/trafaret) · [View on PyPI](https://pypi.org/project/trafaret/)