All Projects → insightindustry → sqlathanor

insightindustry / sqlathanor

Licence: MIT license
Serialization / De-serialization support for the SQLAlchemy Declarative ORM

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to sqlathanor

avro-serde-php
Avro Serialisation/Deserialisation (SerDe) library for PHP 7.3+ & 8.0 with a Symfony Serializer integration
Stars: ✭ 43 (-59.05%)
Mutual labels:  serialization, deserialization
Orjson
Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy
Stars: ✭ 2,595 (+2371.43%)
Mutual labels:  serialization, deserialization
Flatsharp
Fast, idiomatic C# implementation of Flatbuffers
Stars: ✭ 133 (+26.67%)
Mutual labels:  serialization, deserialization
Yaxlib
Yet Another XML Serialization Library for the .NET Framework and .NET Core
Stars: ✭ 124 (+18.1%)
Mutual labels:  serialization, deserialization
Mashumaro
Fast and well tested serialization framework on top of dataclasses
Stars: ✭ 208 (+98.1%)
Mutual labels:  serialization, deserialization
Borer
Efficient CBOR and JSON (de)serialization in Scala
Stars: ✭ 131 (+24.76%)
Mutual labels:  serialization, deserialization
Noproto
Flexible, Fast & Compact Serialization with RPC
Stars: ✭ 138 (+31.43%)
Mutual labels:  serialization, deserialization
Dataclass factory
Modern way to convert python dataclasses or other objects to and from more common types like dicts or json-like structures
Stars: ✭ 116 (+10.48%)
Mutual labels:  serialization, deserialization
Dart Json Mapper
Serialize / Deserialize Dart Objects to / from JSON
Stars: ✭ 206 (+96.19%)
Mutual labels:  serialization, deserialization
Marshmallow Jsonapi
JSON API 1.0 (https://jsonapi.org/) formatting with marshmallow
Stars: ✭ 203 (+93.33%)
Mutual labels:  serialization, deserialization
Awesome Python Models
A curated list of awesome Python libraries, which implement models, schemas, serializers/deserializers, ODM's/ORM's, Active Records or similar patterns.
Stars: ✭ 124 (+18.1%)
Mutual labels:  serialization, deserialization
Jsonapi Rb
Efficiently produce and consume JSON API documents.
Stars: ✭ 219 (+108.57%)
Mutual labels:  serialization, deserialization
Yyjson
The fastest JSON library in C
Stars: ✭ 1,894 (+1703.81%)
Mutual labels:  serialization, deserialization
Pyjson tricks
Extra features for Python's JSON: comments, order, numpy, pandas, datetimes, and many more! Simple but customizable.
Stars: ✭ 131 (+24.76%)
Mutual labels:  serialization, deserialization
Lora Serialization
LoraWAN serialization/deserialization library for The Things Network
Stars: ✭ 120 (+14.29%)
Mutual labels:  serialization, deserialization
Deku
Declarative binary reading and writing: bit-level, symmetric, serialization/deserialization
Stars: ✭ 136 (+29.52%)
Mutual labels:  serialization, deserialization
Loopback Component Jsonapi
JSONAPI support for loopback.
Stars: ✭ 104 (-0.95%)
Mutual labels:  serialization, deserialization
Typical
Typical: Fast, simple, & correct data-validation using Python 3 typing.
Stars: ✭ 111 (+5.71%)
Mutual labels:  serialization, deserialization
Aspjson
A fast classic ASP JSON parser and encoder for easy JSON manipulation to work with the new JavaScript MV* libraries and frameworks.
Stars: ✭ 165 (+57.14%)
Mutual labels:  serialization, deserialization
Schematics
Project documentation: https://schematics.readthedocs.io/en/latest/
Stars: ✭ 2,461 (+2243.81%)
Mutual labels:  serialization, deserialization

SQLAthanor

Serialization/De-serialization Support for the SQLAlchemy Declarative ORM

SQLAthanor - Serialization/De-serialization for SQLAlchemy
Branch Unit Tests
latest Build Status (Travis CI) Code Coverage Status (Codecov) Documentation Status (ReadTheDocs)
v.0.7 Build Status (Travis CI) Code Coverage Status (Codecov) Documentation Status (ReadTheDocs)
v.0.6 Build Status (Travis CI) Code Coverage Status (Codecov) Documentation Status (ReadTheDocs)
v.0.5 Build Status (Travis CI) Code Coverage Status (Codecov) Documentation Status (ReadTheDocs)
v.0.4 Build Status (Travis CI) Code Coverage Status (Codecov) Documentation Status (ReadTheDocs)
v.0.3 Build Status (Travis CI) Code Coverage Status (Codecov) Documentation Status (ReadTheDocs)
v.0.2 Build Status (Travis CI) Code Coverage Status (Codecov) Documentation Status (ReadTheDocs)
v.0.1 Build Status (Travis CI) Code Coverage Status (Codecov) Documentation Status (ReadTheDocs)
develop Build Status (Travis CI) Code Coverage Status (Codecov) Documentation Status (ReadTheDocs)

SQLAthanor is a Python library that extends SQLAlchemy's fantastic Declarative ORM to provide easy-to-use record serialization/de-serialization with support for:

  • JSON
  • CSV
  • YAML
  • Python dict

The library works as a drop-in extension - change one line of existing code, and it should just work. Furthermore, it has been extensively tested on Python 2.7, 3.4, 3.5, 3.6, 3.7, and 3.8 using SQLAlchemy 0.9 and higher.

COMPLETE DOCUMENTATION: http://sqlathanor.readthedocs.org/en/latest/index.html


Installation

To install SQLAthanor, just execute:

$ pip install sqlathanor

Dependencies

Python 3.x Python 2.7
* SQLAlchemy v.0.9 or higher
* PyYAML v3.10 or higher
* simplejson v3.0 or higher
* SQLAlchemy v.0.9 or higher
* PyYAML v3.10 or higher
* simplejson v3.0 or higher

Why SQLAthanor?

Odds are you've used SQLAlchemy before. And if you haven't, why on earth not? It is hands down the best relational database toolkit and Object Relational Mapper (ORM) available for Python, and has helped me quickly write code for many APIs, software platforms, and data science projects. Just look at some of these great features.

As its name suggests, SQLAlchemy focuses on the problem of connecting your Python code to an underlying relational (SQL) database. That's a super hard problem, especially when you consider the complexity of abstraction, different SQL databases, different SQL dialects, performance optimization, etc. It ain't easy, and the SQLAlchemy team has spent years building one of the most elegant solutions out there.

But as hard as Pythonically communicating with a database is, in the real world with microservices, serverless architectures, RESTful APIs and the like we often need to do more with the data than read or write from/to our database. In almost all of the projects I've worked on over the last two decades, I've had to:

  • hand data off in some fashion (serialize) for another program (possibly written by someone else in another programming language) to work with, or
  • accept and interpret data (de-serialize) received from some other program (possibly written by someone else in another programming language).

Python objects (pickled or not) are great, but they're rarely the best way of transmitting data over the wire, or communicating data between independent applications. Which is where formats like JSON, CSV, and YAML come in.

So when writing many Python APIs, I found myself writing methods to convert my SQLAlchemy records (technically, model instances) into JSON or creating new SQLAlchemy records based on data I received in JSON. So after writing similar methods many times over, I figured a better approach would be to write the serialization/de-serialization code just once, and then re-use it across all of my various projects.

Which is how SQLAthanor came about.

It adds simple methods like to_json(), new_from_csv(), and update_from_csv() to your SQLAlchemy declarative models and provides powerful configuration options that give you tons of flexibility.

Key SQLAthanor Features

  • Easy to adopt: Just tweak your existing SQLAlchemy import statements and you're good to go.
  • With one method call, convert SQLAlchemy model instances to:
    • CSV records
    • JSON objects
    • YAML objects
    • Python dict objects (technically, OrderedDict objects but they behave just like dict)
  • With one method call, create or update SQLAlchemy model instances from:
    • Python dict or OrderedDict objects
    • CSV records
    • JSON objects
    • YAML objects
  • Decide which serialization formats you want to support for which models.
  • Decide which columns/attributes you want to include in their serialized form (and pick different columns for different formats, too).
  • Default validation for de-serialized data for every SQLAlchemy data type.
  • Customize the validation used when de-serializing particular columns to match your needs.
  • Works with Declarative Reflection and the SQLAlchemy Automap extension.
  • Programmatically generate Declarative Base Models from serialized data.
  • Programmatically generate SQLAlchemy Table objects from serialized data.

SQLAthanor vs Alternatives

For a comparison of SQLAthanor to various alternative serialization/de-serialization approaches, please see full documentation: https://sqlathanor.readthedocs.io/en/latest/index.html#sqlathanor-vs-alternatives


Complete Documentation

SQLAthanor is a complex library that integrates with other complex libraries. We strongly recommend that you review our comprehensive documentation at:

https://sqlathanor.readthedocs.org/en/latest/index.html

Questions and Issues

You can ask questions and report issues on the project's Github Issues Page


Contributing

We welcome contributions and pull requests! For more information, please see the Contributor Guide


Testing

We use TravisCI for our build automation, Codecov.io for our test coverage, and ReadTheDocs for our documentation.

Detailed information about our test suite and how to run tests locally can be found in our Testing Reference.


License

SQLAthanor is made available under an MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].