Re:'New' Python modules of 2015
by fidget on Wednesday December 23, 2015 @12:32PM
(#10784422)
For those of us more dictionary oriented, there is https://pypi.python.org/pypi/voluptuous (which is OK for the most part, as long as you are only trying to do validation, and nothing too crazy)
[ Parent
| on HN ]
Re:'New' Python modules of 2015
by odonnellryan on Wednesday December 23, 2015 @02:00PM
(#10784940)
Similar, I've used this library with a lot of success: https://marshmallow.readthedocs.org/en/latest/
+1 for marshmallow - most of the serialization libraries are 80% there, but marshmallow has it 95% down - all the weird corner cases about nested models and lists of nested models and all that. Plus the dev is very helpful and courteous on github.
I've tried truckloads of Python serialisation libs over the last few years and marshmallow is the one that finally makes me feel like I don't need to look for another one.
Re:'New' Python modules of 2015
by odonnellryan on Wednesday December 23, 2015 @02:53PM
(#10785237)
It's very easy and does everything I've needed it to!
Re:'New' Python modules of 2015
by NightMKoder on Wednesday December 23, 2015 @04:52PM
(#10785901)
Looks extremely similar to https://github.com/schematics/schematics . Always good to see two projects approach the problem the same way independently - higher chance that the solution is right :)
Schematics has a very useful feature in "roles" - i.e. a good way of hiding certain fields in certain situations (e.g. admin views vs self vs other vs anonymous). Does marshmallow have something similar?
Marshmallow is also my favourite lib of the year. Pyramid guys love it too! The developer is responsive, and the library moves really fast!
That looks great, I've built similar things myself and it's great to find someone elses I can use.
hear hear. Steve Loria, the author, has done tremendous work this year. Thanks Steve!
On the binary side Construct is quite nice:
https://construct.readthedocs.org
I've used it for parsing various network protocols to good effect.
Huh, voluptuous looks pretty much exactly the same as schema. Or at least a subset of it, as it doesn't have And/Or/Use, as far as I can see.
Re:'New' Python modules of 2015
by mixmastamyk on Wednesday December 23, 2015 @01:05PM
(#10784607)
I believe it may, perhaps analogous to its Any and All, etc.