Skip to main content

Simple object serialization for SQLAlchemy

Project description

SerialAlchemy adds serialization to SQLAlchemy ORM objects via a mixin class. It is tightly coupled with SQLAlchemy, because it’s the best thing ever invented.

About

SerialAlchemy aims to be the one serialization library that I use for web projects. If other people like it, that’s cool too. Released under the MIT License, so fork away!

Why create SerialAlchemy?

The serialization problem for web apps has been solved many times over. I had been using marshmallow for several projects. It’s a great library, and has its own justification for existence.

While I liked working with marshmallow just fine, it is designed to be very broad and fit a lot of different situations. I mostly create small web applications, so my situation rarely changes.

If there is one reason for creating SerialAlchemy, it is the fact that I didn’t like the idea of defining my models, then having to define marshmallow schemas. It felt like redundancy to me. Keeping the marshmallow schema in sync with model changes was also a pain, but feeling like I was repeating myself was the bigger reason.

And yes, “alAl” in SerialAlchemy bothers me, but SeriAlchemy sounds too much like Siri-Alchemy, and I fear Apple’s legal team.

Why not use SerialAlchemy?

I thought I’d take a different approach to selling this. Truth is, I made this library for me, and don’t really care if anyone else uses it.

  • SQLAlchemy is required. This library simply won’t work without it.

  • While SerialAlchemy is not beholden to any particular web framework, it doesn’t make a lot of sense outside the web application area. SQLAlchemy has a built-in way to serialize expressions, and the result sets can be pickled.

  • There is no data validation. SQLAlchemy has simple validation built-in, and I feel like something more extensive is outside the scope of this project.

  • SerialAlchemy is Python 3 only. Get used to it ;)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

SerialAlchemy-0.3.1.tar.gz (6.1 kB view hashes)

Uploaded Source

Built Distribution

SerialAlchemy-0.3.1-py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page