[{"data":1,"prerenderedAt":278},["ShallowReactive",2],{"project-14477222":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":29,"sentiment":30,"stance_mix":31,"scored_comments":35,"aspects":36,"strip":38,"post_text":30,"what":41,"said":83,"maker_in_thread":170,"shape":175,"grid":179,"attempts":241,"same_week":242,"maker_shows":35,"maker_hidden":271,"reader_version":272,"card":273},"14477222","Pydantic","Data validation using Python 3.6 type hinting","title","Show HN: Pydantic – Data validation using Python 3.6 type hinting","https:\u002F\u002Fpydantic-docs.helpmanual.io\u002F","pydantic-docs.helpmanual.io","scolvin",1496508881,2017,120,27,354,2242,16,"notable","languages","data validation library","library",[24,25,26,27,28],"python","data validation","type hints","json schema","marshmallow","quiet",null,{"positive":32,"neutral":33,"mixed":33,"critical":34},2,1,0,4,{"idea":37},{"positive":33,"critical":34},[34,34,34,34,34,34,34,39,40,34,34,34,39,34,34,40,34,34,34,34,34,34,34,34,34,34,34],5,3,{"problem":42,"audience":53,"pricing":30,"motivation":61,"time_to_build":30,"stack":69,"openness":82,"stage":82,"team_size":82},{"value":43,"source":44,"evidence":45},"Validating and parsing external data such as config files and JSON API responses using Python type annotations","inferred",[46,50],{"id":47,"by":48,"text":49},"14480640","thristian","In the small, it's just using attrs the way it's described in its documentation. In the large, I've been learning about Rust recently and wrapping my head around the…",{"id":51,"by":11,"text":52},"14481117","I don't. I'm not sure it would be that interesting. In short: * I started out with a class that substituted environment variables into itself for settings, still in…",{"value":54,"source":44,"evidence":55},"Python developers",[56,57],{"id":51,"by":11,"text":52},{"id":58,"by":59,"text":60},"14480516","noisy_boy","Do you have a writeup\u002Fblog post on your approach? I would like to read more about it.",{"value":62,"source":63,"evidence":64},"Built after using and finding other validation libraries lacking; faster than trafaret","maker",[65,68],{"id":66,"by":11,"text":67},"14478390","Pydantic is not just a toy, I built it having used and abused numerous other libraries and found them wanting in one way or another. Because it reuses python's typing system it…",{"id":51,"by":11,"text":52},[70,75],{"value":71,"source":63,"evidence":72},"Python 3.6",[73],{"id":74},"post",{"value":76,"source":77,"evidence":78},"attrs","commenter",[79],{"id":80,"by":48,"text":81},"14479695","I've recently been using attrs as an easy way to make simple datatypes, but its only gesture towards validation is an arbitrary callback per field. Hooking into Python 3 type…","unknown",{"praise":84,"objections":100,"requests":115,"questions":127,"alternatives":132},[85,89,93],{"value":86,"source":63,"evidence":87},"Uses Python's typing system for pythonic type descriptions",[88],{"id":66,"by":11,"text":67},{"value":90,"source":77,"evidence":91},"Named typed classes are clearer than generic dicts for external data",[92],{"id":47,"by":48,"text":49},{"value":94,"source":77,"evidence":95},"Listed in an awesome-python models collection",[96],{"id":97,"by":98,"text":99},"14480171","cidnurh","Interesting project! I'm collecting different ORM\u002FODM\u002FMappings for python in this repository: https:\u002F\u002Fgithub.com\u002Fgrundic\u002Fawesome-python-models. Added your library. Thanks!",[101,108],{"value":102,"source":77,"evidence":103},"Not yet mature enough for complex cross-field validation; marshmallow is preferred for that",[104],{"id":105,"by":106,"text":107},"14477434","sametmax","Marshmallow is still the best lib in town. Indeed, most of the libs fall short when you start to use them in the real world. Where validation is more than a type, when fields are…",{"value":109,"source":77,"evidence":110},"Faux immutability and dunder methods not supported",[111,112],{"id":80,"by":48,"text":81},{"id":113,"by":11,"text":114},"14481070","\"faux-immutability\" is a good way to describe it. My problem is the \"faux\"; proper immutability is virtually impossible in python and I'm not convinced about providing partial…",[116,120],{"value":117,"source":77,"evidence":118},"Support __eq__ and immutability",[119],{"id":80,"by":48,"text":81},{"value":121,"source":77,"evidence":122},"Better error handling and control over validation order",[123],{"id":124,"by":125,"text":126},"14478149","rukittenme","Sure, my complaints are mostly around error handling. My comments might not be accurate since its off the top of my head. When a field raises an error I've noticed the value gets…",[128],{"value":129,"source":77,"evidence":130},"Will it support __hash__ and __lt__ like attrs and namedtuple",[131],{"id":80,"by":48,"text":81},[133,139,146,153,160],{"value":28,"source":77,"evidence":134},[135,136],{"id":105,"by":106,"text":107},{"id":137,"by":125,"text":138},"14477485","I agree. Marshmallow is the best game in town and I love using it. That said its not perfect and I'm eagerly awaiting a successor. I use it frequently and have run into a lot of…",{"value":140,"source":77,"evidence":141},"voluptuous",[142],{"id":143,"by":144,"text":145},"14477521","svisser","For those looking to validate dictionaries \u002F JSON responses in Python, the voluptuous library works quite well: http:\u002F\u002Fgithub.com\u002Falecthomas\u002Fvoluptuous. It also works for lists…",{"value":147,"source":77,"evidence":148},"schema library",[149],{"id":150,"by":151,"text":152},"14477813","StavrosK","That's rather verbose, though. I prefer the much more functional \"schema\" library: https:\u002F\u002Fgithub.com\u002Fkeleshev\u002Fschema",{"value":154,"source":77,"evidence":155},"jsonschema",[156],{"id":157,"by":158,"text":159},"14477798","user5994461","JSON has a well defined schema system that works across languages. http:\u002F\u002Fjson-schema.org\u002F Python comes with the jsonschema module out of the box.",{"value":161,"source":77,"evidence":162},"good (py-good)",[163,167],{"id":164,"by":165,"text":166},"14483956","Varriount","I use a fork\u002Fsuccessor library, good[0], for configuration validation. I've especially liked the data transformation it can do (I can easily allow a configuration entry to be a…",{"id":168,"by":165,"text":169},"14484068","What about good[0]? [0] https:\u002F\u002Fgithub.com\u002Fkolypto\u002Fpy-good",{"comments":40,"answered":32,"key":171},[172,173,174],{"id":51,"text":52},{"id":113,"text":114},{"id":66,"text":67},{"commenters":176,"max_depth":39,"maker_replies":40,"first_comment_mins":177,"lifespan_hours":178},18,43,30,[180,182,183,184,187,191,192,195,197,199,201,202,204,206,209,212,214,215,218,220,223,226,230,233,235,238,240],[143,34,34,181,144,34],"other\u002Fneutral\u002Fnone",[157,34,34,181,158,34],[150,34,34,181,151,34],[185,34,34,181,186,34],"14480972","ris",[188,34,34,189,190,34],"14477840","commenter\u002Fcritical\u002Fnone","calvins",[164,34,34,181,165,34],[193,33,34,181,194,34],"14478733","vog",[80,32,39,196,48,34],"project\u002Fpositive\u002Fidea",[58,32,40,198,59,34],"maker\u002Fneutral\u002Fnone",[47,32,34,200,48,34],"other\u002Fpositive\u002Fidea",[51,32,34,198,11,33],[113,32,34,203,11,33],"project\u002Fneutral\u002Fdesign",[97,40,39,205,98,34],"project\u002Fpositive\u002Fnone",[207,35,34,181,208,34],"14477464","juni0r",[210,35,34,189,211,34],"14480739","mkesper",[105,39,40,213,106,34],"project\u002Fmixed\u002Fidea",[137,39,34,181,125,34],[216,39,34,217,106,34],"14477640","commenter\u002Fneutral\u002Fnone",[124,39,34,219,125,34],"other\u002Fcritical\u002Fexecution",[221,39,34,181,222,34],"14478735","fuhrysteve",[224,39,34,225,106,34],"14482495","commenter\u002Fpositive\u002Fnone",[227,39,34,228,229,34],"14477667","other\u002Fneutral\u002Fidea","weberc2",[231,39,34,232,106,34],"14477816","other\u002Fcritical\u002Fidea",[66,39,34,234,11,33],"maker\u002Fpositive\u002Fidea",[236,39,34,181,237,34],"14479666","zepolen",[239,39,34,181,165,34],"14483946",[168,39,34,181,165,34],[],[243,248,253,258,263,267],{"id":244,"name":245,"points":246,"category":247},"14497295","Monica",1097,"productivity",{"id":249,"name":250,"points":251,"category":252},"14484549","findlectures",200,"learning_science",{"id":254,"name":255,"points":256,"category":257},"14471153","Strukt",191,"dev_tools",{"id":259,"name":260,"points":261,"category":262},"14495623","Nimiq",186,"finance_crypto",{"id":264,"name":265,"points":266,"category":252},"14461799","“Statements and State”",141,{"id":268,"name":269,"points":270,"category":262},"14469316","StockNerd",114,false,"v2",{"id":274,"name":5,"line":6,"ai":271,"cat":20,"year":13,"points":14,"comments":15,"rec":29,"s":30,"top":18,"kw":275,"maker":11,"domain":10,"tier":19,"attempts":34,"strip":276,"url":9,"mix":277,"praise":86,"objection":102,"sub":21},14477222,[24,25,26,27,28],"000000053000500300000000000",[32,33,33,34],1793990959722]