3

Colander is a Python Pylons tool used to:

validate and deserialize data obtained via XML, JSON, an HTML form post or any other equally simple data serialization

It's kind of like an ORM for semi-structured data; to my mind it would be particularly useful if you're dealing with either:

  1. Lots of third-party APIs returning XML/JSON in proprietary structures
  2. An internal system which needs to serialize and de-serialize the same data (e.g. if you have an internal API to bridge)

I'm working on a Scala project which has both of those requirements - and so I was wondering if there's any equivalent to Colander being worked on for JVM?

Alex Dean
  • 15,575
  • 13
  • 63
  • 74

3 Answers3

3

Simple is very similar to XStream, but simpler to use.

paradigmatic
  • 40,153
  • 18
  • 88
  • 147
2

XStream may be a good choice for such a library

Boris Pavlović
  • 63,078
  • 28
  • 122
  • 148
  • Thanks, marking this as the answer given XStream has limited support for JSON as well as XML (where Simple only does XML) – Alex Dean Jul 21 '11 at 09:01
2

For completeness: I ended up going with JAX-RS/JAXB/Jackson. All of the work I wanted to do with de/serialization was related to RESTful APIs, so it made sense to go with a stack that handled more than just the marshalling. I'm finding it very good to work with - especially as it interoperates with Akka Mist out of the box.

Here are some Stack Overflow posts which were helpful background for me:

Another alternative is Parboiled, from the creator of Scala's Spray framework.

For any Pythonistas who come across this question, it's worth noting an alternative to Colander is DictShield, from the creator of the async framework Brubeck.

I guess I've learnt that good text serialization/deserialization is typically just a component of larger stacks/frameworks.

Community
  • 1
  • 1
Alex Dean
  • 15,575
  • 13
  • 63
  • 74