Show HN: Kim – A Python serialization and marshaling framework
kim.readthedocs.io
Show HN: Kim – A Python serialization and marshaling framework
1–10 of 61 posts
Re: Show HN: Kim – A Python serialization and marshaling framework
#2Re: Show HN: Kim – A Python serialization and marshaling framework
#3Re: Show HN: Kim – A Python serialization and marshaling framework
#4It does look like marshmalllow[1]. How does relate Kim with it? [1]: https://github.com/marshmallow-code/marshmallow/
Re: Show HN: Kim – A Python serialization and marshaling framework
#5Re: Show HN: Kim – A Python serialization and marshaling framework
#6Re: Show HN: Kim – A Python serialization and marshaling framework
#7Cool! Are there any speed comparisons available between this and marshmallow (or other alternatives)?
We've not really dug into performance yet, though if you look at the last patch (1.0.2) we yielded a 10% speed up by removing an erroneous try/except block.
We've really focussed on features initially and performance is something we're actively researching now. Perhaps we can get some initial benchmarks together and share them with you this week. They will be useful no doubt as we start to plan a release focussed on speed ups.
Thanks for reaching out!
Re: Show HN: Kim – A Python serialization and marshaling framework
#8It does look like marshmalllow[1]. How does relate Kim with it? [1]: https://github.com/marshmallow-code/marshmallow/
Obviously no OS developer owes anybody an explanation, but man would I appreciate if more projects had a "why you should use this over related projects" (like e.g. pendulum does https://github.com/sdispater/pendulum/blob/master/README.rst... )
A great suggestion though, thanks!
Re: Show HN: Kim – A Python serialization and marshaling framework
#9Can it serialize cycles?
thanks for the message. Gonna be honest, I'm not sure what you mean by cycles. Can you elaborate a bit?
Re: Show HN: Kim – A Python serialization and marshaling framework
#10It does look like marshmalllow[1]. How does relate Kim with it? [1]: https://github.com/marshmallow-code/marshmallow/
We started writing Kim around the same time as the Marshmallow project began as we found it wasn't suitable for our needs at that time, though it has come a long way since then.
They are very similar projects and have similar functionality, but Kim has a focus on making it relatively simple to do unusual or 'advanced' things.
For example, Kim supports polymorphism out of the box, if you have an AnimalMapper subclassed by a CatMapper and a DogMapper, passing a Cat and a Dog to AnimalMapper.many.serialize() will automatically do the right thing in a similar way to SQLAlchemy polymorphism.
We also have support for complex requirements such as nesting the same object to itself (useful when your JSON representation is nested but your DB representation is flat,) serialising multiple object fields to a single JSON field (eg full_name consisting of obj.first_name and obj.last_name,) a range of security models for marshalling nested objects and a fairly extensible roles system.
In general we've followed the philosophy "Simple things should be simple. Complex things should be possible."