{"id":23725,"library":"fields","title":"Fields","description":"A Python library for eliminating class boilerplate by providing an attrs/dataclass-like container class with built-in validation and transformation. Current version is 5.0.0, released on 2025-12-05. Development appears slow; pre-5.0.0 releases were irregular.","status":"active","version":"5.0.0","language":"python","source_language":"en","source_url":"https://github.com/ionelmc/python-fields","tags":["metaclass","class decorator","validation","container","boilerplate"],"install":[{"cmd":"pip install fields","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"wrong":"from fields import Field","symbol":"Fields","correct":"from fields import Fields"},{"symbol":"BareFields","correct":"from fields import BareFields"},{"symbol":"ConvertibleFields","correct":"from fields import ConvertibleFields"}],"quickstart":{"code":"from fields import fields, Field\n\n@fields\nclass Point:\n    x: int = Field(required=True)\n    y: int = 0\n\np = Point(x=3)\nprint(p.x, p.y)  # 3 0","lang":"python","description":"Define a container class with automatic __init__, __repr__, and validation via type hints and Field descriptors."},"warnings":[{"fix":"Define classmethods/staticmethods outside the @fields class or use a different decorator pattern.","message":"Classmethod and staticmethod descriptors conflict with field inspection; avoid using them inside @fields classes.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use keyword argument 'name' only when necessary; prefer relying on the variable name.","message":"Field name checking uses both the slot name and the variable name; renaming a field variable but not updating the Field's 'name' argument can cause silent failures.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Replace Field(validate=func) with Field(check=func).","message":"The 'validate' parameter in Field is deprecated in 5.0.0; use the 'check' parameter instead.","severity":"deprecated","affected_versions":"5.0.0"}],"env_vars":null,"search_vec":"'-05':30 '-12':29 '2025':28 '5.0.0':25,35 'appear':32 'attrs/dataclass-like':12 'boilerpl':8,44 'built':17 'built-in':16 'class':7,14,40 'contain':13,43 'current':22 'decor':41 'develop':31 'elimin':6 'field':1 'irregular':38 'librari':4 'metaclass':39 'pre':34 'provid':10 'python':3 'releas':26,36 'slow':33 'transform':21 'valid':19,42 'version':23","created_at":"2026-05-01T08:09:17.418158+00:00","updated_at":"2026-05-01T08:09:17.418158+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"5.0.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/ionelmc/python-fields","docs":null,"changelog":null,"pypi":"https://pypi.org/project/fields/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}