TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Marshmallow: Simplified object serialization for Python

91 点作者 sloria超过 9 年前

10 条评论

kopos超过 9 年前
Used it on a huge project where I wanted the interfaces clean between the Python project at runtime and to serialize the Python objects to the database. Using pickling gave me sleepless night until I moved to Marshmallow. Whilst Django REST Framework comes with a nice serializer and parser modules, marshmallow&#x27;s ability to do just the part was a godsend.<p>This alone gave us the flexibility to expose the Python modules and objects as a simple JSON API and the DB load &#x2F; save came for free.<p>Highly recommended.
评论 #10790590 未加载
gamesbrainiac超过 9 年前
Just wanted to say, this project has some of the best documentation around. Really happy to have this library around :)
Cieplak超过 9 年前
Marshmallow is really useful. +1. If you like Marshmallow, you might also like Pilo (<a href="https:&#x2F;&#x2F;github.com&#x2F;eventbrite&#x2F;pilo" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;eventbrite&#x2F;pilo</a>), which solves similar problems. Marshmallow excels at ORM object serialization. Pilo is really good at parsing JSON into Python objects, and has several features to support this, such as polymorphic downcasting and programmable parsing via hooks. Marshmallow is also very good at parsing&#x2F;validating Python dictionaries, but in my experience, Marshmallow&#x27;s API is more focused on serializing objects into dictionaries so that you can call json.dumps on the output dictionary.
ketralnis超过 9 年前
I&#x27;m also a fan of Schematics (<a href="https:&#x2F;&#x2F;schematics.readthedocs.org&#x2F;en&#x2F;latest&#x2F;" rel="nofollow">https:&#x2F;&#x2F;schematics.readthedocs.org&#x2F;en&#x2F;latest&#x2F;</a>) which is more or less identical in intent
评论 #10790481 未加载
pekk超过 9 年前
I really hate this property magic, it was bad in the Django ORM and it&#x27;ll be bad in Marshmallow too. It looks nice in the examples, but then when you have to use it in anger and a certain problem requires metaclasses to fix...
评论 #10790482 未加载
harlowja超过 9 年前
Maybe object versioning can get added as this gains more and more usage... That will really make this a library that IMHO is production worthy; large applications can&#x27;t be easily upgraded in one-go and having a library that helps with translating across versions would be super.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;marshmallow-code&#x2F;marshmallow&#x2F;issues&#x2F;171" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;marshmallow-code&#x2F;marshmallow&#x2F;issues&#x2F;171</a> (if anyone is interested).
fermigier超过 9 年前
Awesome project. Using it on several customer projects (non public code) and probably soon on Abilian Platform.
ergo14超过 9 年前
I&#x27;m used to colander - <a href="http:&#x2F;&#x2F;colander.readthedocs.org&#x2F;en&#x2F;latest&#x2F;" rel="nofollow">http:&#x2F;&#x2F;colander.readthedocs.org&#x2F;en&#x2F;latest&#x2F;</a>
sandGorgon超过 9 年前
has anyone used ANY object serialization library (other than pickle) with multiprocessing ?<p>I just cant get anything else to work. We have a sophisticated desktop pyqt application that could really do with a better serialization with multiprocessing.<p>I have heard of Pathos[1] to replace multiprocessing - but never gave it a try.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;uqfoundation&#x2F;pathos" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;uqfoundation&#x2F;pathos</a>
andrewchambers超过 9 年前
And then there is clojure where you just keep things as data all the time.